{
  "components": {
    "responses": {
      "BadRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Invalid request"
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Capability, expiry, or IP allowlist denied"
      },
      "InternalError": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Internal server error"
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Invalid authentication"
      }
    },
    "schemas": {
      "Error": {
        "properties": {
          "error": {
            "required": [
              "code",
              "message",
              "request_id"
            ],
            "type": "object"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "EventObject": {
        "description": "Committed object. Videos may include media_url (short-lived HMAC). Photos/carousels use image_urls (1–10). kind is video, photo, or carousel. mentions and hashtags come from TikTok textExtra when present. Uploads and reposts may include duration (seconds, 1–86400) and music {title, author_name, original, duration}. account.verified and original_author.verified are omitted unless true. LIVE start may include object.title and object.cover_url from the last live_user resolver poll; LIVE end never includes them. LIVE may include avatar_url from the last seen tracked profile. Raw TikTok play_url and music CDN URLs are never included on customer payloads. No stats.",
        "properties": {
          "avatar_url": {
            "format": "uri",
            "type": "string"
          },
          "cover_url": {
            "format": "uri",
            "type": "string"
          },
          "current_state": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "duration": {
            "maximum": 86400,
            "minimum": 0,
            "type": "integer"
          },
          "hashtags": {
            "items": {
              "type": "string"
            },
            "maxItems": 25,
            "type": "array"
          },
          "image_urls": {
            "items": {
              "format": "uri",
              "type": "string"
            },
            "maxItems": 10,
            "type": "array"
          },
          "kind": {
            "enum": [
              "video",
              "photo",
              "carousel"
            ],
            "type": "string"
          },
          "media_url": {
            "format": "uri",
            "type": "string"
          },
          "mentions": {
            "items": {
              "type": "string"
            },
            "maxItems": 25,
            "type": "array"
          },
          "music": {
            "description": "Sound metadata from the item poll. Never includes playUrl or cover URLs.",
            "properties": {
              "author_name": {
                "type": "string"
              },
              "duration": {
                "maximum": 86400,
                "minimum": 0,
                "type": "integer"
              },
              "original": {
                "type": "boolean"
              },
              "title": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "original_author": {
            "description": "Present on reposts only. item.author in the repost poll is the original creator.",
            "properties": {
              "avatar_url": {
                "format": "uri",
                "type": "string"
              },
              "display_name": {
                "type": "string"
              },
              "sec_uid": {
                "type": "string"
              },
              "username": {
                "type": "string"
              },
              "verified": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "previous_state": {
            "type": "string"
          },
          "room_id": {
            "type": "string"
          },
          "session_generation": {
            "type": "integer"
          },
          "title": {
            "description": "LIVE start room title from the resolver stash. Rejected on uploads, reposts, and LIVE end.",
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          },
          "video_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "MediaReadyEvent": {
        "additionalProperties": false,
        "description": "Sibling WebSocket frame. Not a pipeline content event.",
        "properties": {
          "event_id": {
            "description": "Original tiktok.upload.created or tiktok.repost.created event_id",
            "type": "string"
          },
          "object": {
            "properties": {
              "media_url": {
                "description": "Playable HMAC mp4 URL",
                "format": "uri",
                "type": "string"
              },
              "url": {
                "description": "TikTok permalink",
                "format": "uri",
                "type": "string"
              },
              "video_id": {
                "type": "string"
              }
            },
            "required": [
              "video_id",
              "url",
              "media_url"
            ],
            "type": "object"
          },
          "observed_at": {
            "format": "date-time",
            "type": "string"
          },
          "platform": {
            "const": "tiktok",
            "type": "string"
          },
          "schema": {
            "const": "1322.tiktok.media.v1",
            "type": "string"
          },
          "type": {
            "const": "tiktok.media.ready",
            "type": "string"
          }
        },
        "required": [
          "schema",
          "event_id",
          "type",
          "platform",
          "observed_at",
          "object"
        ],
        "type": "object"
      },
      "PatchTrackRequest": {
        "additionalProperties": false,
        "properties": {
          "discord_channel_id": {
            "type": "string"
          },
          "discord_delivery": {
            "type": "boolean"
          },
          "events": {
            "items": {
              "enum": [
                "upload",
                "repost",
                "live"
              ],
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "ws_delivery": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TrackRequest": {
        "additionalProperties": false,
        "description": "Exactly one account alias is accepted. The server always primes current state and emits no initial/history event.",
        "properties": {
          "account": {
            "type": "string"
          },
          "discord_channel_id": {
            "type": "string"
          },
          "emit_initial": {
            "const": false,
            "type": "boolean"
          },
          "events": {
            "items": {
              "enum": [
                "upload",
                "repost",
                "live"
              ],
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "url": {
            "format": "uri",
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UntrackRequest": {
        "additionalProperties": false,
        "properties": {
          "sec_uid": {
            "type": "string"
          },
          "track_id": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "AdminBearer": {
        "description": "Admin listener token; the listener is private and IP allowlisted in production.",
        "scheme": "bearer",
        "type": "http"
      },
      "ApiKeyAuth": {
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      },
      "BearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Live-only multi-tenant tracking for uploads, reposts, and LIVE start/end. First add, restart, and outage recovery never replay historical events. Upload and repost objects may include object.media_url (HMAC cached mp4). When the origin has a playable prefix, tenants also receive a sibling tiktok.media.ready frame (schema 1322.tiktok.media.v1) with the same event_id; it is not a second post and is not settled in the content outbox. Incomplete media responses are no-store; complete responses are cacheable at the edge.",
    "title": "1322 TikTok Tracker API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/": {
      "get": {
        "operationId": "get_",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Customer API documentation",
        "tags": [
          "System"
        ]
      }
    },
    "/admin/backup": {
      "post": {
        "operationId": "post_admin_backup",
        "parameters": [
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Backup create",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients": {
      "get": {
        "operationId": "get_admin_clients",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Clients list",
        "tags": [
          "Admin"
        ]
      },
      "post": {
        "operationId": "post_admin_clients",
        "parameters": [
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client create",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}": {
      "delete": {
        "operationId": "delete_admin_clients_client_id",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client delete",
        "tags": [
          "Admin"
        ]
      },
      "get": {
        "operationId": "get_admin_clients_client_id",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client get",
        "tags": [
          "Admin"
        ]
      },
      "patch": {
        "operationId": "patch_admin_clients_client_id",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client patch",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/api/disable": {
      "post": {
        "operationId": "post_admin_clients_client_id_api_disable",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client api disable",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/api/enable": {
      "post": {
        "operationId": "post_admin_clients_client_id_api_enable",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client api enable",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/discord/disable": {
      "post": {
        "operationId": "post_admin_clients_client_id_discord_disable",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client discord disable",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/discord/enable": {
      "post": {
        "operationId": "post_admin_clients_client_id_discord_enable",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client discord enable",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/extend": {
      "post": {
        "operationId": "post_admin_clients_client_id_extend",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client extend",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/move": {
      "post": {
        "operationId": "post_admin_clients_client_id_move",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client move",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/regenerate": {
      "post": {
        "operationId": "post_admin_clients_client_id_regenerate",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Credential api rotate",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/regenerate-api": {
      "post": {
        "operationId": "post_admin_clients_client_id_regenerate_api",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Credential api rotate",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/rotate-ws": {
      "post": {
        "operationId": "post_admin_clients_client_id_rotate_ws",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Credential websocket rotate",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/tracked": {
      "get": {
        "operationId": "get_admin_clients_client_id_tracked",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client tracks",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/websocket/disable": {
      "post": {
        "operationId": "post_admin_clients_client_id_websocket_disable",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client websocket disable",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/clients/{client_id}/websocket/enable": {
      "post": {
        "operationId": "post_admin_clients_client_id_websocket_enable",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Client websocket enable",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/detectors/health": {
      "get": {
        "operationId": "get_admin_detectors_health",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Detector health",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/reports/expiring": {
      "get": {
        "operationId": "get_admin_reports_expiring",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Report expiring",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/reports/near-limit": {
      "get": {
        "operationId": "get_admin_reports_near_limit",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Report near limit",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/reports/summary": {
      "get": {
        "operationId": "get_admin_reports_summary",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Report summary",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/ws/firehose": {
      "get": {
        "operationId": "admin.firehose.connect",
        "responses": {
          "101": {
            "description": "WebSocket upgraded; no replay or history"
          },
          "401": {
            "description": "Invalid dedicated admin token"
          }
        },
        "security": [
          {
            "AdminBearer": []
          }
        ],
        "summary": "Private live-only committed-event WebSocket",
        "tags": [
          "admin"
        ]
      }
    },
    "/discord/interactions": {
      "post": {
        "operationId": "discord.signed.interaction",
        "parameters": [
          {
            "in": "header",
            "name": "X-Signature-Ed25519",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Signature-Timestamp",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ephemeral interaction response"
          },
          "401": {
            "description": "Invalid signature"
          }
        },
        "security": [],
        "summary": "Optional signed Discord interaction ingress",
        "tags": [
          "discord"
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "get_health",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Process liveness",
        "tags": [
          "System"
        ]
      }
    },
    "/healthz": {
      "get": {
        "operationId": "get_healthz",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Process liveness",
        "tags": [
          "System"
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "get_openapi_json",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "OpenAPI 3.1 contract",
        "tags": [
          "System"
        ]
      }
    },
    "/readyz": {
      "get": {
        "operationId": "get_readyz",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Dependency readiness",
        "tags": [
          "System"
        ]
      }
    },
    "/v1/dashboard": {
      "get": {
        "operationId": "get_v1_dashboard",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "Tenant dashboard",
        "tags": [
          "Client"
        ]
      }
    },
    "/v1/docs": {
      "get": {
        "operationId": "get_v1_docs",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Human-readable API reference",
        "tags": [
          "System"
        ]
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "get_v1_health",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "Tenant health",
        "tags": [
          "Client"
        ]
      }
    },
    "/v1/limits": {
      "get": {
        "operationId": "get_v1_limits",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "Tenant quotas",
        "tags": [
          "Client"
        ]
      }
    },
    "/v1/list": {
      "get": {
        "operationId": "get_v1_list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "List tracked accounts",
        "tags": [
          "Client"
        ]
      }
    },
    "/v1/media/{video_id}.mp4": {
      "get": {
        "operationId": "client.media.get",
        "parameters": [
          {
            "in": "path",
            "name": "video_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "exp",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sig",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "video/mp4; Cache-Control public with s-maxage for an edge cache"
          },
          "403": {
            "description": "Invalid or expired signature; Cache-Control no-store"
          },
          "429": {
            "description": "Too many invalid signatures from one origin IP"
          },
          "503": {
            "description": "Playable prefix not ready yet; Retry-After 1"
          }
        },
        "security": [],
        "summary": "Short-lived HMAC cached mp4. First detect, WebSocket, and Discord never wait on this fetch.",
        "tags": [
          "media"
        ]
      }
    },
    "/v1/status": {
      "get": {
        "operationId": "get_v1_status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "Tenant status",
        "tags": [
          "Client"
        ]
      }
    },
    "/v1/track": {
      "post": {
        "operationId": "post_v1_track",
        "parameters": [
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "Track an account without history",
        "tags": [
          "Client"
        ]
      }
    },
    "/v1/tracks/{track_id}": {
      "patch": {
        "operationId": "patch_v1_tracks_track_id",
        "parameters": [
          {
            "in": "path",
            "name": "track_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchTrackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "Change tracked event and delivery settings",
        "tags": [
          "Client"
        ]
      }
    },
    "/v1/untrack": {
      "post": {
        "operationId": "post_v1_untrack",
        "parameters": [
          {
            "description": "Stable key used to replay the exact committed mutation response.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UntrackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "Stop tracking an account",
        "tags": [
          "Client"
        ]
      }
    },
    "/v1/ws/status": {
      "get": {
        "operationId": "get_v1_ws_status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "summary": "Tenant WebSocket status",
        "tags": [
          "Client"
        ]
      }
    }
  }
}
