> ## Documentation Index
> Fetch the complete documentation index at: https://docs.artbucket.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Promote an upload, or ingest from a URL

> With `token`: promote a staged upload. With `url`: the server fetches it (public addresses only). Identical bytes dedupe to the existing asset (200). Without the write scope the new asset is `proposed`, and required fields may be left for the person who approves it. C2PA Content Credentials in the file are read into `c2pa`, and set `origin` and `generator` unless given. With `versionOf`, it is a new version of that asset: filed where it is, with its tags and fields, and current once approved.

Scope: `propose`.



## OpenAPI

````yaml /openapi.json post /api/v1/assets
openapi: 3.1.0
info:
  title: artbucket
  version: '1'
  description: >-
    Agent-first asset management. The web UI is built on this API and nothing
    else, beside signing in at /api/auth. Send `Authorization: Bearer <key>`: a
    key works in one workspace with one scope, and scopes are a ladder: read <
    propose < write < admin. People signed in to the app carry a session cookie
    instead, and their scope is what their grants add up to: on the
    organization, the workspace, or single collections and assets. A scope shown
    as needed on the workspace is also enough on the one collection or asset a
    route acts on. Agents (MCP at POST /api/v1/mcp) usually get `propose`: what
    they add waits for a human.
servers:
  - url: http://localhost:3000
security:
  - bearer: []
  - session: []
  - {}
paths:
  /api/v1/assets:
    post:
      summary: Promote an upload, or ingest from a URL
      description: >-
        With `token`: promote a staged upload. With `url`: the server fetches it
        (public addresses only). Identical bytes dedupe to the existing asset
        (200). Without the write scope the new asset is `proposed`, and required
        fields may be left for the person who approves it. C2PA Content
        Credentials in the file are read into `c2pa`, and set `origin` and
        `generator` unless given. With `versionOf`, it is a new version of that
        asset: filed where it is, with its tags and fields, and current once
        approved.


        Scope: `propose`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    token:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      description: From POST /api/v1/uploads, after the PUT
                    filename:
                      type: string
                      minLength: 1
                      maxLength: 512
                    mime:
                      type: string
                      minLength: 1
                      maxLength: 255
                    fields:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                      description: Custom field values, keyed by field key
                    collections:
                      maxItems: 50
                      type: array
                      items:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    tags:
                      maxItems: 100
                      type: array
                      items:
                        type: string
                        maxLength: 64
                    rights:
                      description: What it may be used for; null or {} says nothing
                      anyOf:
                        - type: object
                          properties:
                            license:
                              description: >-
                                e.g. "Royalty-free", "CC BY 4.0", "Getty,
                                rights-managed"
                              anyOf:
                                - type: string
                                  maxLength: 200
                                - type: 'null'
                            territories:
                              description: >-
                                Countries it may run in (ISO 3166-1 alpha-2);
                                empty: anywhere
                              maxItems: 250
                              type: array
                              items:
                                type: string
                                pattern: ^[A-Z]{2}$
                            channels:
                              description: >-
                                What it may be used for, e.g. web, print,
                                paid-social; empty: anything
                              maxItems: 50
                              type: array
                              items:
                                type: string
                                pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
                            embargo:
                              description: Not to be used before this day
                              anyOf:
                                - type: string
                                  format: date
                                  pattern: >-
                                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                                - type: 'null'
                            expires:
                              anyOf:
                                - type: string
                                  format: date
                                  pattern: >-
                                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                                - type: 'null'
                              description: The last day it may be used
                            modelRelease:
                              anyOf:
                                - type: string
                                  enum:
                                    - released
                                    - missing
                                    - not-needed
                                - type: 'null'
                          additionalProperties: false
                        - type: 'null'
                    origin:
                      description: Defaults to what its Content Credentials say, if any
                      anyOf:
                        - type: string
                          enum:
                            - shot
                            - licensed
                            - generated
                        - type: 'null'
                    parentAssetId:
                      description: >-
                        The asset it was made from: the photo an edit started
                        from, a model's input
                      anyOf:
                        - type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        - type: 'null'
                    generator:
                      description: The tool or model that made it, e.g. "gpt-image 2.0"
                      anyOf:
                        - type: string
                          maxLength: 200
                        - type: 'null'
                    prompt:
                      description: 'For a generated asset: what it was asked for'
                      anyOf:
                        - type: string
                          maxLength: 10000
                        - type: 'null'
                    versionOf:
                      description: >-
                        A new version of this asset: it joins its version stack,
                        collections, tags and fields, and with write on it
                        becomes current
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    status:
                      description: >-
                        draft keeps it out of the library until it is submitted
                        and approved. Without write it is proposed whatever this
                        says
                      type: string
                      enum:
                        - draft
                        - active
                  required:
                    - token
                    - filename
                    - mime
                  additionalProperties: false
                - type: object
                  properties:
                    url:
                      type: string
                      maxLength: 2048
                      format: uri
                      description: >-
                        Public http(s) URL the server fetches. A Figma or Google
                        Docs, Sheets, Slides or Drive link is kept as the link
                        and shows as its embed
                    filename:
                      description: >-
                        Defaults to the URL's last path segment, or a linked
                        file's title
                      type: string
                      minLength: 1
                      maxLength: 512
                    fields:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                      description: Custom field values, keyed by field key
                    collections:
                      maxItems: 50
                      type: array
                      items:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    tags:
                      maxItems: 100
                      type: array
                      items:
                        type: string
                        maxLength: 64
                    rights:
                      description: What it may be used for; null or {} says nothing
                      anyOf:
                        - type: object
                          properties:
                            license:
                              description: >-
                                e.g. "Royalty-free", "CC BY 4.0", "Getty,
                                rights-managed"
                              anyOf:
                                - type: string
                                  maxLength: 200
                                - type: 'null'
                            territories:
                              description: >-
                                Countries it may run in (ISO 3166-1 alpha-2);
                                empty: anywhere
                              maxItems: 250
                              type: array
                              items:
                                type: string
                                pattern: ^[A-Z]{2}$
                            channels:
                              description: >-
                                What it may be used for, e.g. web, print,
                                paid-social; empty: anything
                              maxItems: 50
                              type: array
                              items:
                                type: string
                                pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
                            embargo:
                              description: Not to be used before this day
                              anyOf:
                                - type: string
                                  format: date
                                  pattern: >-
                                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                                - type: 'null'
                            expires:
                              anyOf:
                                - type: string
                                  format: date
                                  pattern: >-
                                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                                - type: 'null'
                              description: The last day it may be used
                            modelRelease:
                              anyOf:
                                - type: string
                                  enum:
                                    - released
                                    - missing
                                    - not-needed
                                - type: 'null'
                          additionalProperties: false
                        - type: 'null'
                    origin:
                      description: Defaults to what its Content Credentials say, if any
                      anyOf:
                        - type: string
                          enum:
                            - shot
                            - licensed
                            - generated
                        - type: 'null'
                    parentAssetId:
                      description: >-
                        The asset it was made from: the photo an edit started
                        from, a model's input
                      anyOf:
                        - type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        - type: 'null'
                    generator:
                      description: The tool or model that made it, e.g. "gpt-image 2.0"
                      anyOf:
                        - type: string
                          maxLength: 200
                        - type: 'null'
                    prompt:
                      description: 'For a generated asset: what it was asked for'
                      anyOf:
                        - type: string
                          maxLength: 10000
                        - type: 'null'
                    versionOf:
                      description: >-
                        A new version of this asset: it joins its version stack,
                        collections, tags and fields, and with write on it
                        becomes current
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    status:
                      description: >-
                        draft keeps it out of the library until it is submitted
                        and approved. Without write it is proposed whatever this
                        says
                      type: string
                      enum:
                        - draft
                        - active
                  required:
                    - url
                  additionalProperties: false
      responses:
        '200':
          description: Deduped to an existing asset
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      workspaceId:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      sha256:
                        type: string
                      filename:
                        type: string
                      mime:
                        type: string
                      size:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      width:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                      height:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                      probe:
                        anyOf:
                          - type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                          - type: 'null'
                      metadata:
                        anyOf:
                          - type: object
                            properties:
                              title:
                                type: string
                              description:
                                type: string
                              keywords:
                                type: array
                                items:
                                  type: string
                              creator:
                                type: string
                              copyright:
                                type: string
                              capturedAt:
                                type: string
                              camera:
                                type: string
                              lens:
                                type: string
                              gps:
                                type: object
                                properties:
                                  lat:
                                    type: number
                                  lon:
                                    type: number
                                required:
                                  - lat
                                  - lon
                                additionalProperties: false
                            additionalProperties: false
                          - type: 'null'
                      tags:
                        type: array
                        items:
                          type: string
                      fields:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type:
                            - string
                            - number
                            - boolean
                        description: The asset's own values
                      inherited:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type:
                            - string
                            - number
                            - boolean
                        description: Values inherited from its collections; own values win
                      status:
                        type: string
                        enum:
                          - draft
                          - proposed
                          - active
                          - archived
                          - rejected
                        description: >-
                          draft, proposed (in review), active (approved),
                          archived or rejected
                      state:
                        type: string
                        enum:
                          - draft
                          - proposed
                          - active
                          - expired
                          - archived
                          - rejected
                          - deleted
                        description: >-
                          The status; expired for an approved asset past its
                          last day of use; deleted, until restored or purged
                      deletedAt:
                        anyOf:
                          - type: string
                            format: date-time
                            pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                          - type: 'null'
                        description: >-
                          When it was deleted: restorable for 30 days, then
                          purged
                      stackId:
                        anyOf:
                          - type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          - type: 'null'
                        description: >-
                          Versions of one thing share a stack; null when it has
                          one version
                      version:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                        description: Its number in the stack
                      current:
                        type: boolean
                        description: >-
                          Its stack's current approved version: the others are
                          superseded by it
                      proposedBy:
                        description: >-
                          For a proposal: who made it, a person's or an API
                          key's name
                        type:
                          - string
                          - 'null'
                      reviewNote:
                        description: Why a person rejected it
                        type:
                          - string
                          - 'null'
                      proposedTags:
                        type: array
                        items:
                          type: string
                      rights:
                        anyOf:
                          - type: object
                            properties:
                              license:
                                type:
                                  - string
                                  - 'null'
                              territories:
                                type: array
                                items:
                                  type: string
                                description: 'ISO 3166-1 alpha-2; empty: anywhere'
                              channels:
                                type: array
                                items:
                                  type: string
                                description: 'empty: any use'
                              embargo:
                                anyOf:
                                  - type: string
                                    format: date
                                    pattern: >-
                                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                                  - type: 'null'
                                description: Not before this day
                              expires:
                                anyOf:
                                  - type: string
                                    format: date
                                    pattern: >-
                                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                                  - type: 'null'
                                description: The last day it may be used
                              modelRelease:
                                anyOf:
                                  - type: string
                                    enum:
                                      - released
                                      - missing
                                      - not-needed
                                  - type: 'null'
                            required:
                              - license
                              - territories
                              - channels
                              - embargo
                              - expires
                              - modelRelease
                            additionalProperties: false
                          - type: 'null'
                      origin:
                        anyOf:
                          - type: string
                            enum:
                              - shot
                              - licensed
                              - generated
                          - type: 'null'
                      parentAssetId:
                        anyOf:
                          - type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          - type: 'null'
                      generator:
                        type:
                          - string
                          - 'null'
                      prompt:
                        type:
                          - string
                          - 'null'
                      c2pa:
                        anyOf:
                          - type: object
                            properties:
                              manifests:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              generator:
                                description: The app that signed it
                                type:
                                  - string
                                  - 'null'
                              title:
                                type:
                                  - string
                                  - 'null'
                              signedBy:
                                description: >-
                                  The signing certificate's organization, as the
                                  file claims it; not verified
                                type:
                                  - string
                                  - 'null'
                              actions:
                                type: array
                                items:
                                  type: string
                              digitalSourceType:
                                description: >-
                                  IPTC: digitalCapture,
                                  trainedAlgorithmicMedia...
                                type:
                                  - string
                                  - 'null'
                              softwareAgent:
                                description: The tool the actions name, often the model
                                type:
                                  - string
                                  - 'null'
                              ingredients:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                            required:
                              - manifests
                              - generator
                              - title
                              - signedBy
                              - actions
                              - digitalSourceType
                              - softwareAgent
                              - ingredients
                            additionalProperties: false
                          - type: 'null'
                        description: >-
                          Content Credentials read from the file; the original
                          keeps the signed manifest
                      supersededBy:
                        anyOf:
                          - type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          - type: 'null'
                        description: The asset that replaces this one
                      private:
                        type: boolean
                        description: >-
                          Its own flag; it is private too when every collection
                          it is in is
                      collections:
                        type: array
                        items:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      createdAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                      updatedAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                    required:
                      - id
                      - workspaceId
                      - sha256
                      - filename
                      - mime
                      - size
                      - width
                      - height
                      - probe
                      - metadata
                      - tags
                      - fields
                      - inherited
                      - status
                      - state
                      - deletedAt
                      - stackId
                      - version
                      - current
                      - proposedBy
                      - reviewNote
                      - proposedTags
                      - rights
                      - origin
                      - parentAssetId
                      - generator
                      - prompt
                      - c2pa
                      - supersededBy
                      - private
                      - collections
                      - createdAt
                      - updatedAt
                    additionalProperties: false
                  deduped:
                    type: boolean
                required:
                  - data
                  - deduped
                additionalProperties: false
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      workspaceId:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      sha256:
                        type: string
                      filename:
                        type: string
                      mime:
                        type: string
                      size:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      width:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                      height:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                      probe:
                        anyOf:
                          - type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                          - type: 'null'
                      metadata:
                        anyOf:
                          - type: object
                            properties:
                              title:
                                type: string
                              description:
                                type: string
                              keywords:
                                type: array
                                items:
                                  type: string
                              creator:
                                type: string
                              copyright:
                                type: string
                              capturedAt:
                                type: string
                              camera:
                                type: string
                              lens:
                                type: string
                              gps:
                                type: object
                                properties:
                                  lat:
                                    type: number
                                  lon:
                                    type: number
                                required:
                                  - lat
                                  - lon
                                additionalProperties: false
                            additionalProperties: false
                          - type: 'null'
                      tags:
                        type: array
                        items:
                          type: string
                      fields:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type:
                            - string
                            - number
                            - boolean
                        description: The asset's own values
                      inherited:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type:
                            - string
                            - number
                            - boolean
                        description: Values inherited from its collections; own values win
                      status:
                        type: string
                        enum:
                          - draft
                          - proposed
                          - active
                          - archived
                          - rejected
                        description: >-
                          draft, proposed (in review), active (approved),
                          archived or rejected
                      state:
                        type: string
                        enum:
                          - draft
                          - proposed
                          - active
                          - expired
                          - archived
                          - rejected
                          - deleted
                        description: >-
                          The status; expired for an approved asset past its
                          last day of use; deleted, until restored or purged
                      deletedAt:
                        anyOf:
                          - type: string
                            format: date-time
                            pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                          - type: 'null'
                        description: >-
                          When it was deleted: restorable for 30 days, then
                          purged
                      stackId:
                        anyOf:
                          - type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          - type: 'null'
                        description: >-
                          Versions of one thing share a stack; null when it has
                          one version
                      version:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                        description: Its number in the stack
                      current:
                        type: boolean
                        description: >-
                          Its stack's current approved version: the others are
                          superseded by it
                      proposedBy:
                        description: >-
                          For a proposal: who made it, a person's or an API
                          key's name
                        type:
                          - string
                          - 'null'
                      reviewNote:
                        description: Why a person rejected it
                        type:
                          - string
                          - 'null'
                      proposedTags:
                        type: array
                        items:
                          type: string
                      rights:
                        anyOf:
                          - type: object
                            properties:
                              license:
                                type:
                                  - string
                                  - 'null'
                              territories:
                                type: array
                                items:
                                  type: string
                                description: 'ISO 3166-1 alpha-2; empty: anywhere'
                              channels:
                                type: array
                                items:
                                  type: string
                                description: 'empty: any use'
                              embargo:
                                anyOf:
                                  - type: string
                                    format: date
                                    pattern: >-
                                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                                  - type: 'null'
                                description: Not before this day
                              expires:
                                anyOf:
                                  - type: string
                                    format: date
                                    pattern: >-
                                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                                  - type: 'null'
                                description: The last day it may be used
                              modelRelease:
                                anyOf:
                                  - type: string
                                    enum:
                                      - released
                                      - missing
                                      - not-needed
                                  - type: 'null'
                            required:
                              - license
                              - territories
                              - channels
                              - embargo
                              - expires
                              - modelRelease
                            additionalProperties: false
                          - type: 'null'
                      origin:
                        anyOf:
                          - type: string
                            enum:
                              - shot
                              - licensed
                              - generated
                          - type: 'null'
                      parentAssetId:
                        anyOf:
                          - type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          - type: 'null'
                      generator:
                        type:
                          - string
                          - 'null'
                      prompt:
                        type:
                          - string
                          - 'null'
                      c2pa:
                        anyOf:
                          - type: object
                            properties:
                              manifests:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              generator:
                                description: The app that signed it
                                type:
                                  - string
                                  - 'null'
                              title:
                                type:
                                  - string
                                  - 'null'
                              signedBy:
                                description: >-
                                  The signing certificate's organization, as the
                                  file claims it; not verified
                                type:
                                  - string
                                  - 'null'
                              actions:
                                type: array
                                items:
                                  type: string
                              digitalSourceType:
                                description: >-
                                  IPTC: digitalCapture,
                                  trainedAlgorithmicMedia...
                                type:
                                  - string
                                  - 'null'
                              softwareAgent:
                                description: The tool the actions name, often the model
                                type:
                                  - string
                                  - 'null'
                              ingredients:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                            required:
                              - manifests
                              - generator
                              - title
                              - signedBy
                              - actions
                              - digitalSourceType
                              - softwareAgent
                              - ingredients
                            additionalProperties: false
                          - type: 'null'
                        description: >-
                          Content Credentials read from the file; the original
                          keeps the signed manifest
                      supersededBy:
                        anyOf:
                          - type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          - type: 'null'
                        description: The asset that replaces this one
                      private:
                        type: boolean
                        description: >-
                          Its own flag; it is private too when every collection
                          it is in is
                      collections:
                        type: array
                        items:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      createdAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                      updatedAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                    required:
                      - id
                      - workspaceId
                      - sha256
                      - filename
                      - mime
                      - size
                      - width
                      - height
                      - probe
                      - metadata
                      - tags
                      - fields
                      - inherited
                      - status
                      - state
                      - deletedAt
                      - stackId
                      - version
                      - current
                      - proposedBy
                      - reviewNote
                      - proposedTags
                      - rights
                      - origin
                      - parentAssetId
                      - generator
                      - prompt
                      - c2pa
                      - supersededBy
                      - private
                      - collections
                      - createdAt
                      - updatedAt
                    additionalProperties: false
                  deduped:
                    type: boolean
                required:
                  - data
                  - deduped
                additionalProperties: false
        default:
          description: An error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      detail: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: 'An API key: ab_...'
    session:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Signed in, at /api/auth

````