openapi: 3.0.1
info:
  title: Assets
  description: >
    Search, retrieve, tag, relate, and batch-edit digital assets (images,
    video, audio, documents, and presentations) in Canto's Digital Asset
    Management library.
  version: 1.0.2
servers:
  - url: "https://{tenantSubdomain}.{region}/api/v1"
    variables:
      tenantSubdomain:
        default: demo
      region:
        default: canto.com
        enum:
          - canto.com
          - canto.global
          - canto.de
          - au.canto.com
          - ca.canto.com
security:
  - cantoOAuth2: []
  - bearerAuth: []
tags:
  - name: Assets
    description: Search, retrieve, tag, relate, and batch-edit digital assets.
paths:
  /search:
    get:
      tags:
        - Assets
      summary: Search / Filter
      operationId: get_v1_search
      description: >
        Searches or filters assets across the whole library. If a filter
        field is a string type (e.g. keyword), you can search a single
        value or multiple values -- some multi-value filters support both OR
        and AND combination, others support only OR.


        Use the literal value `__null__` to match assets with no value set
        in a field, or `__exists__` to match assets with any value set in a
        field. Combine multiple values with OR using `|` (e.g.
        `standard|freeze`) or with AND using `+` (e.g. `sunset+beach+people`).
      parameters:
        - name: keyword
          in: query
          required: false
          description: >
            The search term(s), matching the same free-text search used by
            the Canto UI's top-right search box.
          schema:
            type: string
        - name: scheme
          in: query
          required: false
          description: >
            Filter by content scheme: image, video, audio, document,
            presentation, or other. Case sensitive.
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: tags
          in: query
          required: false
          description: Filter by tag. Supports OR (`sunset|dawn`) and AND (`sunset+beach`) combination.
          schema:
            type: string
        - name: tagsLiteral
          in: query
          required: false
          description: Filter by tag, case-sensitive and whole-word only (e.g. "blue" does not match "Blue").
          schema:
            type: string
        - name: keywords
          in: query
          required: false
          description: >
            Filter by keywords attached via the Attach keyword to content
            operation. Supports OR and AND combination.
          schema:
            type: string
        - name: approval
          in: query
          required: false
          description: >
            Filter by approval status. Only applies when the approval
            process is enabled. Supports OR combination, except that
            "expired" cannot be combined with any other status.
          schema:
            type: string
        - name: owner
          in: query
          required: false
          description: Filter by owner id/email. Supports OR combination.
          schema:
            type: string
        - name: fileSize
          in: query
          required: false
          description: 'Filter by file size in bytes, as a range. Example: 95073..26893954'
          schema:
            type: string
        - name: created
          in: query
          required: false
          description: Filter by the time the asset was created in Canto.
          schema:
            type: string
        - name: createdTime
          in: query
          required: false
          description: Filter by file creation time (Unix timestamp).
          schema:
            type: string
        - name: uploadedTime
          in: query
          required: false
          description: Filter by upload time (Unix timestamp).
          schema:
            type: string
        - name: expirationDate
          in: query
          required: false
          description: Filter by expiration time (Unix timestamp in milliseconds).
          schema:
            type: string
        - name: lastModified
          in: query
          required: false
          description: Filter by last-modified time (Unix timestamp).
          schema:
            type: string
        - name: width
          in: query
          required: false
          description: >
            Filter by image width in pixels. A bare value (e.g. `400`)
            matches exactly; a range (e.g. `400..1024`) matches inside the
            range. Images only.
          schema:
            type: string
        - name: height
          in: query
          required: false
          description: Filter by image height in pixels. Same value format as width. Images only.
          schema:
            type: string
        - name: imageRangeOperation
          in: query
          required: false
          description: >
            Whether width and height filters combine with OR (either
            matches) or AND (both must match).
          schema:
            type: string
            enum: [or, and]
            default: or
        - name: dimension
          in: query
          required: false
          description: Filter by image size (the longest side). Images only.
          schema:
            type: string
        - name: resolution
          in: query
          required: false
          description: Filter by resolution in DPI. Images only.
          schema:
            type: string
        - name: orientation
          in: query
          required: false
          description: Filter by image orientation. Images only. Supports OR combination.
          schema:
            type: string
            enum: [landscape, portrait, square]
        - name: duration
          in: query
          required: false
          description: Filter by duration. Video or audio only.
          schema:
            type: string
        - name: pageNumber
          in: query
          required: false
          description: Filter by page number. Document or presentation only.
          schema:
            type: string
        - name: storageClass
          in: query
          required: false
          description: Filter by storage class. Supports OR combination.
          schema:
            type: string
            enum: [standard, freeze]
        - name: latestReviewDate
          in: query
          required: false
          description: >
            Filter to contents not reviewed between tenant creation and this
            time. Supported in the main library and workspaces.
          schema:
            type: string
        - name: sortBy
          in: query
          required: false
          description: Field to sort by.
          schema:
            type: string
            enum: [name, time, scheme, owner, size]
            default: time
        - name: sortDirection
          in: query
          required: false
          schema:
            type: string
            enum: [ascending, descending]
            default: descending
        - name: limit
          in: query
          required: false
          description: Maximum number of items to return. Max 1000.
          schema:
            type: integer
            default: 100
        - name: start
          in: query
          required: false
          description: Offset of the first item to return.
          schema:
            type: integer
            default: 0
        - name: searchInField
          in: query
          required: false
          description: >
            Restrict the keyword search to specific fields: filename,
            description, comment, keywords, author, tags. Other values are
            ignored.
          schema:
            type: string
        - name: operator
          in: query
          required: false
          schema:
            type: string
            enum: [and, or]
            default: and
        - name: exactMatch
          in: query
          required: false
          schema:
            type: boolean
            default: false
        - name: colorModel
          in: query
          required: false
          description: Filter by image color model.
          schema:
            type: string
            enum: [RGB, CMYK]
        - name: $filter
          in: query
          required: false
          description: >
            Negative filter ("not") for tagsLiteral and keywords, using OData
            syntax. Example: `$filter=tagsLiteral ne 'Blue' and keywords ne
            'Canto'`.
          schema:
            type: string
      responses:
        "200":
          description: A page of matching assets with search facets.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/search_result"
  /{scheme}:
    get:
      tags:
        - Assets
      summary: List the content of specified scheme
      operationId: get_v1_scheme
      description: >
        Lists the content of the specified scheme, page by page, with brief
        content info only. Supports the same filter parameters as Search /
        Filter, scoped to the given scheme.
      parameters:
        - name: scheme
          in: path
          required: true
          description: image, video, audio, document, presentation, or other. Case sensitive.
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: keyword
          in: query
          required: false
          schema:
            type: string
        - name: tags
          in: query
          required: false
          schema:
            type: string
        - name: tagsLiteral
          in: query
          required: false
          schema:
            type: string
        - name: keywords
          in: query
          required: false
          schema:
            type: string
        - name: approval
          in: query
          required: false
          schema:
            type: string
        - name: owner
          in: query
          required: false
          schema:
            type: string
        - name: fileSize
          in: query
          required: false
          schema:
            type: string
        - name: created
          in: query
          required: false
          schema:
            type: string
        - name: createdTime
          in: query
          required: false
          schema:
            type: string
        - name: uploadedTime
          in: query
          required: false
          schema:
            type: string
        - name: lastModified
          in: query
          required: false
          schema:
            type: string
        - name: dimension
          in: query
          required: false
          schema:
            type: string
        - name: width
          in: query
          required: false
          schema:
            type: string
        - name: height
          in: query
          required: false
          schema:
            type: string
        - name: resolution
          in: query
          required: false
          schema:
            type: string
        - name: orientation
          in: query
          required: false
          schema:
            type: string
            enum: [landscape, portrait, square]
        - name: duration
          in: query
          required: false
          schema:
            type: string
        - name: pageNumber
          in: query
          required: false
          schema:
            type: string
        - name: storageClass
          in: query
          required: false
          schema:
            type: string
            enum: [standard, freeze]
        - name: searchInField
          in: query
          required: false
          schema:
            type: string
        - name: exactMatch
          in: query
          required: false
          schema:
            type: boolean
            default: false
        - name: operator
          in: query
          required: false
          schema:
            type: string
            enum: [and, or]
            default: and
        - name: sortBy
          in: query
          required: false
          schema:
            type: string
            enum: [name, time, scheme, owner, size]
            default: time
        - name: sortDirection
          in: query
          required: false
          schema:
            type: string
            enum: [ascending, descending]
        - name: start
          in: query
          required: false
          schema:
            type: integer
            default: 0
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
        - name: imageRangeOperation
          in: query
          required: false
          schema:
            type: string
            enum: [or, and]
            default: or
      responses:
        "200":
          description: A page of matching assets with search facets, scoped to the given scheme.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/search_result"
  /{scheme}/{contentId}:
    get:
      tags:
        - Assets
      summary: Get content details
      operationId: get_v1_scheme_contentId
      description: >
        Returns full content details: general properties, URLs, default and
        custom fields, version history, and metadata. Use the `detail` URL
        from the `url` object to open the asset in Canto.
      parameters:
        - name: scheme
          in: path
          required: true
          description: image, video, audio, document, presentation, or other.
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: contentId
          in: path
          required: true
          description: The id of the content.
          schema:
            type: string
        - name: extendedRelationInfo
          in: query
          required: false
          description: >
            If true, returns an expanded relation format grouping related
            files (see the relatedFiles example). Default false.
          schema:
            type: boolean
            default: false
        - name: noXMPMetadata
          in: query
          required: false
          description: If true, disables the metadata section and skips reading metadata from storage.
          schema:
            type: boolean
            default: false
      responses:
        "200":
          description: The requested asset's full details.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/asset_detail"
              examples:
                image:
                  summary: An image asset
                  value:
                    metadata:
                      File Type: image
                      Image Size: 480x480
                      MIME Type: image/jpeg
                    additional:
                      Product ID: null
                      Rating: null
                    time: "20201222132638577"
                    url:
                      preview: https://demo.canto.com/api_binary/v1/image/<content-id>/preview
                      download: https://demo.canto.com/api_binary/v1/image/<content-id>
                      detail: https://demo.canto.com/smartalbum/image?column=image&id=<content-id>
                      directUrlOriginal: https://demo.canto.com/direct/image/<content-id>/<hash>/original
                      directUrlPreview: https://demo.canto.com/direct/image/<content-id>/<hash>/m800/800
                    created: "20201222132638577"
                    width: "480"
                    height: "480"
                    dpi: "72"
                    versionHistory:
                      - no: "1"
                        ownerName: Canto Support
                        created: "19700101010000000"
                        time: "20201222132638577"
                        versionId: <version-id>
                        comment: null
                        uri:
                          preview: https://demo.canto.com/api_binary/v1/image/<content-id>/<version-id>/preview
                          download: https://demo.canto.com/api_binary/v1/image/<content-id>/<version-id>
                    relatedFile:
                      - id: <related-content-id>
                        scheme: image
                        name: myRelatedFile.jpg
                    lastUploaded: "20201222132638577"
                    approvalStatus: Pending
                    ownerName: Canto Support
                    name: myFile.jpg
                    default:
                      Size: "20709"
                      Dimensions: 480*480 Pixels
                      Content Type: image/jpeg
                    id: <content-id>
                    size: "20709"
                    scheme: image
                    owner: Canto Support (canto-support@canto.com)
                extendedRelations:
                  summary: extendedRelationInfo=true grouping related files
                  value:
                    relatedFiles:
                      - relatedId: <related-group-id>
                        relatedName: Relation Group 1
                        fileCount: 1
                        relatedContents:
                          - id: <related-content-id>
                            scheme: image
                            name: Test.png
        "404":
          description: The content does not exist.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
  /batch/content:
    post:
      tags:
        - Assets
      summary: Batch Get Content Detail
      operationId: post_v1_batch_content
      description: >
        Returns full content details -- general properties, URLs, default
        and custom fields, version history, and metadata -- for up to 100
        contents in a single request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              maxItems: 100
              items:
                $ref: "#/components/schemas/content_ref"
      responses:
        "200":
          description: Batch results, split into found (docResult) and not-found (failed) contents.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/batch_content_detail_result"
    delete:
      tags:
        - Assets
      summary: Batch delete content
      operationId: delete_v1_batch_content
      description: Batch-deletes contents. Deleted contents move to the trash bin.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/content_ref"
      responses:
        "200":
          description: An empty array on success.
          content:
            application/json:
              schema:
                type: array
                items: {}
              example: []
  /batch/content/permanent:
    delete:
      tags:
        - Assets
      summary: Batch permanently delete content
      operationId: delete_v1_batch_content_permanent
      description: >
        Permanently deletes contents from the trash bin. Set `portalId` to
        permanently delete content on a portal instead.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                allOf:
                  - $ref: "#/components/schemas/content_ref"
                  - type: object
                    properties:
                      portalId:
                        type: string
                        description: Optional. The portal id, if permanently deleting content on a portal.
      responses:
        "200":
          description: An empty array on success.
          content:
            application/json:
              schema:
                type: array
                items: {}
              example: []
  /batch/edit:
    post:
      tags:
        - Assets
      summary: Batch Edit Content Get
      operationId: post_v1_batch_edit_get
      description: Returns the current information-field values for multiple assets.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/content_ref"
      responses:
        "200":
          description: Current field values for the requested assets.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                approvalStatus: [Approved]
                autoApproveDate: null
                availableKeywords: [Campaign, Company, Lifestyle, Product]
                description: null
                tag: [Backpack]
                keyword: [Product]
                expirationDate: null
        "404":
          description: A referenced content does not exist.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
              example:
                code: 2303
                message: The content <content-id> does not exist.
    put:
      tags:
        - Assets
      summary: Batch Edit Content Apply
      operationId: put_v1_batch_edit
      description: >
        Saves information-field values for a batch of assets.


        Each entry in `properties` names a `propertyId` (the field's name,
        not its id) and a `propertyValue`. `propertyValue` permits an empty
        string; for `expirationDate`/`autoApproveDate` use `YYYY-MM-DD
        HH:mm`; for `keyword`/`tag` separate multiple values with commas;
        for a DATE custom field use `YYYY-MM-DD`; for a SINGLECHOICE or
        MULTICHOICE custom field the value must match a choice from Get
        Custom Field List; for a LABEL custom field the value is a
        hexadecimal color (e.g. `#FFFFFF`); for a RATING custom field values
        range 1-5; MULTICHOICE and LABEL fields may take an array of values.


        `action` permits an empty string; for `description` use `append` or
        `cover` (default); for `keyword`, `tag`, or a MULTICHOICE/LABEL
        custom field use `add` (default) or `remove`. `customField` is
        `true` if the field is a custom field, `false` otherwise (default).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [contents, properties]
              properties:
                contents:
                  type: array
                  items:
                    $ref: "#/components/schemas/content_ref"
                properties:
                  type: array
                  items:
                    type: object
                    required: [propertyId, propertyValue]
                    properties:
                      propertyId:
                        type: string
                      propertyValue:
                        description: A string, or an array of strings for MULTICHOICE/LABEL custom fields.
                      action:
                        type: string
                        enum: ["", append, cover, add, remove]
                      customField:
                        type: boolean
                        default: false
      responses:
        "200":
          description: The literal text "success" on completion.
          content:
            text/plain:
              schema:
                type: string
              example: success
  /{scheme}/{contentId}/rename:
    put:
      tags:
        - Assets
      summary: Rename content
      operationId: put_v1_scheme_contentId_rename
      description: Renames an asset.
      parameters:
        - name: scheme
          in: path
          required: true
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: contentId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [name]
              properties:
                name:
                  type: string
                  description: The new name of the asset.
      responses:
        "200":
          description: Renamed successfully.
  /share/batch/:
    put:
      tags:
        - Assets
      summary: Create Share Links
      operationId: put_v1_share_batch
      description: >
        Creates share links for a batch of contents. `expires` is null for
        a link that never expires. `hideShareBy` hides the sharing user on
        the share page. `allowDownloadOriginal` permits downloading the
        original file (otherwise only a converted rendition is available).
        `allowCropAndResize` shows crop/resize options on the download page.
        `allowPresets` permits downloading via a preset. `displayMetadata`
        shows metadata to the recipient.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                shareDetail:
                  $ref: "#/components/schemas/share_detail"
                contents:
                  type: array
                  items:
                    $ref: "#/components/schemas/content_ref"
      responses:
        "200":
          description: The created share link, as plain text.
          content:
            text/plain:
              schema:
                type: string
              example: "https://demo.canto.com/b/<share-id>"
  /share/batch/container:
    put:
      tags:
        - Assets
      summary: Batch share an album
      operationId: put_v1_share_batch_container
      description: >
        Creates a share link for a batch of albums. Folders are not
        supported yet -- scheme must be `album`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [containers, shareDetail]
              properties:
                containers:
                  type: array
                  items:
                    type: object
                    required: [id, scheme]
                    properties:
                      id:
                        type: string
                        description: Id of the album.
                      scheme:
                        type: string
                        enum: [album]
                shareDetail:
                  $ref: "#/components/schemas/share_detail"
      responses:
        "200":
          description: The created share link, as plain text.
          content:
            text/plain:
              schema:
                type: string
              example: "https://demo.canto.com/s/<share-id>"
  /{scheme}/{contentId}/tag/{tag}:
    put:
      tags:
        - Assets
      summary: Attach tag to content
      operationId: put_v1_scheme_contentId_tag_tag
      description: >
        Attaches a plain-text tag to content. Attaching a tag that's
        already present still returns 200 OK.
      parameters:
        - name: scheme
          in: path
          required: true
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: contentId
          in: path
          required: true
          schema:
            type: string
        - name: tag
          in: path
          required: true
          description: The plain text of the tag.
          schema:
            type: string
      responses:
        "200":
          description: Attached (or already present).
    delete:
      tags:
        - Assets
      summary: Remove tag from content
      operationId: delete_v1_scheme_contentId_tag_tag
      description: >
        Removes a plain-text tag from content. If the tag isn't attached,
        this still returns 200 OK.
      parameters:
        - name: scheme
          in: path
          required: true
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: contentId
          in: path
          required: true
          schema:
            type: string
        - name: tag
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Removed (or was not attached).
        "404":
          description: The content does not exist.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
  /keyword:
    post:
      tags:
        - Assets
      summary: Add Keywords
      operationId: post_v1_keyword
      description: Adds a new keyword, available for later attachment to content.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [name, description]
              properties:
                name:
                  type: string
                  description: Name of the keyword.
                description:
                  type: string
                  description: Description of the keyword.
      responses:
        "200":
          description: The literal text "success" on completion.
          content:
            text/plain:
              schema:
                type: string
              example: success
  /{scheme}/{contentId}/keyword/{keyword}:
    put:
      tags:
        - Assets
      summary: Attach keyword to content
      operationId: put_v1_scheme_contentId_keyword_keyword
      description: >
        Attaches an existing keyword to content. Attaching an
        already-attached keyword still returns 200 OK.
      parameters:
        - name: scheme
          in: path
          required: true
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: contentId
          in: path
          required: true
          schema:
            type: string
        - name: keyword
          in: path
          required: true
          description: The plain text of the keyword.
          schema:
            type: string
      responses:
        "200":
          description: Attached (or already present).
        "404":
          description: The keyword or content does not exist.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
    delete:
      tags:
        - Assets
      summary: Remove keyword from content
      operationId: delete_v1_scheme_contentId_keyword_keyword
      description: >
        Removes a keyword from content. Returns 200 OK even if the keyword
        wasn't attached, or isn't defined on the account at all.
      parameters:
        - name: scheme
          in: path
          required: true
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: contentId
          in: path
          required: true
          schema:
            type: string
        - name: keyword
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Removed (or was not attached).
        "404":
          description: The content does not exist.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
  /batch/album:
    post:
      tags:
        - Assets
      summary: Assign Content to Album
      operationId: post_v1_batch_album
      description: Batch-assigns contents to an album.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [albumPath, contents]
              properties:
                albumPath:
                  type: string
                  description: Id of the target album (not the readable folder/album path).
                contents:
                  type: array
                  items:
                    allOf:
                      - $ref: "#/components/schemas/content_ref"
                      - type: object
                        required: [displayName]
                        properties:
                          displayName:
                            type: string
                            description: Display name of the content.
      responses:
        "200":
          description: >
            An array of per-content failures (empty when every content was
            assigned successfully). Uses the same failure item shape as
            Remove Contents from Album.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/batch_album_failure"
              example: []
    delete:
      tags:
        - Assets
      summary: Remove Contents from Album
      operationId: delete_v1_batch_album
      description: Batch-removes contents from an album.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [albumPath, contents]
              properties:
                albumPath:
                  type: string
                contents:
                  type: array
                  items:
                    allOf:
                      - $ref: "#/components/schemas/content_ref"
                      - type: object
                        required: [displayName]
                        properties:
                          displayName:
                            type: string
      responses:
        "200":
          description: >
            An array of per-content failures. Empty when every content was
            removed successfully; otherwise contains one entry per failed
            content, echoing the request's id/scheme/displayName with
            `reason`/`code` describing the failure.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/batch_album_failure"
              examples:
                success:
                  summary: Every content removed successfully
                  value: []
                partialFailure:
                  summary: A content could not be removed
                  value:
                    - id: <content-id>
                      scheme: image
                      displayName: <display-name>
                      portalId: null
                      deletedParent: null
                      reason: An unknown error occurred [Code=3000].
                      code: null
  /{scheme}/{contentId}/smarttags/{smarttag}:
    delete:
      tags:
        - Assets
      summary: Remove smart tag from content
      operationId: delete_v1_scheme_contentId_smarttags_smarttag
      description: >
        Removes a smart tag from content. Returns 200 OK even if the smart
        tag wasn't attached.
      parameters:
        - name: scheme
          in: path
          required: true
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: contentId
          in: path
          required: true
          schema:
            type: string
        - name: smarttag
          in: path
          required: true
          description: The plain text of the smart tag.
          schema:
            type: string
      responses:
        "200":
          description: Removed (or was not attached).
  /related:
    post:
      tags:
        - Assets
      summary: Create Related Content
      operationId: post_v1_related
      description: >
        Creates a relation between multiple distinct assets. Multiple
        assets in the relation may be marked `primary`. Limit: max 1000
        related contents per request. Fewer than two distinct assets
        (e.g. relating a single asset to itself) is rejected with a 400.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [relatedContents]
              properties:
                relatedName:
                  type: string
                  description: The label of the related-content group.
                relatedContents:
                  type: array
                  minItems: 2
                  maxItems: 1000
                  description: At least two distinct assets are required to form a relation.
                  items:
                    allOf:
                      - $ref: "#/components/schemas/content_ref"
                      - type: object
                        properties:
                          primary:
                            type: boolean
                            description: Whether this asset is a primary asset in the relation. Multiple assets may be primary.
      responses:
        "200":
          description: The literal text "relatedId" on completion.
          content:
            text/plain:
              schema:
                type: string
              example: relatedId
        "400":
          description: Fewer than two distinct assets were given (e.g. relating an asset to itself).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
              example:
                code: 2110
                message: Invalid input.
  /{scheme}/{contentId}/unrelated:
    post:
      tags:
        - Assets
      summary: Remove Related Content
      operationId: post_v1_scheme_contentId_unrelated
      description: Removes related assets from the asset given by the path parameters.
      parameters:
        - name: scheme
          in: path
          required: true
          schema:
            type: string
            enum: [image, video, audio, document, presentation, other]
        - name: contentId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [unRelatedContents]
              properties:
                unRelatedContents:
                  type: array
                  items:
                    $ref: "#/components/schemas/content_ref"
      responses:
        "200":
          description: The literal text "success" on completion.
          content:
            text/plain:
              schema:
                type: string
              example: success
  /segment/video/{contentId}:
    post:
      tags:
        - Assets
      summary: Create Embed Video
      operationId: post_v1_segment_video_contentId
      description: >
        Creates an embeddable video script. Returns immediately; call Get
        content details afterward to retrieve the embed video URL once
        created.


        A fully-processed video may still receive a 500 (see below)
        rather than the 200 response documented above -- this may depend
        on whether the embed-video feature is enabled for the account.
      parameters:
        - name: contentId
          in: path
          required: true
          description: The id of the content.
          schema:
            type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
      responses:
        "200":
          description: >
            success is "true" if creation was accepted; "false" with a
            message otherwise (invalid argument, content not found, exceed,
            or no-permission).
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                    enum: ["true", "false"]
                  message:
                    type: string
              example:
                success: "true"
                message: ""
        "500":
          description: An unexpected server error while creating the embed video script.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
              example:
                code: 3000
                message: Sorry, we ran into an unknown issue. Please send us a screenshot of this screen to https://support.canto.com.
  /unrelated:
    post:
      tags:
        - Assets
      summary: Remove Related Contents From Related Files
      operationId: post_v1_unrelated
      description: >
        Removes related assets from the related-files groups referenced by
        `relatedFiles`. Limit: 1-1000 contents and 1-100 groups per request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [relatedContents, relatedFiles]
              properties:
                relatedContents:
                  type: array
                  minItems: 1
                  maxItems: 1000
                  items:
                    $ref: "#/components/schemas/content_ref"
                relatedFiles:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                  description: Related-file group ids.
      responses:
        "200":
          description: The literal text "success" on completion.
          content:
            text/plain:
              schema:
                type: string
              example: success
  /version/comment:
    post:
      tags:
        - Assets
      summary: Add version comment
      operationId: post_v1_version_comment
      description: Adds a comment to a specific version of an asset.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [scheme, id, versionId, comment]
              properties:
                scheme:
                  type: string
                  enum: [image, video, audio, document, presentation, other]
                id:
                  type: string
                versionId:
                  type: string
                  description: A version id from the asset's versionHistory.
                comment:
                  type: string
      responses:
        "200":
          description: The literal text "success" on completion.
          content:
            text/plain:
              schema:
                type: string
              example: success
components:
  securitySchemes:
    cantoOAuth2:
      type: oauth2
      description: >
        Authorize against your own Canto account. Choose the tenant and its
        region in the portal first; the portal fills in the application
        identifier for that region and pre-fills your account name on
        Canto's sign-in page. This is a public-client PKCE flow: no client
        secret is used, and none is held by the portal.
      flows:
        authorizationCode:
          authorizationUrl: https://oauth.canto.com/oauth/api/oauth2/universal2/authorize
          tokenUrl: https://oauth.canto.com/oauth/api/oauth2/universal2/token
          scopes: {}
          x-usePkce: plain
          x-tokenName: accessToken
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: AccessToken
      description: >
        Paste a Target-API OAuth Token obtained out-of-band. Use the
        Authorize button instead to obtain one interactively.
  schemas:
    content_ref:
      type: object
      required: [id, scheme]
      properties:
        id:
          type: string
          description: Id of the content.
        scheme:
          type: string
          enum: [image, video, audio, document, presentation, other]
    batch_album_failure:
      type: object
      description: One content that could not be assigned to or removed from an album.
      properties:
        id:
          type: string
        scheme:
          type: string
        displayName:
          type: string
        portalId:
          type: string
          nullable: true
        deletedParent:
          type: string
          nullable: true
        reason:
          type: string
          description: Human-readable failure reason.
        code:
          type: integer
          nullable: true
    share_detail:
      type: object
      properties:
        expires:
          type: string
          nullable: true
          description: 'Format: yyyy-MM-dd. Null if the link never expires.'
        hideShareBy:
          type: boolean
          description: If true, the sharing user's name is hidden on the share page.
        allowDownloadOriginal:
          type: boolean
          description: If true, the original file can be downloaded; otherwise only a converted rendition is available.
        allowCropAndResize:
          type: boolean
          description: If true, the download page shows crop and resize options.
        allowPresets:
          type: boolean
          description: If true, the download page allows downloading via a preset.
        displayMetadata:
          type: boolean
          description: If true, the recipient can view metadata.
    asset_url:
      type: object
      description: >
        Rendition/action URLs for an asset. Which keys are present depends
        on the asset's scheme.
      properties:
        preview:
          type: string
          description: >
            An image view of the content (first page for documents, a
            smaller image for images). 240px by default; append
            /{dimension} to request a different size, up to the server's
            configured maximum.
        download:
          type: string
          description: The original content file.
        metadata:
          type: string
          description: The XML metadata extracted from the original file.
        HighJPG:
          type: string
          description: The image as a high-quality JPG.
        LowJPG:
          type: string
          description: The image as a lower-quality (smaller) JPG.
        PNG:
          type: string
          description: The image as a PNG.
        directUrlOriginal:
          type: string
          description: A direct, unauthenticated download URL for the original file.
        directUrlPreview:
          type: string
          description: A direct, unauthenticated preview URL.
        detail:
          type: string
          description: Opens the asset's detail page in Canto.
        hlsLocation:
          type: string
          description: HLS streaming manifest URL. Video only.
        dashLocation:
          type: string
          description: DASH streaming manifest URL. Video only.
    version_history_entry:
      type: object
      properties:
        no:
          type: string
        ownerName:
          type: string
        created:
          type: string
        time:
          type: string
        versionId:
          type: string
        comment:
          type: string
          nullable: true
        uri:
          type: object
          properties:
            preview:
              type: string
            download:
              type: string
        currentVersion:
          type: boolean
    related_album:
      type: object
      properties:
        id:
          type: string
        scheme:
          type: string
          enum: [album]
        name:
          type: string
        namePath:
          type: string
        idPath:
          type: string
        width:
          type: string
        height:
          type: string
        dpi:
          type: string
        size:
          type: string
        url:
          type: object
          properties:
            detail:
              type: string
    asset_detail:
      type: object
      description: Full detail response returned by Get content details / Batch Get Content Detail.
      properties:
        id:
          type: string
        scheme:
          type: string
          enum: [image, video, audio, document, presentation, other]
        name:
          type: string
        size:
          type: string
        owner:
          type: string
        ownerName:
          type: string
        width:
          type: string
        height:
          type: string
        dpi:
          type: string
        created:
          type: string
        time:
          type: string
          description: The last-modified time.
        lastUploaded:
          type: string
        expirationDate:
          type: string
          nullable: true
        termsAndConditions:
          type: string
          description: Present only if DRM is enabled and a value is set.
        copyright:
          type: string
          description: Present only if DRM is enabled and a value is set.
        approvalStatus:
          type: string
          enum: [Pending, Approved, Restricted]
        metadata:
          type: object
          additionalProperties: true
          description: Metadata extracted from the original file.
        additional:
          type: object
          additionalProperties: true
          description: Custom field values.
        default:
          type: object
          additionalProperties: true
          description: Canto default field values.
        url:
          $ref: "#/components/schemas/asset_url"
        versionHistory:
          type: array
          items:
            $ref: "#/components/schemas/version_history_entry"
        relatedFile:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              scheme:
                type: string
              name:
                type: string
        relatedFiles:
          type: array
          description: Present only when extendedRelationInfo=true, grouping related content.
          items:
            type: object
            properties:
              relatedId:
                type: string
              relatedName:
                type: string
              fileCount:
                type: integer
              relatedContents:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    scheme:
                      type: string
                    name:
                      type: string
    search_result_item:
      allOf:
        - $ref: "#/components/schemas/asset_detail"
        - type: object
          properties:
            keyword:
              type: array
              items:
                type: string
            tag:
              type: array
              items:
                type: string
            relatedAlbums:
              type: array
              items:
                $ref: "#/components/schemas/related_album"
    search_facet:
      type: object
      description: >
        A facet summarizing the current result set for one field. Numeric
        fields report min/max (and mix, a duplicate of min); categorical
        fields report the distinct value list.
      properties:
        name:
          type: string
        min:
          type: integer
        max:
          type: integer
        mix:
          type: integer
        value:
          type: array
          items:
            type: string
    search_result:
      type: object
      properties:
        facets:
          type: array
          items:
            $ref: "#/components/schemas/search_facet"
        limit:
          type: integer
        found:
          type: integer
          description: The total number of matching assets.
        sortBy:
          type: string
        sortDirection:
          type: string
        matchExpr:
          type: string
        results:
          type: array
          items:
            $ref: "#/components/schemas/search_result_item"
    batch_content_detail_result:
      type: object
      properties:
        docResult:
          type: array
          items:
            $ref: "#/components/schemas/asset_detail"
        failed:
          type: array
          items:
            $ref: "#/components/schemas/content_ref"
    error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
