{
    "openapi": "3.1.0",
    "info": {
        "title": "Cbox Assets API",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api.cboxassets.com"
        }
    ],
    "security": [
        {
            "bearer": []
        }
    ],
    "paths": {
        "/v1/assets": {
            "post": {
                "operationId": "createAsset",
                "summary": "Create an asset from a file (base64) or a public URL. The original is stored unchanged as version 1.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255,
                                        "description": "The filename when left out."
                                    },
                                    "filename": {
                                        "type": "string",
                                        "maxLength": 255,
                                        "description": "Original filename, such as mug-front.png."
                                    },
                                    "content_base64": {
                                        "type": "string",
                                        "maxLength": 8388608,
                                        "description": "The file, base64-encoded. Up to ASSETS_DIRECT_UPLOAD_MAX_BYTES; larger files use an upload session (createUpload)."
                                    },
                                    "source_url": {
                                        "type": "string",
                                        "maxLength": 2000,
                                        "description": "Fetch the file from this public URL instead. Private, reserved and metadata addresses are refused."
                                    },
                                    "sha256": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "description": "Refuse the file when its SHA-256 differs."
                                    },
                                    "folder_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "nullable": true
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 50,
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "metadata": {
                                        "type": "object",
                                        "additionalProperties": true,
                                        "description": "Typed values by key: string, number, boolean, null or a list of strings."
                                    },
                                    "storage": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "`managed` or a storage location id; the organization default when left out."
                                    },
                                    "visibility": {
                                        "type": "string",
                                        "enum": [
                                            "public",
                                            "private"
                                        ],
                                        "description": "public (default): delivery URLs are permanent. private: delivery URLs expire with expires_in."
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "listAssets",
                "summary": "List assets, newest first.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "folder_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 40,
                            "description": "Only assets directly in this folder; `root` for those in no folder."
                        }
                    },
                    {
                        "name": "collection_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 63
                        }
                    },
                    {
                        "name": "kind",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "image",
                                "video",
                                "document",
                                "other"
                            ]
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 100,
                            "description": "Words in the title."
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200,
                            "description": "Search title, tags and metadata values. Every word must match the start of a word in them; -word excludes."
                        }
                    },
                    {
                        "name": "where",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "maxItems": 10,
                            "items": {
                                "type": "string"
                            },
                            "description": "Metadata filters `key=value`, all of which must hold. A list value matches when it contains the value; a number or boolean field compares as that type."
                        }
                    },
                    {
                        "name": "related_to",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 40,
                            "description": "Only assets linked from or to this asset."
                        }
                    },
                    {
                        "name": "trashed",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "description": "true lists the trash instead: deleted assets waiting to be purged."
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "description": "Page size, 1 to 100; 25 when left out."
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 512,
                            "description": "`next_cursor` from the previous page."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}": {
            "get": {
                "operationId": "getAsset",
                "summary": "One asset with its versions.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "updateAsset",
                "summary": "Change an asset's title, folder, tags or metadata. The original file never changes. Pass `version` to refuse a change made on a stale copy.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "version": {
                                        "type": "integer",
                                        "minimum": 1
                                    },
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255,
                                        "minLength": 1
                                    },
                                    "folder_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "nullable": true
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 50,
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "metadata": {
                                        "type": "object",
                                        "additionalProperties": true,
                                        "description": "Replaces the metadata object."
                                    },
                                    "visibility": {
                                        "type": "string",
                                        "enum": [
                                            "public",
                                            "private"
                                        ],
                                        "description": "Making an asset private stops every permanent delivery URL handed out for it and clears the CDN."
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "deleteAsset",
                "summary": "Move an asset to the trash. Its delivery URLs stop at once; it is deleted for good, with files no other version uses, after the trash period (30 days unless changed). An asset under a retention hold cannot be deleted.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/delivery/revoke": {
            "post": {
                "operationId": "revokeAssetDelivery",
                "summary": "Stop every delivery URL handed out for this asset so far, such as after a link leaked or an image must come down. The CDN's copies are cleared too. Asking for a transformation again answers a new URL; the stored results are kept and do not count against the plan again.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/relations": {
            "post": {
                "operationId": "addAssetRelation",
                "summary": "Link this asset to another: related, variant_of, part_of or derived_from. Adding a link that exists is harmless.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "kind": {
                                        "type": "string",
                                        "enum": [
                                            "related",
                                            "variant_of",
                                            "part_of",
                                            "derived_from"
                                        ]
                                    },
                                    "related_asset_id": {
                                        "type": "string",
                                        "maxLength": 40
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "kind",
                                    "related_asset_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/relations/{kind}/{related_asset_id}": {
            "delete": {
                "operationId": "removeAssetRelation",
                "summary": "Remove a link between two assets. Both assets stay.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "kind",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "related",
                                "variant_of",
                                "part_of",
                                "derived_from"
                            ]
                        }
                    },
                    {
                        "name": "related_asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/restore": {
            "post": {
                "operationId": "restoreAsset",
                "summary": "Take an asset out of the trash. Delivery URLs handed out before it was deleted stay stopped; ask for new ones.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/retention": {
            "patch": {
                "operationId": "setAssetRetention",
                "summary": "Hold an asset until a time: until then it cannot be deleted or purged. null lifts the hold.",
                "tags": [
                    "Library"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "retain_until": {
                                        "type": "string",
                                        "format": "date-time",
                                        "nullable": true,
                                        "description": "ISO 8601, in the future; null lifts the hold."
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions": {
            "post": {
                "operationId": "createAssetVersion",
                "summary": "Add a new version of an asset from a file (base64) or a public URL. Earlier versions, and the original as version 1, stay unchanged and downloadable.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "filename": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "content_base64": {
                                        "type": "string",
                                        "maxLength": 8388608,
                                        "description": "The file, base64-encoded."
                                    },
                                    "source_url": {
                                        "type": "string",
                                        "maxLength": 2000,
                                        "description": "Fetch the file from this public URL instead."
                                    },
                                    "sha256": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "description": "Refuse the file when its SHA-256 differs."
                                    },
                                    "storage": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "`managed` or a storage location id; the organization default when left out."
                                    },
                                    "if_current_version_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "Refuse with version_conflict when another version was added since you read the asset."
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}": {
            "get": {
                "operationId": "getAssetVersion",
                "summary": "One immutable version: size, type, SHA-256 and where it is stored.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/download": {
            "post": {
                "operationId": "createDownloadUrl",
                "summary": "A short-lived URL that downloads this version's exact bytes.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "expires_in": {
                                        "type": "integer",
                                        "minimum": 60,
                                        "maximum": 3600,
                                        "description": "Seconds; 900 when left out."
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/preview": {
            "get": {
                "operationId": "getPreview",
                "summary": "The preview of a document (PDF) or video version: page 1 or a poster frame, drawn once in the background after upload, so its state is queued, rendering, ready or failed. When ready, the answer has a short-lived URL to it as a PNG, the page count of a PDF, and a video's media facts (duration_ms, width, height, codecs, frame_rate, bit_rate); transformAssetVersion and createVariants make thumbnails of any size from it.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "expires_in",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 60,
                            "maximum": 3600,
                            "description": "Seconds the URL works; 900 when left out."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/preview/retry": {
            "post": {
                "operationId": "retryPreview",
                "summary": "Draw a failed preview again, such as after the original was replaced in a connected bucket. Only a failed preview can be retried; the answer is the preview, queued.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/rendition": {
            "get": {
                "operationId": "getRendition",
                "summary": "The web rendition of a video version: H.264 and AAC in MP4, at most 1080 pixels tall, transcoded once in the background after its poster. Its state is queued, transcoding, ready or failed; when ready, the answer has a short-lived URL that plays in any browser, and its size, duration and SHA-256. Its stream is the adaptive version (HLS, rungs of 360, 720 and 1080 pixels up to the rendition's height), packaged after the rendition: its state is none, queued, packaging, ready or failed, and when ready its url is the master playlist on the delivery host (Safari and iOS play it natively, other browsers with hls.js), permanent for a public asset and expiring for a private one.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "expires_in",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 60,
                            "maximum": 3600,
                            "description": "Seconds the URL works; 900 when left out."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/rendition/retry": {
            "post": {
                "operationId": "retryRendition",
                "summary": "Transcode a failed web rendition again, or package its adaptive stream again when the rendition is ready and the stream failed or never started. Anything else is refused; the answer is the rendition, with the retried part queued.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/responsive": {
            "post": {
                "operationId": "createResponsiveSet",
                "summary": "The widths of one image version for a responsive <img>: each width is built once and reused, and the answer has a ready srcset of delivery URLs (short-lived storage URLs while CDN delivery is off), the widest as src, and the sizes you sent. Height follows the aspect ratio unless you give height_ratio.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "widths": {
                                        "type": "array",
                                        "maxItems": 12,
                                        "items": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 8192
                                        },
                                        "description": "Pixel widths, such as [320, 640, 960, 1280]."
                                    },
                                    "height_ratio": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 1000,
                                        "description": "Height as a per mille of the width, such as 1000 for square or 563 for 16:9; the image fills it by cropping around the focus. Left out: the image's own aspect ratio."
                                    },
                                    "focus": {
                                        "type": "string",
                                        "enum": [
                                            "center",
                                            "attention",
                                            "entropy"
                                        ]
                                    },
                                    "focus_x": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 100
                                    },
                                    "focus_y": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 100
                                    },
                                    "steps": {
                                        "type": "array",
                                        "maxItems": 10,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "op": {
                                                    "type": "string",
                                                    "enum": [
                                                        "resize",
                                                        "crop",
                                                        "rotate",
                                                        "background",
                                                        "watermark"
                                                    ]
                                                },
                                                "width": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 8192
                                                },
                                                "height": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 8192
                                                },
                                                "fit": {
                                                    "type": "string",
                                                    "enum": [
                                                        "contain",
                                                        "cover",
                                                        "stretch",
                                                        "pad"
                                                    ],
                                                    "description": "resize: contain (inside the box, default), cover (fill the box, cropping around the focus), stretch, or pad (contain, then fill the rest with color)."
                                                },
                                                "focus": {
                                                    "type": "string",
                                                    "enum": [
                                                        "center",
                                                        "attention",
                                                        "entropy"
                                                    ],
                                                    "description": "cover: what to keep when cropping; center by default. attention finds faces and detail."
                                                },
                                                "focus_x": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 100,
                                                    "description": "cover: the focal point, percent from the left."
                                                },
                                                "focus_y": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 100,
                                                    "description": "cover: the focal point, percent from the top."
                                                },
                                                "x": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "y": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "angle": {
                                                    "type": "integer",
                                                    "minimum": -360,
                                                    "maximum": 360,
                                                    "description": "rotate: degrees clockwise."
                                                },
                                                "color": {
                                                    "type": "string",
                                                    "maxLength": 7,
                                                    "description": "#rrggbb for pad, rotate and background."
                                                },
                                                "asset_id": {
                                                    "type": "string",
                                                    "maxLength": 40,
                                                    "description": "watermark: an image asset of this organization; its current version is used."
                                                },
                                                "position": {
                                                    "type": "string",
                                                    "enum": [
                                                        "center",
                                                        "top-left",
                                                        "top-right",
                                                        "bottom-left",
                                                        "bottom-right"
                                                    ],
                                                    "description": "watermark: where it sits; bottom-right by default."
                                                },
                                                "scale": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 100,
                                                    "description": "watermark: its width as a percent of the image's; 20 by default."
                                                },
                                                "opacity": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 100,
                                                    "description": "watermark: percent; 60 by default."
                                                }
                                            },
                                            "additionalProperties": false,
                                            "required": [
                                                "op"
                                            ]
                                        },
                                        "description": "Applied to every width after its resize, such as a watermark."
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "jpeg",
                                            "png",
                                            "webp",
                                            "avif",
                                            "auto"
                                        ],
                                        "description": "auto negotiates from accept; the original's format when left out."
                                    },
                                    "accept": {
                                        "type": "string",
                                        "maxLength": 1000,
                                        "nullable": true,
                                        "description": "format auto: the Accept header of the client that will show the image."
                                    },
                                    "quality": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100
                                    },
                                    "sizes": {
                                        "type": "string",
                                        "maxLength": 500,
                                        "description": "The <img> sizes attribute, such as (min-width: 800px) 50vw, 100vw; answered as given."
                                    },
                                    "expires_in": {
                                        "type": "integer",
                                        "minimum": 60,
                                        "maximum": 3600,
                                        "description": "Seconds the URLs work; 900 when left out."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "widths"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/transform": {
            "post": {
                "operationId": "transformAssetVersion",
                "summary": "Run a transformation pipeline on an image version and answer a short-lived URL to the result. Steps run in order: resize (fit contain, cover with a focal point, stretch or pad), crop, rotate, background and watermark (another image asset laid over it). The original never changes; the same pipeline answers the stored result, which does not count against the plan.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "steps": {
                                        "type": "array",
                                        "maxItems": 10,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "op": {
                                                    "type": "string",
                                                    "enum": [
                                                        "resize",
                                                        "crop",
                                                        "rotate",
                                                        "background",
                                                        "watermark"
                                                    ]
                                                },
                                                "width": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 8192
                                                },
                                                "height": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 8192
                                                },
                                                "fit": {
                                                    "type": "string",
                                                    "enum": [
                                                        "contain",
                                                        "cover",
                                                        "stretch",
                                                        "pad"
                                                    ],
                                                    "description": "resize: contain (inside the box, default), cover (fill the box, cropping around the focus), stretch, or pad (contain, then fill the rest with color)."
                                                },
                                                "focus": {
                                                    "type": "string",
                                                    "enum": [
                                                        "center",
                                                        "attention",
                                                        "entropy"
                                                    ],
                                                    "description": "cover: what to keep when cropping; center by default. attention finds faces and detail."
                                                },
                                                "focus_x": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 100,
                                                    "description": "cover: the focal point, percent from the left."
                                                },
                                                "focus_y": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 100,
                                                    "description": "cover: the focal point, percent from the top."
                                                },
                                                "x": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "y": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "angle": {
                                                    "type": "integer",
                                                    "minimum": -360,
                                                    "maximum": 360,
                                                    "description": "rotate: degrees clockwise."
                                                },
                                                "color": {
                                                    "type": "string",
                                                    "maxLength": 7,
                                                    "description": "#rrggbb for pad, rotate and background."
                                                },
                                                "asset_id": {
                                                    "type": "string",
                                                    "maxLength": 40,
                                                    "description": "watermark: an image asset of this organization; its current version is used."
                                                },
                                                "position": {
                                                    "type": "string",
                                                    "enum": [
                                                        "center",
                                                        "top-left",
                                                        "top-right",
                                                        "bottom-left",
                                                        "bottom-right"
                                                    ],
                                                    "description": "watermark: where it sits; bottom-right by default."
                                                },
                                                "scale": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 100,
                                                    "description": "watermark: its width as a percent of the image's; 20 by default."
                                                },
                                                "opacity": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 100,
                                                    "description": "watermark: percent; 60 by default."
                                                }
                                            },
                                            "additionalProperties": false,
                                            "required": [
                                                "op"
                                            ]
                                        },
                                        "description": "Applied in order. Empty: convert only."
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "jpeg",
                                            "png",
                                            "webp",
                                            "avif",
                                            "auto"
                                        ],
                                        "description": "auto picks AVIF, then WebP, from accept, else JPEG (PNG for an original that may be transparent). The original's format when it is one of these and left out, else jpeg."
                                    },
                                    "accept": {
                                        "type": "string",
                                        "maxLength": 1000,
                                        "nullable": true,
                                        "description": "format auto: the Accept header of the client that will show the image, such as image/avif,image/webp,image/*."
                                    },
                                    "quality": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100,
                                        "description": "Per format when left out: AVIF 55, WebP 80, JPEG 82. PNG ignores it."
                                    },
                                    "expires_in": {
                                        "type": "integer",
                                        "minimum": 60,
                                        "maximum": 3600,
                                        "description": "Seconds the URL works; 900 when left out."
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/transformations": {
            "get": {
                "operationId": "listTransformations",
                "summary": "The results already made from this version, newest first. Asking for one again with transformAssetVersion reuses it at no cost.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "description": "Page size, 1 to 100; 25 when left out."
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 512,
                            "description": "`next_cursor` from the previous page."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/variants": {
            "post": {
                "operationId": "createVariants",
                "summary": "Several sizes of one image version in one call, such as a product image's thumbnail, card and zoom. Each variant is a resize (and optional format) built once and reused like transformAssetVersion; the answer has one item per variant, in order. A variant the plan refuses answers an error in its place.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "variants": {
                                        "type": "array",
                                        "maxItems": 20,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "preset": {
                                                    "type": "string",
                                                    "enum": [
                                                        "open_graph",
                                                        "x_card",
                                                        "square_post",
                                                        "story",
                                                        "pinterest",
                                                        "google_shopping",
                                                        "meta_catalog"
                                                    ],
                                                    "description": "A named size for social sharing or a product feed: open_graph 1200\u00d7630, x_card 1200\u00d7675, square_post 1080\u00d71080, story 1080\u00d71920 and pinterest 1000\u00d71500 fill by cropping; google_shopping 1200\u00d71200 and meta_catalog 1080\u00d71080 keep the whole image on white. Width, height and fit are then taken from it."
                                                },
                                                "width": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 8192
                                                },
                                                "height": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 8192
                                                },
                                                "fit": {
                                                    "type": "string",
                                                    "enum": [
                                                        "contain",
                                                        "cover",
                                                        "stretch",
                                                        "pad"
                                                    ],
                                                    "description": "contain (default), cover, stretch or pad, as in transformAssetVersion."
                                                },
                                                "focus": {
                                                    "type": "string",
                                                    "enum": [
                                                        "center",
                                                        "attention",
                                                        "entropy"
                                                    ]
                                                },
                                                "focus_x": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 100
                                                },
                                                "focus_y": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 100
                                                },
                                                "color": {
                                                    "type": "string",
                                                    "maxLength": 7,
                                                    "description": "pad: #rrggbb."
                                                },
                                                "format": {
                                                    "type": "string",
                                                    "enum": [
                                                        "jpeg",
                                                        "png",
                                                        "webp",
                                                        "avif",
                                                        "auto"
                                                    ],
                                                    "description": "This variant's format; the request's format when left out."
                                                },
                                                "quality": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 100
                                                }
                                            },
                                            "additionalProperties": false
                                        }
                                    },
                                    "steps": {
                                        "type": "array",
                                        "maxItems": 10,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "op": {
                                                    "type": "string",
                                                    "enum": [
                                                        "resize",
                                                        "crop",
                                                        "rotate",
                                                        "background",
                                                        "watermark"
                                                    ]
                                                },
                                                "width": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 8192
                                                },
                                                "height": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 8192
                                                },
                                                "fit": {
                                                    "type": "string",
                                                    "enum": [
                                                        "contain",
                                                        "cover",
                                                        "stretch",
                                                        "pad"
                                                    ],
                                                    "description": "resize: contain (inside the box, default), cover (fill the box, cropping around the focus), stretch, or pad (contain, then fill the rest with color)."
                                                },
                                                "focus": {
                                                    "type": "string",
                                                    "enum": [
                                                        "center",
                                                        "attention",
                                                        "entropy"
                                                    ],
                                                    "description": "cover: what to keep when cropping; center by default. attention finds faces and detail."
                                                },
                                                "focus_x": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 100,
                                                    "description": "cover: the focal point, percent from the left."
                                                },
                                                "focus_y": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 100,
                                                    "description": "cover: the focal point, percent from the top."
                                                },
                                                "x": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "y": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "angle": {
                                                    "type": "integer",
                                                    "minimum": -360,
                                                    "maximum": 360,
                                                    "description": "rotate: degrees clockwise."
                                                },
                                                "color": {
                                                    "type": "string",
                                                    "maxLength": 7,
                                                    "description": "#rrggbb for pad, rotate and background."
                                                },
                                                "asset_id": {
                                                    "type": "string",
                                                    "maxLength": 40,
                                                    "description": "watermark: an image asset of this organization; its current version is used."
                                                },
                                                "position": {
                                                    "type": "string",
                                                    "enum": [
                                                        "center",
                                                        "top-left",
                                                        "top-right",
                                                        "bottom-left",
                                                        "bottom-right"
                                                    ],
                                                    "description": "watermark: where it sits; bottom-right by default."
                                                },
                                                "scale": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 100,
                                                    "description": "watermark: its width as a percent of the image's; 20 by default."
                                                },
                                                "opacity": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 100,
                                                    "description": "watermark: percent; 60 by default."
                                                }
                                            },
                                            "additionalProperties": false,
                                            "required": [
                                                "op"
                                            ]
                                        },
                                        "description": "Applied to every variant after its resize, such as a watermark."
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "jpeg",
                                            "png",
                                            "webp",
                                            "avif",
                                            "auto"
                                        ],
                                        "description": "Format for variants that set none; auto negotiates from accept."
                                    },
                                    "accept": {
                                        "type": "string",
                                        "maxLength": 1000,
                                        "nullable": true,
                                        "description": "format auto: the Accept header of the client that will show the images."
                                    },
                                    "expires_in": {
                                        "type": "integer",
                                        "minimum": 60,
                                        "maximum": 3600,
                                        "description": "Seconds the URLs work; 900 when left out."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "variants"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/assets/{asset_id}/versions/{version_id}/verify": {
            "post": {
                "operationId": "verifyAssetVersion",
                "summary": "Re-read the stored bytes and check them against the recorded SHA-256.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/billing-details": {
            "get": {
                "operationId": "getBillingDetails",
                "summary": "The organization's billing address and whether its plan has started in billing.",
                "tags": [
                    "Organization"
                ],
                "x-permission": "organization:admin",
                "description": "subscribed is false until a full billing address is saved: the plan starts then. 503 billing_unavailable when billing cannot be reached.",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "updateBillingDetails",
                "summary": "Save the organization's billing address. When the plan has not started yet, it starts now.",
                "tags": [
                    "Organization"
                ],
                "x-permission": "organization:admin",
                "description": "Invoices print this address and tax is worked out from it. Some countries also need the state or region (subdivision, such as US-CA). 422 names what billing still misses.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "country": {
                                        "type": "string",
                                        "maxLength": 2,
                                        "minLength": 2,
                                        "description": "ISO 3166-1 alpha-2, such as DK."
                                    },
                                    "address_line1": {
                                        "type": "string",
                                        "maxLength": 190,
                                        "minLength": 1
                                    },
                                    "address_line2": {
                                        "type": "string",
                                        "maxLength": 190,
                                        "nullable": true
                                    },
                                    "postal_code": {
                                        "type": "string",
                                        "maxLength": 32,
                                        "minLength": 1
                                    },
                                    "city": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "minLength": 1
                                    },
                                    "subdivision": {
                                        "type": "string",
                                        "maxLength": 6,
                                        "nullable": true,
                                        "description": "ISO 3166-2 subdivision where the country needs one, such as US-CA."
                                    },
                                    "billing_email": {
                                        "type": "string",
                                        "maxLength": 190,
                                        "nullable": true,
                                        "description": "Where invoices are sent."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "country",
                                    "address_line1",
                                    "postal_code",
                                    "city"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/bulk/assets": {
            "post": {
                "operationId": "bulkUpdateAssets",
                "summary": "Do one thing to up to 100 assets: delete, restore, add_tags, remove_tags, move (to folder_id, null for no folder) or add_to_collection. Each asset succeeds or fails on its own, with the same checks as one at a time.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "asset_ids": {
                                        "type": "array",
                                        "maxItems": 100,
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "action": {
                                        "type": "string",
                                        "enum": [
                                            "delete",
                                            "restore",
                                            "add_tags",
                                            "remove_tags",
                                            "move",
                                            "add_to_collection"
                                        ]
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 50,
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "For add_tags and remove_tags."
                                    },
                                    "folder_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "nullable": true,
                                        "description": "For move."
                                    },
                                    "collection_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "For add_to_collection."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "asset_ids",
                                    "action"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/caller": {
            "get": {
                "operationId": "getCaller",
                "summary": "Who you act as, in which organization, and what you may do.",
                "tags": [
                    "Organization"
                ],
                "x-permission": "organization:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/collections": {
            "post": {
                "operationId": "createCollection",
                "summary": "Create a collection: a named, ordered set of assets that may live in any folder.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "minLength": 1
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 2000,
                                        "nullable": true
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "listCollections",
                "summary": "List collections, newest first.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "description": "Page size, 1 to 100; 25 when left out."
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 512,
                            "description": "`next_cursor` from the previous page."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/collections/{collection_id}": {
            "get": {
                "operationId": "getCollection",
                "summary": "One collection with its asset ids in order.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "collection_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/collections/{collection_id}/assets": {
            "post": {
                "operationId": "addToCollection",
                "summary": "Add assets to the end of a collection. Assets already in it stay where they are.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "collection_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "asset_ids": {
                                        "type": "array",
                                        "maxItems": 100,
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "asset_ids"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/collections/{collection_id}/assets/{asset_id}": {
            "delete": {
                "operationId": "removeFromCollection",
                "summary": "Take an asset out of a collection. The asset itself stays.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "collection_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "asset_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/delivery-domains": {
            "get": {
                "operationId": "listDeliveryDomains",
                "summary": "The organization's own delivery domains, such as images.shop.example, with their state and the DNS records each needs.",
                "tags": [
                    "Library"
                ],
                "x-permission": "organization:admin",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "createDeliveryDomain",
                "summary": "Serve delivery URLs on your own hostname. Add the DNS records in the answer at your DNS host (or in Cbox Domains); the CDN then issues its certificate and the domain turns active, usually within minutes. While it is pending, URLs stay on the shared host.",
                "tags": [
                    "Library"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "hostname": {
                                        "type": "string",
                                        "maxLength": 253,
                                        "minLength": 4,
                                        "description": "A subdomain you control, such as images.shop.example."
                                    },
                                    "default": {
                                        "type": "boolean",
                                        "description": "Hand out delivery URLs on this domain once it is active. The first domain is the default when left out."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "hostname"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/delivery-domains/{domain_id}": {
            "get": {
                "operationId": "getDeliveryDomain",
                "summary": "One delivery domain. A pending one is checked with the CDN first, so its state is current.",
                "tags": [
                    "Library"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "domain_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "updateDeliveryDomain",
                "summary": "Make this domain the one delivery URLs use. URLs already handed out on another domain keep working.",
                "tags": [
                    "Library"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "domain_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "default": {
                                        "type": "boolean"
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "default"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "deleteDeliveryDomain",
                "summary": "Stop serving on this domain. Delivery URLs on it stop working; new URLs use the shared host or the next default.",
                "tags": [
                    "Library"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "domain_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/export/assets": {
            "get": {
                "operationId": "exportAssets",
                "summary": "Every asset with its current version's facts (SHA-256, size, type, filename), tags, metadata and folder, newest first: a manifest to back up or move the library. Download URLs come from createDownloadUrl or resolveReferences.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "description": "Page size, 1 to 100; 25 when left out."
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 512,
                            "description": "`next_cursor` from the previous page."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/folders": {
            "post": {
                "operationId": "createFolder",
                "summary": "Create a folder, optionally inside another.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "minLength": 1
                                    },
                                    "parent_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "nullable": true
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "listFolders",
                "summary": "Folders directly inside one parent (top level when left out), newest first.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "parent_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "description": "Page size, 1 to 100; 25 when left out."
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 512,
                            "description": "`next_cursor` from the previous page."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/folders/{folder_id}": {
            "patch": {
                "operationId": "updateFolder",
                "summary": "Rename a folder or move it under another.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "folder_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "minLength": 1
                                    },
                                    "parent_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "nullable": true
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "deleteFolder",
                "summary": "Delete an empty folder.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "folder_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/imports": {
            "post": {
                "operationId": "importAssets",
                "summary": "Import up to 100 files from public URLs in the background, each with its own title, tags, metadata and folder. Answers an ingestion per item at once; read each with getIngestion.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "items": {
                                        "type": "array",
                                        "maxItems": 100,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "source_url": {
                                                    "type": "string",
                                                    "maxLength": 2000
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "maxLength": 255
                                                },
                                                "folder_id": {
                                                    "type": "string",
                                                    "maxLength": 40
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "maxItems": 50,
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "metadata": {
                                                    "type": "object",
                                                    "additionalProperties": true
                                                }
                                            },
                                            "additionalProperties": false,
                                            "required": [
                                                "source_url"
                                            ]
                                        }
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "items"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/ingestions": {
            "post": {
                "operationId": "createIngestion",
                "summary": "Fetch a file from a public URL in the background and store it unchanged as a new asset or version. Answers at once; read it with getIngestion until it is completed or failed. A server that is down or busy is tried again for about 15 minutes.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "source_url": {
                                        "type": "string",
                                        "maxLength": 2000,
                                        "description": "A public http(s) URL. Private, reserved and metadata addresses and redirects are refused."
                                    },
                                    "filename": {
                                        "type": "string",
                                        "maxLength": 255,
                                        "description": "The last part of the URL's path when left out."
                                    },
                                    "sha256": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "description": "Fail the ingestion when the file's SHA-256 differs."
                                    },
                                    "asset_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "Add the file as a new version of this asset instead of creating one."
                                    },
                                    "if_current_version_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "With asset_id: fail with version_conflict when another version was added first."
                                    },
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255,
                                        "description": "A new asset's title; the filename when left out."
                                    },
                                    "folder_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "nullable": true
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 50,
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "metadata": {
                                        "type": "object",
                                        "additionalProperties": true,
                                        "description": "Typed values by key: string, number, boolean, null or a list of strings."
                                    },
                                    "visibility": {
                                        "type": "string",
                                        "enum": [
                                            "public",
                                            "private"
                                        ]
                                    },
                                    "storage": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "`managed` or a storage location id; the organization default when left out."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "source_url"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/ingestions/{ingestion_id}": {
            "get": {
                "operationId": "getIngestion",
                "summary": "One ingestion: queued, fetching, completed with the asset and version it made, or failed with the reason.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "ingestion_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/lifecycle": {
            "patch": {
                "operationId": "updateLifecycleSettings",
                "summary": "Set how many days a deleted asset stays in the trash before it is deleted for good.",
                "tags": [
                    "Library"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "trash_days": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 365
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "trash_days"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/metadata-fields": {
            "get": {
                "operationId": "listMetadataFields",
                "summary": "The organization's metadata schema: typed fields, by key.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "createMetadataField",
                "summary": "Add a typed field to the metadata schema. From then on every write that sets metadata checks the value under its key. Values already stored are not changed.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "minLength": 1,
                                        "description": "The metadata key, such as season."
                                    },
                                    "label": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "minLength": 1
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "text",
                                            "number",
                                            "boolean",
                                            "date",
                                            "select",
                                            "multi_select"
                                        ],
                                        "description": "text, number, boolean, date (YYYY-MM-DD), select or multi_select."
                                    },
                                    "options": {
                                        "type": "array",
                                        "maxItems": 100,
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "The allowed values of a select or multi_select."
                                    },
                                    "required": {
                                        "type": "boolean",
                                        "description": "Every asset must hold a value once its metadata is next written."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "key",
                                    "label",
                                    "type"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/metadata-fields/{field_id}": {
            "patch": {
                "operationId": "updateMetadataField",
                "summary": "Change a field's label, options or whether it is required. The key and type stay; delete the field and add a new one to change them.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "field_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "label": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "minLength": 1
                                    },
                                    "options": {
                                        "type": "array",
                                        "maxItems": 100,
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "required": {
                                        "type": "boolean"
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "deleteMetadataField",
                "summary": "Remove a field from the schema. Values under its key stay on the assets, free-form.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "field_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/plan": {
            "get": {
                "operationId": "getPlan",
                "summary": "Your organization's plan: what it includes, its limits and the managed storage you use now.",
                "tags": [
                    "Organization"
                ],
                "x-permission": "organization:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/references/resolve": {
            "post": {
                "operationId": "resolveReferences",
                "summary": "Turn stored references into what a consumer shows: the asset's current title, tags and metadata, the referenced version's immutable facts, and a short-lived URL. Store only {asset_id, version_id}; never store the URL. Each reference resolves on its own, so one missing reference does not fail the rest.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "references": {
                                        "type": "array",
                                        "maxItems": 100,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "asset_id": {
                                                    "type": "string",
                                                    "maxLength": 40
                                                },
                                                "version_id": {
                                                    "type": "string",
                                                    "maxLength": 40,
                                                    "description": "Leave out to follow the asset's current version."
                                                }
                                            },
                                            "additionalProperties": false,
                                            "required": [
                                                "asset_id"
                                            ]
                                        }
                                    },
                                    "expires_in": {
                                        "type": "integer",
                                        "minimum": 60,
                                        "maximum": 3600,
                                        "description": "Seconds the URLs work; 900 when left out."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "references"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/storage-locations": {
            "get": {
                "operationId": "listStorageLocations",
                "summary": "Where this organization's originals can be stored, managed storage first.",
                "tags": [
                    "Storage"
                ],
                "x-permission": "storage:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "connectStorageLocation",
                "summary": "Connect your own S3-compatible bucket. Assets writes, reads and deletes a probe object first and refuses a bucket that fails.",
                "tags": [
                    "Storage"
                ],
                "x-permission": "storage:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "minLength": 1
                                    },
                                    "endpoint": {
                                        "type": "string",
                                        "maxLength": 500,
                                        "minLength": 1,
                                        "description": "The S3 API endpoint, such as https://s3.eu-central-1.amazonaws.com. Must be a public HTTPS address."
                                    },
                                    "region": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "minLength": 1,
                                        "description": "auto for Cloudflare R2."
                                    },
                                    "bucket": {
                                        "type": "string",
                                        "maxLength": 63,
                                        "minLength": 3
                                    },
                                    "access_key_id": {
                                        "type": "string",
                                        "maxLength": 200,
                                        "minLength": 1
                                    },
                                    "secret_access_key": {
                                        "type": "string",
                                        "maxLength": 200,
                                        "minLength": 1,
                                        "description": "Stored encrypted; never returned."
                                    },
                                    "path_style": {
                                        "type": "boolean",
                                        "description": "Path-style addressing; true when left out."
                                    },
                                    "make_default": {
                                        "type": "boolean",
                                        "description": "Store new originals here instead of managed storage."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "name",
                                    "endpoint",
                                    "region",
                                    "bucket",
                                    "access_key_id",
                                    "secret_access_key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/storage-locations/{location_id}": {
            "get": {
                "operationId": "getStorageLocation",
                "summary": "One storage location.",
                "tags": [
                    "Storage"
                ],
                "x-permission": "storage:read",
                "parameters": [
                    {
                        "name": "location_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "updateStorageLocation",
                "summary": "Rename a location or make it the default for new originals.",
                "tags": [
                    "Storage"
                ],
                "x-permission": "storage:write",
                "parameters": [
                    {
                        "name": "location_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "minLength": 1
                                    },
                                    "is_default": {
                                        "type": "boolean"
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "disconnectStorageLocation",
                "summary": "Disconnect a bucket that holds no asset versions. Objects in the bucket are not touched.",
                "tags": [
                    "Storage"
                ],
                "x-permission": "storage:write",
                "parameters": [
                    {
                        "name": "location_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/storage-locations/{location_id}/check": {
            "post": {
                "operationId": "checkStorageLocation",
                "summary": "Run the storage contract probe again (write, read, verify, delete).",
                "tags": [
                    "Storage"
                ],
                "x-permission": "storage:write",
                "parameters": [
                    {
                        "name": "location_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/storage-quota": {
            "patch": {
                "operationId": "setStorageQuota",
                "summary": "Cap managed storage for this organization below what the plan would bill, or clear the cap. Uploads past it are refused with storage_quota_reached; files already stored stay.",
                "tags": [
                    "Storage"
                ],
                "x-permission": "organization:admin",
                "description": "Counts managed storage only (each distinct file once), not your own buckets. getPlan answers the quota and the bytes used.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "quota_gb": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 1000000,
                                        "nullable": true,
                                        "description": "Whole GB (decimal, as Billing counts). null clears the quota."
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/uploads": {
            "post": {
                "operationId": "createUpload",
                "summary": "Start an upload of a file of any size the plan allows. Send its parts to the presigned URLs in any order (each PUT with Content-Type application/octet-stream), then complete it. An interrupted upload resumes: getUpload lists the parts that arrived and fresh URLs for the rest.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "filename": {
                                        "type": "string",
                                        "maxLength": 255,
                                        "minLength": 1,
                                        "description": "Original filename, such as mug-front.png."
                                    },
                                    "bytes": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "description": "The exact size of the file."
                                    },
                                    "sha256": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "description": "The SHA-256 of the whole file. Completing refuses bytes that do not match it."
                                    },
                                    "asset_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "Add the file as a new version of this asset instead of creating one."
                                    },
                                    "if_current_version_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "With asset_id: refuse with version_conflict when another version was added since you read the asset."
                                    },
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255,
                                        "description": "A new asset's title; the filename when left out."
                                    },
                                    "folder_id": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "nullable": true
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 50,
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "metadata": {
                                        "type": "object",
                                        "additionalProperties": true,
                                        "description": "Typed values by key: string, number, boolean, null or a list of strings."
                                    },
                                    "storage": {
                                        "type": "string",
                                        "maxLength": 40,
                                        "description": "`managed` or a storage location id; the organization default when left out."
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "filename",
                                    "bytes",
                                    "sha256"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/uploads/{upload_id}": {
            "get": {
                "operationId": "getUpload",
                "summary": "One upload: its state and, while it is open, which parts arrived and fresh presigned URLs for the rest.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "abortUpload",
                "summary": "Stop an open upload and remove the parts sent so far.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/uploads/{upload_id}/complete": {
            "post": {
                "operationId": "completeUpload",
                "summary": "Assemble the parts, check them against the declared size and SHA-256, and store the file unchanged as a new asset or version. Completing again answers the same result.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:write",
                "parameters": [
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 40
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/usage": {
            "get": {
                "operationId": "getUsageReport",
                "summary": "What the library holds: assets by kind, in the trash and under a retention hold, versions, bytes in managed storage and in your own buckets, transformations, and the trash period.",
                "tags": [
                    "Library"
                ],
                "x-permission": "assets:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhook-endpoints": {
            "get": {
                "operationId": "listWebhookEndpoints",
                "summary": "The organization's webhook endpoints and how their deliveries are going.",
                "tags": [
                    "Webhooks"
                ],
                "x-permission": "organization:admin",
                "description": "503 webhooks_unavailable when Cbox Relay cannot be reached.",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "createWebhookEndpoint",
                "summary": "Send events to a URL. The answer holds the signing secret, once.",
                "tags": [
                    "Webhooks"
                ],
                "x-permission": "organization:admin",
                "description": "The URL must be public https. Verify each delivery's X-Cbox-Signature with the secret (HMAC-SHA256 over \"timestamp.body\"); store it now, it is never shown again.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "maxLength": 2000,
                                        "minLength": 9
                                    },
                                    "event_types": {
                                        "type": "array",
                                        "maxItems": 100,
                                        "items": {
                                            "type": "string",
                                            "enum": [
                                                "*",
                                                "assets.asset.created",
                                                "assets.asset.updated",
                                                "assets.asset.version_created",
                                                "assets.asset.delivery_revoked",
                                                "assets.asset.related",
                                                "assets.asset.unrelated",
                                                "assets.asset.deleted",
                                                "assets.asset.restored",
                                                "assets.asset.purged",
                                                "assets.asset.retention_updated",
                                                "assets.lifecycle.updated",
                                                "assets.delivery_domain.created",
                                                "assets.delivery_domain.activated",
                                                "assets.delivery_domain.failed",
                                                "assets.delivery_domain.updated",
                                                "assets.delivery_domain.deleted",
                                                "assets.ingestion.completed",
                                                "assets.ingestion.failed",
                                                "assets.malware.detected",
                                                "assets.preview.ready",
                                                "assets.preview.failed",
                                                "assets.rendition.ready",
                                                "assets.rendition.failed",
                                                "assets.stream.ready",
                                                "assets.stream.failed",
                                                "assets.metadata_field.created",
                                                "assets.metadata_field.updated",
                                                "assets.metadata_field.deleted",
                                                "assets.storage_location.connected",
                                                "assets.storage_location.disconnected",
                                                "assets.storage_quota.updated"
                                            ]
                                        },
                                        "description": "Event types to deliver, or [\"*\"] for every type. listWebhookEventTypes names them."
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 190,
                                        "nullable": true
                                    }
                                },
                                "additionalProperties": false,
                                "required": [
                                    "url",
                                    "event_types"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhook-endpoints/{endpoint_id}": {
            "patch": {
                "operationId": "updateWebhookEndpoint",
                "summary": "Change an endpoint's URL, event types or description.",
                "tags": [
                    "Webhooks"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "endpoint_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 64,
                            "minLength": 1
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "maxLength": 2000,
                                        "minLength": 9
                                    },
                                    "event_types": {
                                        "type": "array",
                                        "maxItems": 100,
                                        "items": {
                                            "type": "string",
                                            "enum": [
                                                "*",
                                                "assets.asset.created",
                                                "assets.asset.updated",
                                                "assets.asset.version_created",
                                                "assets.asset.delivery_revoked",
                                                "assets.asset.related",
                                                "assets.asset.unrelated",
                                                "assets.asset.deleted",
                                                "assets.asset.restored",
                                                "assets.asset.purged",
                                                "assets.asset.retention_updated",
                                                "assets.lifecycle.updated",
                                                "assets.delivery_domain.created",
                                                "assets.delivery_domain.activated",
                                                "assets.delivery_domain.failed",
                                                "assets.delivery_domain.updated",
                                                "assets.delivery_domain.deleted",
                                                "assets.ingestion.completed",
                                                "assets.ingestion.failed",
                                                "assets.malware.detected",
                                                "assets.preview.ready",
                                                "assets.preview.failed",
                                                "assets.rendition.ready",
                                                "assets.rendition.failed",
                                                "assets.stream.ready",
                                                "assets.stream.failed",
                                                "assets.metadata_field.created",
                                                "assets.metadata_field.updated",
                                                "assets.metadata_field.deleted",
                                                "assets.storage_location.connected",
                                                "assets.storage_location.disconnected",
                                                "assets.storage_quota.updated"
                                            ]
                                        },
                                        "description": "Event types to deliver, or [\"*\"] for every type. listWebhookEventTypes names them."
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 190,
                                        "nullable": true
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "deleteWebhookEndpoint",
                "summary": "Stop sending events to an endpoint.",
                "tags": [
                    "Webhooks"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "endpoint_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 64,
                            "minLength": 1
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhook-endpoints/{endpoint_id}/ping": {
            "post": {
                "operationId": "pingWebhookEndpoint",
                "summary": "Send the endpoint a signed test delivery and answer how it went.",
                "tags": [
                    "Webhooks"
                ],
                "x-permission": "organization:admin",
                "parameters": [
                    {
                        "name": "endpoint_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 64,
                            "minLength": 1
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhook-event-types": {
            "get": {
                "operationId": "listWebhookEventTypes",
                "summary": "The event types an endpoint can subscribe to.",
                "tags": [
                    "Webhooks"
                ],
                "x-permission": "organization:admin",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "A refusal",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "Problem": {
                "type": "object",
                "required": [
                    "type",
                    "title",
                    "status",
                    "detail",
                    "code"
                ],
                "properties": {
                    "type": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "status": {
                        "type": "integer"
                    },
                    "detail": {
                        "type": "string"
                    },
                    "code": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}
