{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canva/json-schema/canva-get-image-transformation-job-response-schema.json",
  "title": "GetImageTransformationJobResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canva-image-transformation-api-openapi.yml#/components/schemas/GetImageTransformationJobResponse",
  "properties": {
    "job": {
      "$ref": "#/$defs/ImageTransformationJob"
    }
  },
  "required": [
    "job"
  ],
  "type": "object",
  "$defs": {
    "Asset": {
      "description": "The asset object, which contains metadata about the asset.",
      "properties": {
        "type": {
          "$ref": "#/$defs/AssetType"
        },
        "id": {
          "description": "The ID of the asset.",
          "type": "string"
        },
        "name": {
          "description": "The name of the asset.",
          "type": "string"
        },
        "tags": {
          "description": "The user-facing tags attached to the asset.\nUsers can add these tags to their uploaded assets, and they can search their uploaded\nassets in the Canva UI by searching for these tags. For information on how users use\ntags, see the\n[Canva Help Center page on asset tags](https://www.canva.com/help/add-edit-tags/).",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "import_status": {
          "$ref": "#/$defs/ImportStatus"
        },
        "created_at": {
          "description": "When the asset was added to Canva, as a Unix timestamp (in seconds since the Unix\nEpoch).",
          "format": "int64",
          "type": "integer"
        },
        "updated_at": {
          "description": "When the asset was last updated in Canva, as a Unix timestamp (in seconds since the\nUnix Epoch).",
          "format": "int64",
          "type": "integer"
        },
        "owner": {
          "$ref": "#/$defs/TeamUserSummary"
        },
        "thumbnail": {
          "$ref": "#/$defs/Thumbnail"
        },
        "metadata": {
          "$ref": "#/$defs/AssetMetadata"
        }
      },
      "required": [
        "created_at",
        "id",
        "name",
        "owner",
        "tags",
        "type",
        "updated_at"
      ],
      "type": "object"
    },
    "AssetMetadata": {
      "description": "Type-specific metadata for the asset.",
      "oneOf": [
        {
          "$ref": "#/$defs/ImageMetadata"
        },
        {
          "$ref": "#/$defs/VideoMetadata"
        }
      ],
      "type": "object"
    },
    "AssetType": {
      "description": "Type of an asset.",
      "enum": [
        "image",
        "video"
      ],
      "type": "string"
    },
    "ImageMetadata": {
      "properties": {
        "type": {
          "enum": [
            "image"
          ],
          "type": "string"
        },
        "width": {
          "description": "The width of the image in pixels.",
          "format": "int32",
          "type": "integer"
        },
        "height": {
          "description": "The height of the image in pixels.",
          "format": "int32",
          "type": "integer"
        },
        "smart_tags": {
          "description": "AI-generated tags for the image.",
          "items": {
            "maxLength": 50,
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "ImageTransformationError": {
      "description": "If the image transformation job fails, this object provides details about the error.\nOnly present if the job status is `failed`.",
      "properties": {
        "code": {
          "$ref": "#/$defs/ImageTransformationErrorCode"
        },
        "message": {
          "description": "A human-readable description of what went wrong.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "ImageTransformationErrorCode": {
      "description": "Error code indicating what went wrong with the image transformation.",
      "enum": [
        "no_foreground_found",
        "quota_exceeded",
        "internal_error"
      ],
      "type": "string",
      "x-enum-descriptions": [
        "No foreground subject was found in the image, so there is no background to remove.",
        "The user has run out of quota, such as their AI credit quota. The quota isn't necessarily specific to the requested transformations.",
        "An unexpected error occurred during the transformation."
      ]
    },
    "ImageTransformationJob": {
      "description": "Details about the image transformation job. If the job status is `success`, the job's\n`result` is present.",
      "properties": {
        "id": {
          "description": "The image transformation job ID. Only present if the job status is `in_progress`.\nA job that completes immediately returns its `result` or `error` directly and has\nno ID to poll.",
          "pattern": "^[a-zA-Z0-9_-]{1,50}$",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/ImageTransformationJobStatus"
        },
        "result": {
          "$ref": "#/$defs/ImageTransformationJobResult"
        },
        "error": {
          "$ref": "#/$defs/ImageTransformationError"
        }
      },
      "required": [
        "status"
      ],
      "type": "object"
    },
    "ImageTransformationJobResult": {
      "description": "Result of the image transformation job. Only present if the job status is `success`.",
      "properties": {
        "asset": {
          "allOf": [
            {
              "$ref": "#/$defs/Asset"
            }
          ],
          "description": "The new image asset produced by applying all of the requested transformations."
        }
      },
      "required": [
        "asset"
      ],
      "type": "object"
    },
    "ImageTransformationJobStatus": {
      "description": "The status of the image transformation job. A newly created job will be `in_progress`\nand will eventually become `success` or `failed`. A job may also complete\nimmediately, returning `success` or `failed` from job creation. If the status is\n`success`, the job's `result` is present.",
      "enum": [
        "failed",
        "in_progress",
        "success"
      ],
      "type": "string"
    },
    "ImportError": {
      "deprecated": true,
      "description": "If the import fails, this object provides details about the error.",
      "properties": {
        "code": {
          "$ref": "#/$defs/ImportErrorCode"
        },
        "message": {
          "description": "A human-readable description of what went wrong.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "ImportErrorCode": {
      "deprecated": true,
      "description": "A short string indicating why the upload failed. This field can be used to handle errors programmatically.\n",
      "enum": [
        "file_too_big",
        "import_failed"
      ],
      "type": "string"
    },
    "ImportStatus": {
      "deprecated": true,
      "description": "The import status of the asset.",
      "properties": {
        "state": {
          "$ref": "#/$defs/ImportStatusState"
        },
        "error": {
          "$ref": "#/$defs/ImportError"
        }
      },
      "required": [
        "state"
      ],
      "type": "object"
    },
    "ImportStatusState": {
      "deprecated": true,
      "description": "State of the import job for an uploaded asset.",
      "enum": [
        "failed",
        "in_progress",
        "success"
      ],
      "type": "string"
    },
    "TeamUserSummary": {
      "description": "Metadata for the user, consisting of the User ID and Team ID.",
      "properties": {
        "user_id": {
          "description": "The ID of the user.",
          "type": "string"
        },
        "team_id": {
          "description": "The ID of the user's Canva Team.",
          "type": "string"
        }
      },
      "required": [
        "team_id",
        "user_id"
      ],
      "type": "object"
    },
    "Thumbnail": {
      "description": "A thumbnail image representing the object.",
      "properties": {
        "width": {
          "description": "The width of the thumbnail image in pixels.",
          "format": "int32",
          "type": "integer"
        },
        "height": {
          "description": "The height of the thumbnail image in pixels.",
          "format": "int32",
          "type": "integer"
        },
        "url": {
          "description": "A URL for retrieving the thumbnail image.\nThis URL expires after 15 minutes. This URL includes a query string\nthat's required for retrieving the thumbnail.",
          "type": "string"
        }
      },
      "required": [
        "height",
        "url",
        "width"
      ],
      "type": "object"
    },
    "VideoMetadata": {
      "properties": {
        "type": {
          "enum": [
            "video"
          ],
          "type": "string"
        },
        "width": {
          "description": "The width of the video in pixels.",
          "format": "int32",
          "type": "integer"
        },
        "height": {
          "description": "The height of the video in pixels.",
          "format": "int32",
          "type": "integer"
        },
        "duration": {
          "description": "The duration of the video in seconds.",
          "format": "int32",
          "type": "integer"
        }
      },
      "required": [
        "height",
        "type",
        "width"
      ],
      "type": "object"
    }
  }
}