{
  "openapi": "3.1.0",
  "info": {
    "title": "CreatorSense Trace API",
    "summary": "Marked copies, leak traces and usage for your Trace account.",
    "description": "The public Trace API. Use it to connect your own tools to Trace: list and add\nfans, upload a master and request one marked copy per fan, download copies,\nsubmit a leak and read the case, and read your plan and usage.\n\nAuthenticate with an API key from Settings -> API keys in the app, sent as\n`Authorization: Bearer cs_live_...` (or `X-API-Key: cs_live_...`). Keys have\nscopes: `trace:read` and `trace:write`. Each key may make 120 requests a\nminute; every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`\nand `X-RateLimit-Reset`.\n\nAgency keys (made by an agency's owner for its roster) don't work here: they get\n403 `AGENCY_KEY`. They work on the agency Trace API (agency-trace.openapi.json).\n\nMarked copies made through the API count toward your plan exactly like copies\nmade in the app. Leak traces are not counted as copies. Long-running work\nreturns a job or case id to poll.\n\nWebhooks, both ways. Outbound: register an endpoint (POST /webhook-endpoints)\nand Trace sends signed `copy.ready`, `leak.matched` and `case.updated` events\n(see the webhooks section below). Inbound: when your platform or CRM posts a\npurchase to POST /webhooks/{provider} and an unlock rule matches, the buyer\ngets their own marked copy. Inbound webhooks are signed by the sender (HMAC),\nnot authenticated with an API key.\n\nA match shows which delivered copy a leaked file came from. It does not prove\nwho shared it. A \"no_mark_found\" result is inconclusive.\n\nGuide: https://www.creatorsenseai.com/api.html\n",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.creatorsenseai.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/trace/v1/fans": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "List fans",
        "description": "Every active fan on the account, with the mark ID their copies carry.",
        "operationId": "listFans",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FanListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Add a fan",
        "description": "Add one fan. A mark ID is assigned automatically. Plan fan limits apply.",
        "operationId": "createFan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FanCreateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FanOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/fans/import": {
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Import fans",
        "description": "Add many fans at once (deduplicated; existing names are skipped, not duplicated).",
        "operationId": "importFans",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FanImportIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FanImportOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/uploads": {
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Get an upload URL",
        "description": "A short-lived URL to PUT a master or leak file to. Use the object_key afterwards.",
        "operationId": "createUpload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/masters": {
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Prepare a master",
        "description": "Start preparing an uploaded master. Poll the job; request copies once it succeeds.\n\nPreparing a master does not use marked copies; each copy you request does.",
        "operationId": "createMaster",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MasterCreateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MasterJobOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/masters/{master_id}": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Get a master",
        "operationId": "getMaster",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "master_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Master Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MasterOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/masters/{master_id}/copies": {
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Request marked copies",
        "description": "One marked copy per fan, from a ready master. Each copy counts as one marked copy.\n\nVideo masters (MP4): files are built on first download, so this returns\nquickly; then GET each copy's ``download_url``. Image and audio masters\n(JPEG, PNG, WebP; MP3, M4A, OGG, WAV): each copy is marked on its own and\ncomes back with ``status`` \"marking\" and a ``job_id``; poll the job, then\ndownload. Image copies count against your image allowance, audio copies\nagainst audio, video against video.",
        "operationId": "createCopies",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "master_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Master Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CopiesCreateIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "List copies of a master",
        "operationId": "listCopies",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "master_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Master Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/copies/{copy_id}/download": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Get a copy's download URL",
        "description": "A short-lived signed URL for the copy's file. The first call builds the file.",
        "operationId": "downloadCopy",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "copy_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Copy Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyDownloadOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/jobs/{job_id}": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Poll a job",
        "operationId": "getJob",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/leaks": {
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Submit a leak",
        "description": "Trace a leak by URL, or by a file uploaded with POST /uploads (purpose ``leak``).\n\nReturns the case to poll. Leak traces do not use marked copies.",
        "operationId": "submitLeak",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeakIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeakOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/leaks/upload": {
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Submit a leak file",
        "description": "Upload a leaked file directly (multipart). Large files: use POST /uploads then /leaks.",
        "operationId": "uploadLeak",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_uploadLeak"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeakOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/cases": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "List cases",
        "operationId": "listCases",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/cases/{case_id}": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Get a case",
        "operationId": "getCase",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Case Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/usage": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Plan and usage",
        "description": "This month's marked copies: allowance, used, pack balance and overage.",
        "operationId": "getUsage",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/overlay-templates": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "List logo overlay templates",
        "description": "Your saved logo overlays. Pass an id as ``overlay_template_id`` when you create a master.",
        "operationId": "listOverlayTemplates",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverlayTemplateListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/webhook-endpoints": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "List webhook endpoints",
        "operationId": "listWebhookEndpoints",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Add a webhook endpoint",
        "description": "Trace POSTs signed events to this URL. The signing secret is in this response only.\n\nVerify ``X-Trace-Signature: t=<unix>,v1=<hex>``: HMAC-SHA256 of ``\"{t}.{raw body}\"``\nwith the secret; reject if ``t`` is more than 5 minutes old. Dedupe on\n``X-Trace-Delivery``. Non-2xx answers are retried for about a day.",
        "operationId": "createWebhookEndpoint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreated"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/webhook-endpoints/{endpoint_id}": {
      "delete": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Delete a webhook endpoint",
        "operationId": "deleteWebhookEndpoint",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/webhook-endpoints/{endpoint_id}/deliveries": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Recent deliveries to an endpoint",
        "operationId": "listWebhookDeliveries",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/unlock-rules": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "List unlock rules",
        "operationId": "listUnlockRules",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnlockRuleListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Add an unlock rule",
        "description": "When a matching purchase webhook arrives, the buyer gets their own copy of the master.\n\nEach copy counts as one marked copy. Rules made through the API never send\nmessages by themselves; auto-send can only be armed by the creator in the app.",
        "operationId": "createUnlockRule",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlockRuleIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnlockRuleOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/unlock-rules/{rule_id}": {
      "delete": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Delete an unlock rule",
        "operationId": "deleteUnlockRule",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Rule Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/unlock-deliveries": {
      "get": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Copies made from purchase webhooks",
        "operationId": "listUnlockDeliveries",
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 24
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnlockDeliveryListOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trace/v1/inbound-secret": {
      "post": {
        "tags": [
          "Trace API v1"
        ],
        "summary": "Make or rotate your CRM's webhook signing secret",
        "description": "For ``POST /webhooks/custom``. The old secret stops working at once.",
        "operationId": "rotateInboundSecret",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundSecretOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or resource is not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit for this key reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": []
          },
          {
            "ApiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/trace/v1/webhooks/{provider}": {
      "post": {
        "tags": [
          "Trace webhooks (inbound)"
        ],
        "summary": "Receive a platform purchase webhook",
        "description": "A purchase, unlock or subscribe event from a platform or your CRM.\n\nWhen an unlock rule matches, the buyer gets their own marked copy of the\nrule's master (counted like any copy). Sending it back to them on the\nplatform waits for your Send click unless you armed auto-send. Retries\nwith the same event id are acknowledged and ignored.",
        "operationId": "receivePlatformWebhook",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "fanvue",
                "onlyfansapi",
                "custom"
              ],
              "type": "string",
              "title": "Provider"
            }
          },
          {
            "name": "content-length",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Content-Length"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookAck"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "description": "Body for ``provider=custom`` (your own CRM or checkout).",
                "properties": {
                  "id": {
                    "description": "Unique per event. Retries reuse it.",
                    "maxLength": 255,
                    "title": "Id",
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "purchase.completed",
                      "subscription.created"
                    ],
                    "title": "Type",
                    "type": "string"
                  },
                  "product_ref": {
                    "anyOf": [
                      {
                        "maxLength": 128,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Matches an unlock rule's platform_ref.",
                    "title": "Product Ref"
                  },
                  "buyer": {
                    "properties": {
                      "ref": {
                        "description": "Your stable id for the buyer.",
                        "maxLength": 128,
                        "title": "Ref",
                        "type": "string"
                      },
                      "handle": {
                        "anyOf": [
                          {
                            "maxLength": 128,
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Their platform username.",
                        "title": "Handle"
                      }
                    },
                    "required": [
                      "ref"
                    ],
                    "title": "CustomBuyer",
                    "type": "object"
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "title": "Amount Cents"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "buyer"
                ],
                "title": "CustomEvent",
                "type": "object"
              }
            }
          },
          "description": "provider=custom: the CustomEvent body below, signed with X-Trace-Account + X-Trace-Signature (t=<unix>,v1=<hex HMAC-SHA256 of '{t}.{body}'>). provider=fanvue and provider=onlyfansapi: the platform's own event body and signature headers, sent by the platform."
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Body_uploadLeak": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File",
            "description": "The leaked file (small files; use /uploads for large)."
          },
          "master_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Master Id"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_uploadLeak"
      },
      "CaseListOut": {
        "properties": {
          "cases": {
            "items": {
              "$ref": "#/components/schemas/CaseOut"
            },
            "type": "array",
            "title": "Cases"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "cases",
          "limit",
          "offset"
        ],
        "title": "CaseListOut"
      },
      "CaseOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "examples": [
              "done"
            ]
          },
          "verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verdict",
            "description": "matched | no_mark_found | tampered_inconclusive | ambiguous_multiple, or null while still checking. no_mark_found is inconclusive, not a clearance."
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "master_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Master Id"
          },
          "match": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MatchOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "attribution_locked": {
            "type": "boolean",
            "title": "Attribution Locked",
            "description": "True when the plan's monthly match limit holds back the matched copy.",
            "default": false
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "title": "CaseOut"
      },
      "CopiesCreateIn": {
        "properties": {
          "fan_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 1000,
            "minItems": 1,
            "title": "Fan Ids",
            "description": "Fan IDs from GET /fans. One marked copy is made (and counted) per fan."
          }
        },
        "type": "object",
        "required": [
          "fan_ids"
        ],
        "title": "CopiesCreateIn"
      },
      "CopyDownloadOut": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Signed URL for the file (MP4, or the image / audio format uploaded). Short-lived."
          },
          "expires_in": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In",
            "description": "Seconds until the URL stops working."
          },
          "content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Type",
            "description": "e.g. video/mp4, image/jpeg, image/png, image/webp, audio/mpeg, audio/mp4."
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "CopyDownloadOut"
      },
      "CopyListOut": {
        "properties": {
          "copies": {
            "items": {
              "$ref": "#/components/schemas/CopyOut"
            },
            "type": "array",
            "title": "Copies"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "copies",
          "count"
        ],
        "title": "CopyListOut"
      },
      "CopyOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "master_id": {
            "type": "string",
            "title": "Master Id"
          },
          "fan_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fan Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "ready": {
            "type": "boolean",
            "title": "Ready",
            "description": "Video: false until the file is first built (on first download). Image / audio: false until the copy has been marked (see status)."
          },
          "media_kind": {
            "type": "string",
            "title": "Media Kind",
            "description": "video | image | audio (the master's media).",
            "default": "video"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "ready | marking | failed. Image and audio copies are marked one by one; poll job_id (GET /jobs/{id}) while marking.",
            "default": "ready"
          },
          "job_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Id",
            "description": "The copy's own encode job (image / audio)."
          },
          "download_url": {
            "type": "string",
            "title": "Download Url",
            "description": "GET this (with your key) for a signed file URL."
          }
        },
        "type": "object",
        "required": [
          "id",
          "master_id",
          "ready",
          "download_url"
        ],
        "title": "CopyOut"
      },
      "CopyUsageOut": {
        "properties": {
          "allowance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowance",
            "description": "Marked copies included this month. null = not metered."
          },
          "used": {
            "type": "integer",
            "title": "Used",
            "description": "Marked copies made this month (app and API together)."
          },
          "included_left": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Included Left"
          },
          "pack_balance": {
            "type": "integer",
            "title": "Pack Balance",
            "description": "Prepaid copy-pack credits left.",
            "default": 0
          },
          "pack_used_this_month": {
            "type": "integer",
            "title": "Pack Used This Month",
            "default": 0
          },
          "overage_this_month": {
            "type": "integer",
            "title": "Overage This Month",
            "default": 0
          },
          "overage_rate_cents": {
            "type": "integer",
            "title": "Overage Rate Cents",
            "default": 0
          },
          "overage_ceiling": {
            "type": "integer",
            "title": "Overage Ceiling",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "used"
        ],
        "title": "CopyUsageOut"
      },
      "ErrorDetail": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code",
            "examples": [
              "API_KEY_REVOKED"
            ]
          },
          "message": {
            "type": "string",
            "title": "Message",
            "examples": [
              "This API key was revoked. Make a new key in Settings."
            ]
          },
          "status": {
            "type": "integer",
            "title": "Status",
            "examples": [
              401
            ]
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "code",
          "message",
          "status"
        ],
        "title": "ErrorDetail"
      },
      "ErrorOut": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "ErrorOut"
      },
      "FanCreateIn": {
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Label",
            "examples": [
              "@bella_fan"
            ]
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "platform": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform",
            "examples": [
              "onlyfans"
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "FanCreateIn"
      },
      "FanImportIn": {
        "properties": {
          "labels": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 200,
            "title": "Labels",
            "examples": [
              [
                "@bella_fan",
                "@mike_22"
              ]
            ]
          },
          "text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100000
              },
              {
                "type": "null"
              }
            ],
            "title": "Text",
            "description": "Or paste names / a CSV of handles, one per line."
          }
        },
        "type": "object",
        "title": "FanImportIn"
      },
      "FanImportOut": {
        "properties": {
          "created": {
            "items": {
              "$ref": "#/components/schemas/FanOut"
            },
            "type": "array",
            "title": "Created"
          },
          "skipped": {
            "items": {
              "$ref": "#/components/schemas/FanImportSkip"
            },
            "type": "array",
            "title": "Skipped"
          },
          "created_count": {
            "type": "integer",
            "title": "Created Count"
          },
          "skipped_count": {
            "type": "integer",
            "title": "Skipped Count"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "created",
          "skipped",
          "created_count",
          "skipped_count"
        ],
        "title": "FanImportOut"
      },
      "FanImportSkip": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "label",
          "reason"
        ],
        "title": "FanImportSkip"
      },
      "FanListOut": {
        "properties": {
          "fans": {
            "items": {
              "$ref": "#/components/schemas/FanOut"
            },
            "type": "array",
            "title": "Fans"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "fans",
          "count"
        ],
        "title": "FanListOut"
      },
      "FanOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label",
            "description": "Your name for the fan, e.g. their platform handle."
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "platform": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform"
          },
          "watermark_id": {
            "type": "integer",
            "title": "Watermark Id",
            "description": "The mark ID carried by this fan's copies."
          },
          "tier": {
            "type": "string",
            "title": "Tier",
            "default": "standard"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "watermark_id"
        ],
        "title": "FanOut"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InboundSecretOut": {
        "properties": {
          "account": {
            "type": "string",
            "title": "Account",
            "description": "Send as X-Trace-Account."
          },
          "secret": {
            "type": "string",
            "title": "Secret",
            "description": "Signing secret, shown once."
          },
          "webhook_url": {
            "type": "string",
            "title": "Webhook Url"
          }
        },
        "type": "object",
        "required": [
          "account",
          "secret",
          "webhook_url"
        ],
        "title": "InboundSecretOut"
      },
      "JobOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "encode | leak_fetch | leak_check"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "queued | running | succeeded | failed"
          },
          "master_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Master Id"
          },
          "case_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "next_job_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Job Id",
            "description": "For leak_fetch: the leak_check job it started, once known."
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "type",
          "status"
        ],
        "title": "JobOut"
      },
      "LeakIn": {
        "properties": {
          "url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2083,
                "minLength": 1,
                "format": "uri"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "A page or file URL where the leak is posted."
          },
          "object_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512,
                "minLength": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Object Key",
            "description": "Or a file uploaded via POST /uploads."
          },
          "master_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Master Id",
            "description": "Optional: the master you think it came from."
          }
        },
        "type": "object",
        "title": "LeakIn"
      },
      "LeakOut": {
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "case_id",
          "job_id",
          "status"
        ],
        "title": "LeakOut"
      },
      "MasterCreateIn": {
        "properties": {
          "object_key": {
            "type": "string",
            "maxLength": 512,
            "minLength": 3,
            "title": "Object Key"
          },
          "title": {
            "type": "string",
            "maxLength": 512,
            "title": "Title",
            "default": "",
            "examples": [
              "March drop"
            ]
          },
          "overlay_template_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^(none|default|[0-9a-fA-F-]{36})$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Overlay Template Id",
            "description": "Logo overlay for this master's copies: a template id from GET /overlay-templates, 'none', or leave it out for your default template. Copies of a master share the logo; the per-buyer code ring goes on per-buyer encodes made in the app."
          }
        },
        "type": "object",
        "required": [
          "object_key"
        ],
        "title": "MasterCreateIn"
      },
      "MasterJobOut": {
        "properties": {
          "master_id": {
            "type": "string",
            "title": "Master Id"
          },
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Master status: pending until the job succeeds, then ready."
          }
        },
        "type": "object",
        "required": [
          "master_id",
          "job_id",
          "status"
        ],
        "title": "MasterJobOut"
      },
      "MasterOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "examples": [
              "ready"
            ]
          },
          "media_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Media Kind"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "overlay": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MasterOverlayOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The logo overlay on this master's copies, if any."
          }
        },
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "title": "MasterOut"
      },
      "MasterOverlayOut": {
        "properties": {
          "template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Id"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "coded": {
            "type": "boolean",
            "title": "Coded",
            "description": "True when the logo carries a per-buyer code ring.",
            "default": false
          },
          "placement": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Placement"
          }
        },
        "type": "object",
        "title": "MasterOverlayOut"
      },
      "MatchOut": {
        "properties": {
          "watermark_id": {
            "type": "integer",
            "title": "Watermark Id"
          },
          "fan_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fan Id"
          },
          "fan_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fan Label"
          },
          "statement": {
            "type": "string",
            "title": "Statement",
            "description": "What the match shows. It shows which copy leaked, not who shared it."
          }
        },
        "type": "object",
        "required": [
          "watermark_id",
          "statement"
        ],
        "title": "MatchOut",
        "description": "Present only when Trace matched the file to one delivered copy."
      },
      "OverlayTemplateListOut": {
        "properties": {
          "templates": {
            "items": {
              "$ref": "#/components/schemas/OverlayTemplateOut"
            },
            "type": "array",
            "title": "Templates"
          },
          "coded_available": {
            "type": "boolean",
            "title": "Coded Available"
          }
        },
        "type": "object",
        "required": [
          "templates",
          "coded_available"
        ],
        "title": "OverlayTemplateListOut"
      },
      "OverlayTemplateOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "default": ""
          },
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "description": "Applied to every new copy unless a request names another."
          },
          "placement": {
            "type": "string",
            "title": "Placement"
          },
          "coded_active": {
            "type": "boolean",
            "title": "Coded Active",
            "description": "The per-buyer code ring is on (needs the Coded overlay add-on or the Agency Base)."
          },
          "protected_tag": {
            "type": "boolean",
            "title": "Protected Tag",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "version",
          "is_default",
          "placement",
          "coded_active"
        ],
        "title": "OverlayTemplateOut"
      },
      "UnlockDeliveryListOut": {
        "properties": {
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/UnlockDeliveryOut"
            },
            "type": "array",
            "title": "Deliveries"
          }
        },
        "type": "object",
        "required": [
          "deliveries"
        ],
        "title": "UnlockDeliveryListOut"
      },
      "UnlockDeliveryOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "rule_id": {
            "type": "string",
            "title": "Rule Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "buyer_ref": {
            "type": "string",
            "title": "Buyer Ref"
          },
          "buyer_handle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buyer Handle"
          },
          "watermark_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Watermark Id"
          },
          "copy_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Copy Id"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "ready | awaiting_send | sending | sent | failed | skipped"
          },
          "sent_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent By"
          },
          "platform_message_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Message Id"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "sent_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          },
          "statement": {
            "type": "string",
            "title": "Statement"
          }
        },
        "type": "object",
        "required": [
          "id",
          "rule_id",
          "provider",
          "buyer_ref",
          "status",
          "statement"
        ],
        "title": "UnlockDeliveryOut"
      },
      "UnlockRuleIn": {
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "fanvue",
              "onlyfansapi",
              "custom"
            ],
            "title": "Provider"
          },
          "trigger": {
            "type": "string",
            "enum": [
              "unlock",
              "subscribe"
            ],
            "title": "Trigger",
            "default": "unlock"
          },
          "platform_ref": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Ref",
            "description": "Which sale this rule is for: the OnlyFans message id, the Fanvue message or post uuid, or your own product_ref. Required for trigger=unlock."
          },
          "master_id": {
            "type": "string",
            "maxLength": 64,
            "title": "Master Id",
            "description": "A prepared master."
          },
          "delivery": {
            "type": "string",
            "enum": [
              "platform_dm",
              "download"
            ],
            "title": "Delivery",
            "description": "download: make the copy and send copy.ready (your system delivers it). platform_dm: the creator sends it from the Trace app with a click.",
            "default": "download"
          },
          "caption": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Caption"
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "master_id"
        ],
        "title": "UnlockRuleIn"
      },
      "UnlockRuleListOut": {
        "properties": {
          "rules": {
            "items": {
              "$ref": "#/components/schemas/UnlockRuleOut"
            },
            "type": "array",
            "title": "Rules"
          }
        },
        "type": "object",
        "required": [
          "rules"
        ],
        "title": "UnlockRuleListOut"
      },
      "UnlockRuleOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "trigger": {
            "type": "string",
            "title": "Trigger"
          },
          "platform_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Ref"
          },
          "master_id": {
            "type": "string",
            "title": "Master Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "delivery": {
            "type": "string",
            "title": "Delivery"
          },
          "auto_send": {
            "type": "boolean",
            "title": "Auto Send"
          },
          "caption": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Caption"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider",
          "trigger",
          "master_id",
          "delivery",
          "auto_send",
          "active"
        ],
        "title": "UnlockRuleOut"
      },
      "UploadIn": {
        "properties": {
          "purpose": {
            "type": "string",
            "enum": [
              "master",
              "leak"
            ],
            "title": "Purpose",
            "description": "master: a file to make copies from. leak: a file to check.",
            "default": "master"
          },
          "filename": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Filename",
            "examples": [
              "march-drop.mp4"
            ]
          },
          "content_type": {
            "type": "string",
            "maxLength": 128,
            "title": "Content Type",
            "default": "video/mp4"
          }
        },
        "type": "object",
        "required": [
          "filename"
        ],
        "title": "UploadIn"
      },
      "UploadOut": {
        "properties": {
          "object_key": {
            "type": "string",
            "title": "Object Key",
            "description": "Pass this to POST /masters or POST /leaks."
          },
          "upload_url": {
            "type": "string",
            "title": "Upload Url",
            "description": "PUT the file body here."
          },
          "method": {
            "type": "string",
            "title": "Method",
            "default": "PUT"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Headers",
            "description": "Send these headers on the PUT."
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "max_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Size"
          }
        },
        "type": "object",
        "required": [
          "object_key",
          "upload_url"
        ],
        "title": "UploadOut"
      },
      "UsageOut": {
        "properties": {
          "plan": {
            "type": "string",
            "title": "Plan"
          },
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "pricing_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Version"
          },
          "band": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Band",
            "description": "Plan on pricing v3: starter | growth | pro | elite. null otherwise."
          },
          "period": {
            "type": "string",
            "title": "Period",
            "description": "Metering month, UTC (YYYY-MM)."
          },
          "copies": {
            "$ref": "#/components/schemas/CopyUsageOut"
          },
          "leak_checks": {
            "type": "string",
            "title": "Leak traces",
            "description": "Leak traces are not counted as copies.",
            "default": "not metered"
          }
        },
        "type": "object",
        "required": [
          "plan",
          "tier",
          "period",
          "copies"
        ],
        "title": "UsageOut"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WebhookAck": {
        "properties": {
          "received": {
            "type": "boolean",
            "title": "Received",
            "default": true
          },
          "duplicate": {
            "type": "boolean",
            "title": "Duplicate",
            "default": false
          },
          "event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Id"
          }
        },
        "type": "object",
        "title": "WebhookAck"
      },
      "WebhookDeliveryListOut": {
        "properties": {
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryOut"
            },
            "type": "array",
            "title": "Deliveries"
          }
        },
        "type": "object",
        "required": [
          "deliveries"
        ],
        "title": "WebhookDeliveryListOut"
      },
      "WebhookDeliveryOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "event_id": {
            "type": "string",
            "title": "Event Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "pending | delivered | dead"
          },
          "attempts": {
            "type": "integer",
            "title": "Attempts"
          },
          "last_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Status"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Attempt At"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "event_id",
          "event_type",
          "status",
          "attempts"
        ],
        "title": "WebhookDeliveryOut"
      },
      "WebhookEndpointCreated": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Events"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "disabled_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled Reason"
          },
          "consecutive_failures": {
            "type": "integer",
            "title": "Consecutive Failures",
            "default": 0
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "secret": {
            "type": "string",
            "title": "Secret",
            "description": "Signing secret, shown once. Verify X-Trace-Signature with it."
          }
        },
        "type": "object",
        "required": [
          "id",
          "url",
          "events",
          "active",
          "secret"
        ],
        "title": "WebhookEndpointCreated"
      },
      "WebhookEndpointIn": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 8,
            "title": "Url",
            "description": "https:// only."
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "copy.ready",
                    "leak.matched",
                    "case.updated"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events",
            "description": "Default: all three events."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "WebhookEndpointIn"
      },
      "WebhookEndpointListOut": {
        "properties": {
          "endpoints": {
            "items": {
              "$ref": "#/components/schemas/WebhookEndpointOut"
            },
            "type": "array",
            "title": "Endpoints"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Events"
          }
        },
        "type": "object",
        "required": [
          "endpoints",
          "events"
        ],
        "title": "WebhookEndpointListOut"
      },
      "WebhookEndpointOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Events"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "disabled_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled Reason"
          },
          "consecutive_failures": {
            "type": "integer",
            "title": "Consecutive Failures",
            "default": 0
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "url",
          "events",
          "active"
        ],
        "title": "WebhookEndpointOut"
      }
    },
    "securitySchemes": {
      "ApiKeyBearer": {
        "type": "http",
        "description": "Authorization: Bearer cs_live_... (preferred)",
        "scheme": "bearer"
      },
      "ApiKeyHeader": {
        "type": "apiKey",
        "description": "X-API-Key: cs_live_... (alternative)",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "tags": [
    {
      "name": "Trace API v1",
      "description": "API-key authenticated. See api.html."
    },
    {
      "name": "Trace webhooks (inbound)",
      "description": "Signed by the sender (HMAC per provider). No API key."
    }
  ],
  "webhooks": {
    "copy.ready": {
      "post": {
        "summary": "copy.ready",
        "description": "A marked copy was made for a buyer (from an unlock rule or a wall drop). GET data.copy.download_url with your API key for the file. Answer 2xx within 10 s. Other answers are retried after 30 s, 2 min, 10 min, 1 h, 6 h and 24 h.",
        "parameters": [
          {
            "name": "X-Trace-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "X-Trace-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Stable across retries of one delivery. Dedupe on it."
          },
          {
            "name": "X-Trace-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "t=1761900000,v1=5f2b..."
              ]
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of '{t}.{raw body}' with the endpoint secret>. Reject when t is more than 5 minutes old."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created",
                  "api_version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "examples": [
                      "evt_3f9c..."
                    ]
                  },
                  "type": {
                    "type": "string",
                    "const": "copy.ready"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "api_version": {
                    "type": "string",
                    "const": "v1"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "copy": {
                        "$ref": "#/components/schemas/CopyOut"
                      },
                      "source": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    },
    "leak.matched": {
      "post": {
        "summary": "leak.matched",
        "description": "A case passed the evidence gate. data.case.match.statement says what it shows: the leaked file matches the copy delivered to that account, not who shared it. Answer 2xx within 10 s. Other answers are retried after 30 s, 2 min, 10 min, 1 h, 6 h and 24 h.",
        "parameters": [
          {
            "name": "X-Trace-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "X-Trace-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Stable across retries of one delivery. Dedupe on it."
          },
          {
            "name": "X-Trace-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "t=1761900000,v1=5f2b..."
              ]
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of '{t}.{raw body}' with the endpoint secret>. Reject when t is more than 5 minutes old."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created",
                  "api_version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "examples": [
                      "evt_3f9c..."
                    ]
                  },
                  "type": {
                    "type": "string",
                    "const": "leak.matched"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "api_version": {
                    "type": "string",
                    "const": "v1"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "case": {
                        "$ref": "#/components/schemas/CaseOut"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    },
    "case.updated": {
      "post": {
        "summary": "case.updated",
        "description": "A case changed status or verdict. Answer 2xx within 10 s. Other answers are retried after 30 s, 2 min, 10 min, 1 h, 6 h and 24 h.",
        "parameters": [
          {
            "name": "X-Trace-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event type."
          },
          {
            "name": "X-Trace-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Stable across retries of one delivery. Dedupe on it."
          },
          {
            "name": "X-Trace-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "t=1761900000,v1=5f2b..."
              ]
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of '{t}.{raw body}' with the endpoint secret>. Reject when t is more than 5 minutes old."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "created",
                  "api_version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "examples": [
                      "evt_3f9c..."
                    ]
                  },
                  "type": {
                    "type": "string",
                    "const": "case.updated"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "api_version": {
                    "type": "string",
                    "const": "v1"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "case": {
                        "$ref": "#/components/schemas/CaseOut"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received."
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Trace API guide",
    "url": "https://www.creatorsenseai.com/api.html"
  }
}
