{
  "openapi": "3.1.0",
  "info": {
    "title": "TokPortal Public API",
    "version": "2026-05-25",
    "description": "Non-breaking public API contract for TokPortal developer integrations. This spec is the first generated surface for SDKs, CLI, MCP, and docs."
  },
  "servers": [
    {
      "url": "https://app.tokportal.com/api/ext",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Profile"
    },
    {
      "name": "Reference"
    },
    {
      "name": "Credits"
    },
    {
      "name": "Bundles"
    },
    {
      "name": "Account Configuration"
    },
    {
      "name": "Videos"
    },
    {
      "name": "Accounts"
    },
    {
      "name": "Warming"
    },
    {
      "name": "Uploads"
    },
    {
      "name": "Analytics"
    },
    {
      "name": "Comments"
    },
    {
      "name": "Webhooks"
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "getCurrentUser",
        "summary": "Get authenticated user",
        "tags": [
          "Profile"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authenticated user profile and credit balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/me\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/me', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/me',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/me\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "patch": {
        "operationId": "updateCurrentUserSettings",
        "summary": "Update safe workspace settings",
        "description": "Updates client-owned workspace profile fields used by Operator context. Does not expose auth, role, credit, staff, or manager settings.",
        "tags": [
          "Profile"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCurrentUserSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated safe workspace settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateCurrentUserSettingsResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid workspace setting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PATCH \"https://app.tokportal.com/api/ext/me\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"company_name\": \"company_name\",\n  \"website\": \"website\",\n  \"company_niche\": \"company_niche\",\n  \"organic_strategy\": \"organic_strategy\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/me', {\n  method: 'PATCH',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"company_name\": \"company_name\",\n  \"website\": \"website\",\n  \"company_niche\": \"company_niche\",\n  \"organic_strategy\": \"organic_strategy\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PATCH',\n    'https://app.tokportal.com/api/ext/me',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"company_name\": \"company_name\",\n      \"website\": \"website\",\n      \"company_niche\": \"company_niche\",\n      \"organic_strategy\": \"organic_strategy\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PATCH\", \"https://app.tokportal.com/api/ext/me\", strings.NewReader(\"{\\n  \\\"company_name\\\": \\\"company_name\\\",\\n  \\\"website\\\": \\\"website\\\",\\n  \\\"company_niche\\\": \\\"company_niche\\\",\\n  \\\"organic_strategy\\\": \\\"organic_strategy\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/countries": {
      "get": {
        "operationId": "listCountries",
        "summary": "List available countries",
        "tags": [
          "Reference"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Country availability by order type. data contains countries available for new account creation; videos_only_countries contains countries available for video orders on an existing account. Fully disabled countries are excluded from both lists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountriesResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/countries\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/countries', {\n  method: 'GET',\n  headers: {\n    \n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/countries',\n    headers={}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/countries\", nil)\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/platforms": {
      "get": {
        "operationId": "listPlatforms",
        "summary": "List available platforms",
        "tags": [
          "Reference"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Supported social platforms.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/platforms\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/platforms', {\n  method: 'GET',\n  headers: {\n    \n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/platforms',\n    headers={}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/platforms\", nil)\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/credit-costs": {
      "get": {
        "operationId": "getCreditCosts",
        "summary": "Get credit pricing",
        "tags": [
          "Credits"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Current credit cost table.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/credit-costs\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/credit-costs', {\n  method: 'GET',\n  headers: {\n    \n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/credit-costs',\n    headers={}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/credit-costs\", nil)\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/credits/balance": {
      "get": {
        "operationId": "getCreditBalance",
        "summary": "Get credit balance",
        "tags": [
          "Credits"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current credit balance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/credits/balance\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/credits/balance', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/credits/balance',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/credits/balance\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/credits/history": {
      "get": {
        "operationId": "listCreditTransactions",
        "summary": "List credit transactions",
        "tags": [
          "Credits"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Filter transactions created on or after this date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Filter transactions created before the day after this date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated credit transaction history.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/credits/history?page=example&per_page=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/credits/history?page=example&per_page=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/credits/history?page=example&per_page=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/credits/history?page=example&per_page=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles": {
      "get": {
        "operationId": "listBundles",
        "summary": "List bundles",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by bundle status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bundle_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "account_only",
                "account_and_videos",
                "videos_only"
              ]
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram"
              ]
            }
          },
          {
            "name": "external_ref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated bundle list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/bundles?page=example&per_page=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles?page=example&per_page=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/bundles?page=example&per_page=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/bundles?page=example&per_page=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "post": {
        "operationId": "createBundle",
        "summary": "Create a bundle",
        "description": "Creates an account-only, account-and-videos, or videos-only bundle. Credit cost is calculated server-side. For Advanced Niche Warming, either pass advanced_warming_terms now, or buy a target count with advanced_warming_terms_count (3 credits each) and configure the targets later via PUT /bundles/{id}/warming-terms — count-only purchases that are never configured are auto-cancelled and fully refunded after 14 days.",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBundleRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bundle created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBundleResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or business rule violation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Duplicate or invalid state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Create rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"bundle_type\": \"account_only\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"bundle_type\": \"account_only\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"bundle_type\": \"account_only\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles\", strings.NewReader(\"{\\n  \\\"bundle_type\\\": \\\"account_only\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/bulk": {
      "post": {
        "operationId": "createBundlesBulk",
        "summary": "Create bundles in bulk",
        "description": "Creates several bundles at once (per platform). For Advanced Niche Warming, either pass advanced_warming_terms (same terms for every account), or buy a per-account target count with advanced_warming_terms_count and configure each bundle's targets later via PUT /bundles/{id}/warming-terms.",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBulkBundlesRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bulk bundle creation result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or business rule violation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Create rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/bulk\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"platforms\": [\n    \"tiktok\"\n  ],\n  \"country\": \"USA\",\n  \"accounts_count\": 25\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/bulk', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"platforms\": [\n    \"tiktok\"\n  ],\n  \"country\": \"USA\",\n  \"accounts_count\": 25\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/bulk',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"platforms\": [\n        \"tiktok\"\n      ],\n      \"country\": \"USA\",\n      \"accounts_count\": 25\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/bulk\", strings.NewReader(\"{\\n  \\\"platforms\\\": [\\n    \\\"tiktok\\\"\\n  ],\\n  \\\"country\\\": \\\"USA\\\",\\n  \\\"accounts_count\\\": 25\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}": {
      "get": {
        "operationId": "getBundle",
        "summary": "Get a bundle",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bundle details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "patch": {
        "operationId": "updateBundle",
        "summary": "Update bundle settings",
        "description": "Updates mutable bundle metadata such as title, external_ref, and auto_finalize_videos.",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchBundleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bundle updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid patch body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Bundle belongs to another account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Duplicate external_ref.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PATCH \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"auto_finalize_videos\": false,\n  \"external_ref\": \"external_ref\",\n  \"title\": \"Launch campaign\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'PATCH',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"auto_finalize_videos\": false,\n  \"external_ref\": \"external_ref\",\n  \"title\": \"Launch campaign\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PATCH',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"auto_finalize_videos\": false,\n      \"external_ref\": \"external_ref\",\n      \"title\": \"Launch campaign\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PATCH\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", strings.NewReader(\"{\\n  \\\"auto_finalize_videos\\\": false,\\n  \\\"external_ref\\\": \\\"external_ref\\\",\\n  \\\"title\\\": \\\"Launch campaign\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/publish": {
      "post": {
        "operationId": "publishBundle",
        "summary": "Publish a bundle",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Publish result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Bundle is not ready or is in an invalid state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/publish\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/publish', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/publish',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/publish\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/publish-readiness": {
      "get": {
        "operationId": "getBundlePublishReadiness",
        "summary": "Check bundle publish readiness",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Readiness blockers and ready flag.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/publish-readiness\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/publish-readiness', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/publish-readiness',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/publish-readiness\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/unpublish": {
      "post": {
        "operationId": "unpublishBundle",
        "summary": "Unpublish a bundle",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Unpublish result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Bundle is in an invalid state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/unpublish\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/unpublish', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/unpublish',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/unpublish\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/add-video-slots": {
      "post": {
        "operationId": "addVideoSlots",
        "summary": "Add video slots to a bundle",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuantityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created video slots.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid quantity or bundle type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/add-video-slots\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"quantity\": 1\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/add-video-slots', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"quantity\": 1\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/add-video-slots',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"quantity\": 1\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/add-video-slots\", strings.NewReader(\"{\\n  \\\"quantity\\\": 1\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/add-edit-slots": {
      "post": {
        "operationId": "addEditSlots",
        "summary": "Add edit slots to a bundle",
        "tags": [
          "Bundles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuantityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created edit slots.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid quantity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/add-edit-slots\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"quantity\": 1\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/add-edit-slots', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"quantity\": 1\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/add-edit-slots',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"quantity\": 1\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/add-edit-slots\", strings.NewReader(\"{\\n  \\\"quantity\\\": 1\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/account": {
      "get": {
        "operationId": "getBundleAccount",
        "summary": "Get bundle account configuration",
        "tags": [
          "Account Configuration"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Bundle or account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "put": {
        "operationId": "configureBundleAccount",
        "summary": "Configure bundle account profile",
        "description": "Sets the account identity (username, visible name, biography, profile picture). For backward compatibility it can also accept the exact purchased advanced_warming_terms list, but PUT /bundles/{id}/warming-terms is the recommended one-shot deferred-target endpoint because it remains available at any account status.",
        "tags": [
          "Account Configuration"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigureAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configured account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid account profile, or advanced_warming_terms does not match the purchased target count (ADVANCED_WARMING_TERMS).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or account not found, or no warming session to configure (WARMING_SESSION_NOT_FOUND).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Account status does not allow configuration, or the warming targets are already set (WARMING_TERMS_ALREADY_SET).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PUT \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"username\": \"username\",\n  \"visible_name\": \"visible_name\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account', {\n  method: 'PUT',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"username\": \"username\",\n  \"visible_name\": \"visible_name\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PUT',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"username\": \"username\",\n      \"visible_name\": \"visible_name\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PUT\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account\", strings.NewReader(\"{\\n  \\\"username\\\": \\\"username\\\",\\n  \\\"visible_name\\\": \\\"visible_name\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/account/corrections": {
      "post": {
        "operationId": "requestBundleAccountCorrections",
        "summary": "Request account corrections",
        "description": "Moves an in-review account back to pending corrections with reviewer feedback.",
        "tags": [
          "Account Configuration"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCorrectionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account corrections requested.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid correction body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Account is not in review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account/corrections\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"comment\": \"Please review this item.\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account/corrections', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"comment\": \"Please review this item.\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account/corrections',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"comment\": \"Please review this item.\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account/corrections\", strings.NewReader(\"{\\n  \\\"comment\\\": \\\"Please review this item.\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/account/finalize": {
      "post": {
        "operationId": "finalizeBundleAccount",
        "summary": "Finalize account review",
        "description": "Approves an in-review account and marks it finalized.",
        "tags": [
          "Account Configuration"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account finalized.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Account is not in review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account/finalize\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account/finalize', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account/finalize',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/account/finalize\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos": {
      "get": {
        "operationId": "listBundleVideos",
        "summary": "List bundle video slots",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video slots for the bundle.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/{position}": {
      "get": {
        "operationId": "getBundleVideo",
        "summary": "Get video slot configuration",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video slot configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "put": {
        "operationId": "configureBundleVideo",
        "summary": "Configure a video slot",
        "description": "Configure a slot as a video, carousel, or story. A story (TikTok/Instagram only) is a single video OR a single image (provide exactly one of video_url or story_image_url), has no description, and is verified by an account-manager screenshot. The optional story_repost_url makes the story repost an existing post from the SAME platform and costs +1 credit.",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigureVideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configured video slot.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid video metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Video status does not allow configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PUT \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"video_type\": \"video\",\n  \"target_publish_date\": \"target_publish_date\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1', {\n  method: 'PUT',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"video_type\": \"video\",\n  \"target_publish_date\": \"target_publish_date\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PUT',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"video_type\": \"video\",\n      \"target_publish_date\": \"target_publish_date\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PUT\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1\", strings.NewReader(\"{\\n  \\\"video_type\\\": \\\"video\\\",\\n  \\\"target_publish_date\\\": \\\"target_publish_date\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "patch": {
        "operationId": "patchBundleVideo",
        "summary": "Patch video metadata or schedule",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchVideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Patched video slot.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid patch body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PATCH \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"external_ref\": \"external_ref\",\n  \"name\": \"name\",\n  \"description\": \"Campaign content description.\",\n  \"target_publish_date\": \"target_publish_date\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1', {\n  method: 'PATCH',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"external_ref\": \"external_ref\",\n  \"name\": \"name\",\n  \"description\": \"Campaign content description.\",\n  \"target_publish_date\": \"target_publish_date\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PATCH',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"external_ref\": \"external_ref\",\n      \"name\": \"name\",\n      \"description\": \"Campaign content description.\",\n      \"target_publish_date\": \"target_publish_date\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PATCH\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1\", strings.NewReader(\"{\\n  \\\"external_ref\\\": \\\"external_ref\\\",\\n  \\\"name\\\": \\\"name\\\",\\n  \\\"description\\\": \\\"Campaign content description.\\\",\\n  \\\"target_publish_date\\\": \\\"target_publish_date\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/batch": {
      "put": {
        "operationId": "batchConfigureBundleVideos",
        "summary": "Configure video slots in bulk",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchConfigureVideosRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch video configuration result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid batch body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PUT \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/batch\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"videos\": [\n    {\n      \"video_type\": \"video\",\n      \"target_publish_date\": \"target_publish_date\",\n      \"position\": 1\n    }\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/batch', {\n  method: 'PUT',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"videos\": [\n    {\n      \"video_type\": \"video\",\n      \"target_publish_date\": \"target_publish_date\",\n      \"position\": 1\n    }\n  ]\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PUT',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/batch',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"videos\": [\n        {\n          \"video_type\": \"video\",\n          \"target_publish_date\": \"target_publish_date\",\n          \"position\": 1\n        }\n      ]\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PUT\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/batch\", strings.NewReader(\"{\\n  \\\"videos\\\": [\\n    {\\n      \\\"video_type\\\": \\\"video\\\",\\n      \\\"target_publish_date\\\": \\\"target_publish_date\\\",\\n      \\\"position\\\": 1\\n    }\\n  ]\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/publish-all": {
      "post": {
        "operationId": "publishAllBundleVideos",
        "summary": "Publish all configured videos on an active bundle",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published video slots.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Bundle status does not allow publishing videos.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/publish-all\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/publish-all', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/publish-all',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/publish-all\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/import-csv": {
      "post": {
        "operationId": "importBundleVideosCsv",
        "summary": "Import video slots from CSV",
        "description": "Uploads a CSV file, downloads referenced media, and configures available video slots.",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "auto_publish": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CSV import result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid CSV or upload body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/import-csv\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -F \"file=@/path/to/file\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/import-csv', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/import-csv',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/import-csv\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/{position}/publish": {
      "post": {
        "operationId": "publishBundleVideo",
        "summary": "Publish one video slot",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video slot published.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Bundle or video status does not allow publishing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/publish\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/publish', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/publish',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/publish\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/{position}/reset": {
      "post": {
        "operationId": "resetBundleVideo",
        "summary": "Reset one video slot",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video slot reset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Video status does not allow reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/reset\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/reset', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/reset',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/reset\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/{position}/unschedule": {
      "post": {
        "operationId": "unscheduleBundleVideo",
        "summary": "Unschedule one video slot",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video slot unscheduled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Video status does not allow unscheduling.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/unschedule\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/unschedule', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/unschedule',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/unschedule\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/{position}/finalize": {
      "post": {
        "operationId": "finalizeBundleVideo",
        "summary": "Finalize video review",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video slot finalized.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Video is not in review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/finalize\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/finalize', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/finalize',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/finalize\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/{position}/corrections": {
      "post": {
        "operationId": "requestBundleVideoCorrections",
        "summary": "Request video corrections",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoCorrectionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Video corrections requested.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid correction body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Video is not in review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/corrections\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"comment\": \"Please review this item.\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/corrections', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"comment\": \"Please review this item.\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/corrections',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"comment\": \"Please review this item.\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/corrections\", strings.NewReader(\"{\\n  \\\"comment\\\": \\\"Please review this item.\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/videos/{position}/fix-download": {
      "post": {
        "operationId": "fixBundleVideoDownload",
        "summary": "Fix a broken video download",
        "description": "Replaces a manager-flagged broken video or carousel download URL and clears the download issue flag.",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "path",
            "required": true,
            "description": "1-based video slot position.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FixVideoDownloadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Video download issue fixed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid replacement media body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle or video slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Video does not have a download issue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/fix-download\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '\"value\"'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/fix-download', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify(\"value\")\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/fix-download',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json=\"value\"\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/videos/1/fix-download\", strings.NewReader(\"\\\"value\\\"\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts": {
      "get": {
        "operationId": "listAccounts",
        "summary": "List delivered accounts",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by platform.",
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram"
              ]
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Filter by country code or country alias.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated delivered account list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/accounts?page=example&per_page=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts?page=example&per_page=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/accounts?page=example&per_page=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/accounts?page=example&per_page=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}": {
      "get": {
        "operationId": "getAccount",
        "summary": "Get a delivered account",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivered account details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/commenting-profile": {
      "patch": {
        "operationId": "updateAccountCommentingProfile",
        "summary": "Update account commenting profile",
        "description": "Updates client-owned commenting/autopilot profile fields for a delivered account. The account must belong to the API key owner.",
        "tags": [
          "Accounts",
          "Comments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountCommentingProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated account commenting profile.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid commenting profile body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PATCH \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/commenting-profile\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"niche\": \"niche\",\n  \"persona\": \"persona\",\n  \"goal\": \"promotion\",\n  \"language\": \"language\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/commenting-profile', {\n  method: 'PATCH',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"niche\": \"niche\",\n  \"persona\": \"persona\",\n  \"goal\": \"promotion\",\n  \"language\": \"language\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PATCH',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/commenting-profile',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"niche\": \"niche\",\n      \"persona\": \"persona\",\n      \"goal\": \"promotion\",\n      \"language\": \"language\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PATCH\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/commenting-profile\", strings.NewReader(\"{\\n  \\\"niche\\\": \\\"niche\\\",\\n  \\\"persona\\\": \\\"persona\\\",\\n  \\\"goal\\\": \\\"promotion\\\",\\n  \\\"language\\\": \\\"language\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/bundles": {
      "get": {
        "operationId": "listAccountBundles",
        "summary": "List bundles for a delivered account",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by bundle status.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated bundles for account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/bundles?page=example&per_page=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/bundles?page=example&per_page=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/bundles?page=example&per_page=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/bundles?page=example&per_page=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/verification-code": {
      "post": {
        "operationId": "retrieveAccountVerificationCode",
        "summary": "Retrieve latest account verification code",
        "description": "Retrieving a verification code counts as logging in outside TokPortal and permanently voids TokPortal support for the account. The first retrieval on an account requires the explicit acknowledgment flag in the body; without it the request fails with 428 and the disclaimer text.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcknowledgeSupportForfeitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification code result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationCodeResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Owning fee required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Account or verification code not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "428": {
            "description": "Support-forfeit acknowledgment required. Retry with {\"acknowledge_support_forfeit\": true} after confirming the disclaimer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/verification-code\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"acknowledge_support_forfeit\": false\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/verification-code', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"acknowledge_support_forfeit\": false\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/verification-code',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"acknowledge_support_forfeit\": false\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/verification-code\", strings.NewReader(\"{\\n  \\\"acknowledge_support_forfeit\\\": false\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/reveal-credentials": {
      "post": {
        "operationId": "revealAccountCredentials",
        "summary": "Reveal delivered account credentials",
        "description": "Revealing credentials permanently voids TokPortal support for the account — no replacement or refund request will be considered afterward. The first reveal on an account requires the explicit acknowledgment flag in the body; without it the request fails with 428 and the disclaimer text, and nothing is revealed.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcknowledgeSupportForfeitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credentials reveal result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevealCredentialsResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Owning fee required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "428": {
            "description": "Support-forfeit acknowledgment required. Retry with {\"acknowledge_support_forfeit\": true} after confirming the disclaimer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/reveal-credentials\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"acknowledge_support_forfeit\": false\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/reveal-credentials', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"acknowledge_support_forfeit\": false\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/reveal-credentials',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"acknowledge_support_forfeit\": false\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/reveal-credentials\", strings.NewReader(\"{\\n  \\\"acknowledge_support_forfeit\\\": false\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/analytics/can-refresh": {
      "get": {
        "operationId": "canRefreshAccountAnalytics",
        "summary": "Check analytics refresh availability",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Manual refresh availability.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/can-refresh\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/can-refresh', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/can-refresh',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/can-refresh\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/analytics/refresh": {
      "post": {
        "operationId": "refreshAccountAnalytics",
        "summary": "Refresh account analytics",
        "description": "Backward-compatible account analytics refresh path. Supports forced refresh and post import options.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshAnalyticsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refresh result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include this analytics level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Manual refresh cooldown active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "502": {
            "description": "Refresh provider failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/refresh\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"force\": false,\n  \"includePosts\": false,\n  \"includeComments\": false,\n  \"forcePosts\": false\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/refresh', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"force\": false,\n  \"includePosts\": false,\n  \"includeComments\": false,\n  \"forcePosts\": false\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/refresh',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"force\": false,\n      \"includePosts\": false,\n      \"includeComments\": false,\n      \"forcePosts\": false\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/refresh\", strings.NewReader(\"{\\n  \\\"force\\\": false,\\n  \\\"includePosts\\\": false,\\n  \\\"includeComments\\\": false,\\n  \\\"forcePosts\\\": false\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/edit-request": {
      "get": {
        "operationId": "getAccountEditRequest",
        "summary": "Get active account edit request",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Active edit request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/edit-request\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/edit-request', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/edit-request',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/edit-request\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "post": {
        "operationId": "createAccountEditRequest",
        "summary": "Request profile edits for a delivered account",
        "description": "Requests profile changes and debits 8 credits. Requires a current or previous account manager. If no active order exists, TokPortal restores the current or last delivery manager. An active order without an assigned manager remains blocking, and cancelled orders are never used as fallback.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountEditRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Edit request created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid edit request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "No current/previous manager is available, the active order is unassigned, or an active edit request already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/edit-request\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"requested_username\": \"requested_username\",\n  \"requested_visible_name\": \"requested_visible_name\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/edit-request', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"requested_username\": \"requested_username\",\n  \"requested_visible_name\": \"requested_visible_name\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/edit-request',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"requested_username\": \"requested_username\",\n      \"requested_visible_name\": \"requested_visible_name\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/edit-request\", strings.NewReader(\"{\\n  \\\"requested_username\\\": \\\"requested_username\\\",\\n  \\\"requested_visible_name\\\": \\\"requested_visible_name\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/rewarm": {
      "post": {
        "operationId": "rewarmAccount",
        "summary": "Order Advanced Niche Warming (rewarm) on a delivered account",
        "description": "Starts an Advanced Niche Warming session on a saved account: for each provided term the manager screen-records a session that opens on the account profile (handle visible), searches the term on the account's platform, watches videos from the results, engages with them (likes/saves) and leaves a comment. Every recording is verified before completion. Costs 3 credits per term (3-30 terms, multiples of 3). Requires an active order with an assigned manager, TikTok or Instagram, and no already-active warming session. Terms are split evenly over 3 calendar days in the manager's timezone; earlier-day tasks remain available until completed and sessions with tasks do not expire.",
        "tags": [
          "Warming"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RewarmAccountRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Warming session created and started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarmingSessionResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid terms (ADVANCED_WARMING_TERMS) or unsupported platform (ADVANCED_WARMING_PLATFORM).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Account belongs to another user.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "No active order with a manager (REWARM_NO_ACTIVE_ORDER) or a warming session is already active (REWARM_ALREADY_ACTIVE).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/rewarm\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"search_terms\": [\n    \"search_terms\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/rewarm', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"search_terms\": [\n    \"search_terms\"\n  ]\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/rewarm',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"search_terms\": [\n        \"search_terms\"\n      ]\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/rewarm\", strings.NewReader(\"{\\n  \\\"search_terms\\\": [\\n    \\\"search_terms\\\"\\n  ]\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/bundles/{id}/warming-terms": {
      "put": {
        "operationId": "configureBundleWarmingTerms",
        "summary": "Configure the niche targets of a count-only Advanced Niche Warming purchase",
        "description": "Sets the niche targets for a bundle created with advanced_warming_terms_count (deferred configuration). Must provide EXACTLY the purchased number of targets. One-shot: once configured the targets cannot be changed. Works at ANY account status — unlike PUT /bundles/{id}/account this stays available after the manager accepted the mission or submitted the account, in which case the warming session starts immediately.",
        "tags": [
          "Warming"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Bundle ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigureWarmingTermsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Targets configured (started=true when the session began immediately).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarmingSessionResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Wrong number of targets or invalid targets (ADVANCED_WARMING_TERMS).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found, or no warming session to configure (WARMING_SESSION_NOT_FOUND).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Targets already configured (WARMING_TERMS_ALREADY_SET).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PUT \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/warming-terms\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"advanced_warming_terms\": [\n    \"advanced_warming_terms\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/warming-terms', {\n  method: 'PUT',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"advanced_warming_terms\": [\n    \"advanced_warming_terms\"\n  ]\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PUT',\n    'https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/warming-terms',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"advanced_warming_terms\": [\n        \"advanced_warming_terms\"\n      ]\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PUT\", \"https://app.tokportal.com/api/ext/bundles/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/warming-terms\", strings.NewReader(\"{\\n  \\\"advanced_warming_terms\\\": [\\n    \\\"advanced_warming_terms\\\"\\n  ]\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/warming-sessions": {
      "get": {
        "operationId": "listAccountWarmingSessions",
        "summary": "List Advanced Niche Warming sessions for an account",
        "description": "Lists Advanced Niche Warming sessions (newest first) for a saved account you own, including per-term tasks, per-term reports, proof links, and the aggregated session report when completed. Tasks unlock over 3 calendar days in the manager's timezone and, once created, do not expire.",
        "tags": [
          "Warming"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Warming sessions with tasks and reports.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "403": {
            "description": "Account belongs to another user.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/warming-sessions\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/warming-sessions', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/warming-sessions',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/warming-sessions\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/warming-sessions/{id}": {
      "get": {
        "operationId": "getWarmingSession",
        "summary": "Get an Advanced Niche Warming session",
        "description": "Returns one Advanced Niche Warming session you own: status, per-term tasks (with 3-calendar-day dispatch in the manager's timezone, verification status, client report and proof video link), and the aggregated report on completion. Created tasks remain open until completed; they do not expire.",
        "tags": [
          "Warming"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Warming session ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Warming session detail.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarmingSessionResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Warming session not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/warming-sessions/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/warming-sessions/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/warming-sessions/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/warming-sessions/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/warming/generate-terms": {
      "post": {
        "operationId": "generateWarmingTerms",
        "summary": "Generate Advanced Niche Warming search terms",
        "description": "Generates platform-appropriate Advanced Niche Warming search terms (niche targets) from a free-text niche description (max 1000 characters). Free — no credits are charged. Pass the result to advanced_warming_terms (bundle creation or PUT /bundles/{id}/warming-terms deferred configuration) or search_terms (rewarm).",
        "tags": [
          "Warming"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateWarmingTermsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated search terms.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid count/description (ADVANCED_WARMING_TERMS) or unsupported platform (ADVANCED_WARMING_PLATFORM).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "502": {
            "description": "Term generation failed (TERM_GENERATION_FAILED).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "AI generation unavailable (AI_UNAVAILABLE).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/warming/generate-terms\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"text\": \"text\",\n  \"platform\": \"tiktok\",\n  \"count\": 25\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/warming/generate-terms', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"text\": \"text\",\n  \"platform\": \"tiktok\",\n  \"count\": 25\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/warming/generate-terms',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"text\": \"text\",\n      \"platform\": \"tiktok\",\n      \"count\": 25\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/warming/generate-terms\", strings.NewReader(\"{\\n  \\\"text\\\": \\\"text\\\",\\n  \\\"platform\\\": \\\"tiktok\\\",\\n  \\\"count\\\": 25\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/webhooks/events": {
      "get": {
        "operationId": "listWebhookEvents",
        "summary": "List webhook event catalog",
        "description": "Returns the supported webhook event types, delivery envelope, signature scheme, and example payloads. This endpoint is public so teams can inspect webhook contracts before creating an API key.",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Supported webhook events and delivery contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventsResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/webhooks/events\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks/events', {\n  method: 'GET',\n  headers: {\n    \n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/webhooks/events',\n    headers={}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/webhooks/events\", nil)\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "summary": "List webhook endpoints",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "description": "Filter by enabled state.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "description": "Filter endpoints subscribed to an event.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated webhook endpoint list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/webhooks?page=example&per_page=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks?page=example&per_page=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/webhooks?page=example&per_page=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/webhooks?page=example&per_page=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "post": {
        "operationId": "createWebhookEndpoint",
        "summary": "Create a webhook endpoint",
        "description": "Creates a webhook endpoint and returns its signing secret once. Store the secret to verify TokPortal webhook signatures.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook endpoint created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Endpoint already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/webhooks\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"url\": \"https://example.com/resource\",\n  \"events\": [\n    \"webhook.test\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"url\": \"https://example.com/resource\",\n  \"events\": [\n    \"webhook.test\"\n  ]\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/webhooks',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"url\": \"https://example.com/resource\",\n      \"events\": [\n        \"webhook.test\"\n      ]\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/webhooks\", strings.NewReader(\"{\\n  \\\"url\\\": \\\"https://example.com/resource\\\",\\n  \\\"events\\\": [\\n    \\\"webhook.test\\\"\\n  ]\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/webhooks/{id}": {
      "get": {
        "operationId": "getWebhookEndpoint",
        "summary": "Get a webhook endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook endpoint details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Webhook endpoint not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "summary": "Update a webhook endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook endpoint updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook endpoint patch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Webhook endpoint not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X PATCH \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"url\": \"https://example.com/resource\",\n  \"events\": [\n    \"webhook.test\"\n  ],\n  \"description\": \"Campaign content description.\",\n  \"enabled\": false\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'PATCH',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"url\": \"https://example.com/resource\",\n  \"events\": [\n    \"webhook.test\"\n  ],\n  \"description\": \"Campaign content description.\",\n  \"enabled\": false\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'PATCH',\n    'https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"url\": \"https://example.com/resource\",\n      \"events\": [\n        \"webhook.test\"\n      ],\n      \"description\": \"Campaign content description.\",\n      \"enabled\": false\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"PATCH\", \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", strings.NewReader(\"{\\n  \\\"url\\\": \\\"https://example.com/resource\\\",\\n  \\\"events\\\": [\\n    \\\"webhook.test\\\"\\n  ],\\n  \\\"description\\\": \\\"Campaign content description.\\\",\\n  \\\"enabled\\\": false\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "delete": {
        "operationId": "deleteWebhookEndpoint",
        "summary": "Delete a webhook endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Webhook endpoint deleted.",
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Webhook endpoint not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X DELETE \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'DELETE',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'DELETE',\n    'https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"DELETE\", \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List webhook deliveries",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "description": "Filter by event type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "success",
            "in": "query",
            "required": false,
            "description": "Filter by delivery success.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated delivery attempts for the webhook endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Webhook endpoint not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/deliveries?page=example&per_page=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/deliveries?page=example&per_page=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/deliveries?page=example&per_page=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/deliveries?page=example&per_page=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/webhooks/{id}/deliveries/{delivery_id}/retry": {
      "post": {
        "operationId": "retryWebhookDelivery",
        "summary": "Retry a webhook delivery",
        "description": "Resends the stored webhook payload to the endpoint's current URL with a fresh TokPortal-Signature header. The event ID is preserved so receivers can keep idempotent processing.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "description": "Webhook delivery ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Retry delivery result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Webhook endpoint or delivery not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Webhook endpoint is disabled or payload is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/deliveries/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/retry\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/deliveries/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/retry', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/deliveries/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/retry',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/deliveries/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/retry\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "testWebhookEndpoint",
        "summary": "Send a test webhook",
        "description": "Sends a signed webhook.test event to the endpoint and records the delivery result.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test delivery result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Webhook endpoint not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/test\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/test', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/test',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/webhooks/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/test\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/upload/video": {
      "post": {
        "operationId": "uploadVideo",
        "summary": "Create a video upload URL",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadVideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Presigned video upload URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid upload request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/upload/video\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"filename\": \"media.mp4\",\n  \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/upload/video', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"filename\": \"media.mp4\",\n  \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/upload/video',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"filename\": \"media.mp4\",\n      \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/upload/video\", strings.NewReader(\"{\\n  \\\"filename\\\": \\\"media.mp4\\\",\\n  \\\"bundle_id\\\": \\\"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/upload/video/direct": {
      "post": {
        "operationId": "uploadVideoDirect",
        "summary": "Upload a video file directly",
        "description": "Uploads multipart/form-data directly through TokPortal and returns the public video URL.",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "bundle_id"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "bundle_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uploaded video URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid upload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/upload/video/direct\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -F \"file=@/path/to/file\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/upload/video/direct', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/upload/video/direct',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/upload/video/direct\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/upload/image": {
      "post": {
        "operationId": "uploadImage",
        "summary": "Create an image upload URL",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed image upload URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid upload request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/upload/image\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"filename\": \"media.mp4\",\n  \"content_type\": \"video/mp4\",\n  \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/upload/image', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"filename\": \"media.mp4\",\n  \"content_type\": \"video/mp4\",\n  \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/upload/image',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"filename\": \"media.mp4\",\n      \"content_type\": \"video/mp4\",\n      \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/upload/image\", strings.NewReader(\"{\\n  \\\"filename\\\": \\\"media.mp4\\\",\\n  \\\"content_type\\\": \\\"video/mp4\\\",\\n  \\\"bundle_id\\\": \\\"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/upload/image/direct": {
      "post": {
        "operationId": "uploadImageDirect",
        "summary": "Upload an image file directly",
        "description": "Uploads multipart/form-data directly through TokPortal and returns storage details. HEIF/HEIC may be converted to JPEG.",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "bundle_id"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "bundle_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "carousel",
                      "profile_picture"
                    ],
                    "default": "carousel"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uploaded image URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid upload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/upload/image/direct\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -F \"file=@/path/to/file\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/upload/image/direct', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/upload/image/direct',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/upload/image/direct\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/upload/image/from-url": {
      "post": {
        "operationId": "uploadImageFromUrl",
        "summary": "Import an image from URL",
        "description": "Fetches a public direct image URL and stores it permanently in TokPortal storage.",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadImageFromUrlRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored image details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid image URL or request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/upload/image/from-url\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"url\": \"https://example.com/resource\",\n  \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/upload/image/from-url', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"url\": \"https://example.com/resource\",\n  \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/upload/image/from-url',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"url\": \"https://example.com/resource\",\n      \"bundle_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/upload/image/from-url\", strings.NewReader(\"{\\n  \\\"url\\\": \\\"https://example.com/resource\\\",\\n  \\\"bundle_id\\\": \\\"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics": {
      "get": {
        "operationId": "getAnalyticsDashboard",
        "summary": "Get analytics dashboard",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Repeatable platform filter.",
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram"
              ]
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Repeatable country filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Repeatable account filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics dashboard data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics?workspace=example&platform=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics?workspace=example&platform=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics?workspace=example&platform=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics?workspace=example&platform=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/contract": {
      "get": {
        "operationId": "getAnalyticsContract",
        "summary": "Get analytics data contract",
        "description": "Returns the Analytics v2 contract, current access payload, metric semantics, freshness targets, and redaction rules.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics contract and access payload.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics/contract\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/contract', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics/contract',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics/contract\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/export/videos": {
      "get": {
        "operationId": "exportAnalyticsVideos",
        "summary": "Export analytics videos CSV",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Repeatable account filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Repeatable platform filter.",
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram"
              ]
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Repeatable country filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV export of analytics video rows.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include this analytics level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics/export/videos?account=example&workspace=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/export/videos?account=example&workspace=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics/export/videos?account=example&workspace=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics/export/videos?account=example&workspace=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/export/reports": {
      "post": {
        "operationId": "createAnalyticsReport",
        "summary": "Create analytics web report",
        "description": "Creates a shareable Analytics v2 web report and returns its token and URL.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAnalyticsReportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created analytics report.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid report request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include this analytics level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/analytics/export/reports\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"title\": \"Launch campaign\",\n  \"template\": \"template\",\n  \"brandName\": \"brandName\",\n  \"brandAccent\": \"brandAccent\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/export/reports', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"title\": \"Launch campaign\",\n  \"template\": \"template\",\n  \"brandName\": \"brandName\",\n  \"brandAccent\": \"brandAccent\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/analytics/export/reports',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"title\": \"Launch campaign\",\n      \"template\": \"template\",\n      \"brandName\": \"brandName\",\n      \"brandAccent\": \"brandAccent\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/analytics/export/reports\", strings.NewReader(\"{\\n  \\\"title\\\": \\\"Launch campaign\\\",\\n  \\\"template\\\": \\\"template\\\",\\n  \\\"brandName\\\": \\\"brandName\\\",\\n  \\\"brandAccent\\\": \\\"brandAccent\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/export/reports/html": {
      "post": {
        "operationId": "exportAnalyticsReportHtml",
        "summary": "Export analytics report HTML",
        "description": "Creates a standalone downloadable HTML analytics report.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAnalyticsReportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Standalone analytics report HTML.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid report request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include this analytics level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/analytics/export/reports/html\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"title\": \"Launch campaign\",\n  \"template\": \"template\",\n  \"brandName\": \"brandName\",\n  \"brandAccent\": \"brandAccent\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/export/reports/html', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"title\": \"Launch campaign\",\n  \"template\": \"template\",\n  \"brandName\": \"brandName\",\n  \"brandAccent\": \"brandAccent\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/analytics/export/reports/html',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"title\": \"Launch campaign\",\n      \"template\": \"template\",\n      \"brandName\": \"brandName\",\n      \"brandAccent\": \"brandAccent\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/analytics/export/reports/html\", strings.NewReader(\"{\\n  \\\"title\\\": \\\"Launch campaign\\\",\\n  \\\"template\\\": \\\"template\\\",\\n  \\\"brandName\\\": \\\"brandName\\\",\\n  \\\"brandAccent\\\": \\\"brandAccent\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/series": {
      "get": {
        "operationId": "getAnalyticsSeries",
        "summary": "Get analytics time series",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "views",
                "likes",
                "comments",
                "shares",
                "followers"
              ],
              "default": "views"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week"
              ],
              "default": "day"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "cumulative",
                "gained",
                "snapshot"
              ],
              "default": "cumulative"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "Repeatable account filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics time series.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include this analytics level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics/series?metric=example&granularity=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/series?metric=example&granularity=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics/series?metric=example&granularity=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics/series?metric=example&granularity=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/accounts/{id}": {
      "get": {
        "operationId": "getAnalyticsAccount",
        "summary": "Get account analytics drilldown",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account analytics drilldown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/accounts/{id}/refresh": {
      "post": {
        "operationId": "refreshAnalyticsAccount",
        "summary": "Refresh analytics account",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshAnalyticsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refresh result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include this analytics level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Manual refresh cooldown active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "502": {
            "description": "Refresh provider failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/refresh\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"force\": false,\n  \"includePosts\": false,\n  \"includeComments\": false,\n  \"forcePosts\": false\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/refresh', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"force\": false,\n  \"includePosts\": false,\n  \"includeComments\": false,\n  \"forcePosts\": false\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/refresh',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"force\": false,\n      \"includePosts\": false,\n      \"includeComments\": false,\n      \"forcePosts\": false\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/refresh\", strings.NewReader(\"{\\n  \\\"force\\\": false,\\n  \\\"includePosts\\\": false,\\n  \\\"includeComments\\\": false,\\n  \\\"forcePosts\\\": false\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/accounts/{id}/raw": {
      "get": {
        "operationId": "listAnalyticsAccountRawSnapshots",
        "summary": "List raw account analytics snapshots",
        "description": "Returns owner-scoped stored raw analytics payloads for a saved account. Full analytics tier only.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "bundle_social",
                "apify",
                "manual"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30,
              "default": 5
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Raw account analytics snapshots.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include raw analytics payloads.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/raw?source=example&limit=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/raw?source=example&limit=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/raw?source=example&limit=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/raw?source=example&limit=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/analytics": {
      "get": {
        "operationId": "getAccountAnalytics",
        "summary": "Get account analytics compatibility view",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account analytics data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/accounts/{id}/analytics/videos": {
      "get": {
        "operationId": "listAccountVideoAnalytics",
        "summary": "List post analytics for an account",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "views",
                "likes",
                "engagement_rate",
                "upload_date"
              ],
              "default": "upload_date"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Post analytics list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/videos?page=example&per_page=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/videos?page=example&per_page=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/videos?page=example&per_page=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics/videos?page=example&per_page=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/videos/{id}/analytics": {
      "get": {
        "operationId": "getVideoAnalytics",
        "summary": "Get single video analytics",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Video ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video analytics.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Video not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/analytics\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/videos/{id}/ad-code-request": {
      "post": {
        "operationId": "createVideoAdCodeRequest",
        "summary": "Request an ad code (TikTok Spark Code / Instagram Partner Code) for a finalized video",
        "description": "Requests an ad code (TikTok Spark Code or Instagram Partner Code) for one finalized video and debits 7 credits. The video must be finalized on TikTok or Instagram with a live post link, and its account must have a current or previous manager. If no active order exists, TokPortal restores the current or last delivery manager. An active order without an assigned manager remains blocking, and cancelled orders are never used as fallback. Only one open request per video is allowed. Poll the GET endpoint to retrieve the code once the manager submits it.",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Video ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdCodeRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ad code request created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCodeRequestResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or platform not available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Video not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "No current/previous manager, an unassigned active order, video not finalized, or an open request already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/ad-code-request\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"note\": \"note\",\n  \"platform\": \"tiktok\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/ad-code-request', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"note\": \"note\",\n  \"platform\": \"tiktok\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/ad-code-request',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"note\": \"note\",\n      \"platform\": \"tiktok\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/ad-code-request\", strings.NewReader(\"{\\n  \\\"note\\\": \\\"note\\\",\\n  \\\"platform\\\": \\\"tiktok\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "get": {
        "operationId": "getVideoAdCodeRequest",
        "summary": "Get / poll the ad code for a video",
        "description": "Returns the latest ad code request for the video. The `code` field is null until the manager submits it (status `in_review`) or it is delivered (status `finalized`).",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Video ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Latest ad code request (or null).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCodeRequestResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Video not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/ad-code-request\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/ad-code-request', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/ad-code-request',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/videos/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/ad-code-request\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/comments": {
      "get": {
        "operationId": "getCommentPulse",
        "summary": "Get comment pulse analytics",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "post",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 40,
              "default": 24
            }
          },
          {
            "name": "postLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 6
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comment pulse analytics.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include this analytics level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics/comments?platform=example&country=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/comments?platform=example&country=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics/comments?platform=example&country=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics/comments?platform=example&country=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/accounts/{id}/comments": {
      "get": {
        "operationId": "listAnalyticsAccountComments",
        "summary": "List comments for an account post",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "trackedPostId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Post comments.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include this analytics level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Account or post not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/comments?trackedPostId=example&postId=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/comments?trackedPostId=example&postId=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/comments?trackedPostId=example&postId=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics/accounts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/comments?trackedPostId=example&postId=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/analytics/posts/{id}/raw": {
      "get": {
        "operationId": "listAnalyticsPostRawSnapshots",
        "summary": "List raw post analytics snapshots",
        "description": "Returns owner-scoped stored raw analytics payloads for a tracked post. Full analytics tier only.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Tracked post ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "bundle_social",
                "apify",
                "manual"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30,
              "default": 5
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Raw post analytics snapshots.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include raw analytics payloads.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Post not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/analytics/posts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/raw?source=example&limit=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/analytics/posts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/raw?source=example&limit=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/analytics/posts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/raw?source=example&limit=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/analytics/posts/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/raw?source=example&limit=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/comments": {
      "get": {
        "operationId": "listCommentTasks",
        "summary": "List comment tasks",
        "tags": [
          "Comments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by one status or a comma-separated list of statuses.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "saved_account_id",
            "in": "query",
            "required": false,
            "description": "Filter by a user-owned saved account ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated comment task list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/comments?page=example&per_page=example\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/comments?page=example&per_page=example', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/comments?page=example&per_page=example',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/comments?page=example&per_page=example\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "post": {
        "operationId": "createCommentTasks",
        "summary": "Create comment tasks",
        "tags": [
          "Comments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCommentTaskRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created comment tasks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid comment task request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/comments\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"saved_account_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\",\n  \"comment_text\": \"comment_text\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/comments', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"saved_account_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\",\n  \"comment_text\": \"comment_text\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/comments',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"saved_account_id\": \"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\",\n      \"comment_text\": \"comment_text\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/comments\", strings.NewReader(\"{\\n  \\\"saved_account_id\\\": \\\"9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\\\",\\n  \\\"comment_text\\\": \\\"comment_text\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/comments/{id}": {
      "get": {
        "operationId": "getCommentTask",
        "summary": "Get a comment task",
        "tags": [
          "Comments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Comment task ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comment task.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Comment task not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      },
      "delete": {
        "operationId": "deleteCommentTask",
        "summary": "Delete a comment task",
        "tags": [
          "Comments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Comment task ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delete result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Comment task not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X DELETE \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c', {\n  method: 'DELETE',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'DELETE',\n    'https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"DELETE\", \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/comments/{id}/approve": {
      "post": {
        "operationId": "approveCommentTask",
        "summary": "Approve a manually confirmed comment task",
        "tags": [
          "Comments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Comment task ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Approved comment task.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Comment task not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Comment task status cannot be approved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/approve\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/approve', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/approve',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/approve\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/comments/{id}/dispute": {
      "post": {
        "operationId": "disputeCommentTask",
        "summary": "Dispute a manually confirmed comment task",
        "tags": [
          "Comments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Comment task ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisputeCommentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Disputed comment task.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid dispute reason.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Comment task not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Comment task status cannot be disputed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present with value true when a mutating request is replayed from a completed Idempotency-Key.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X POST \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/dispute\" \\\n  -H \"X-API-Key: sk_your_key_here\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"reason\": \"Please review this item.\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/dispute', {\n  method: 'POST',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"reason\": \"Please review this item.\"\n})\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'POST',\n    'https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/dispute',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]},\n    json={\n      \"reason\": \"Please review this item.\"\n    }\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"POST\", \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/dispute\", strings.NewReader(\"{\\n  \\\"reason\\\": \\\"Please review this item.\\\"\\n}\"))\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nreq.Header.Set(\"Content-Type\", \"application/json\")\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    },
    "/comments/{id}/verifications": {
      "get": {
        "operationId": "listCommentTaskVerifications",
        "summary": "List comment task verification events",
        "tags": [
          "Comments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Comment task ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verification timeline.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          },
          "404": {
            "description": "Comment task not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-TokPortal-API-Version": {
                "description": "Current TokPortal public API contract version.",
                "schema": {
                  "type": "string",
                  "example": "2026-05-25"
                }
              },
              "X-TokPortal-API-Stability": {
                "description": "Stability channel for the public API contract.",
                "schema": {
                  "type": "string",
                  "example": "stable"
                }
              },
              "X-TokPortal-Request-ID": {
                "description": "Request correlation ID. Echoes a valid X-Request-ID request header or uses a generated req_ identifier.",
                "schema": {
                  "type": "string",
                  "example": "req_0123456789abcdef0123456789abcdef"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum token bucket capacity for the authenticated API key.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Approximate requests remaining for the authenticated API key after this request.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp when the token bucket is expected to be full again.",
                "schema": {
                  "type": "integer",
                  "example": 1779724800
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying after RATE_LIMIT_EXCEEDED. Present on 429 responses.",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -X GET \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/verifications\" \\\n  -H \"X-API-Key: sk_your_key_here\""
          },
          {
            "lang": "JavaScript",
            "label": "Node",
            "source": "const response = await fetch('https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/verifications', {\n  method: 'GET',\n  headers: {\n    'X-API-Key': process.env.TOKPORTAL_API_KEY!,\n  }\n});\nconst data = await response.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.request(\n    'GET',\n    'https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/verifications',\n    headers={\"X-API-Key\": os.environ[\"TOKPORTAL_API_KEY\"]}\n)\nprint(response.json())"
          },
          {
            "lang": "Go",
            "label": "Go",
            "source": "req, _ := http.NewRequest(\"GET\", \"https://app.tokportal.com/api/ext/comments/9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c/verifications\", nil)\nreq.Header.Set(\"X-API-Key\", os.Getenv(\"TOKPORTAL_API_KEY\"))\nresp, err := http.DefaultClient.Do(req)"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "TokPortal API key. New keys use the format sk_ followed by 64 lowercase hex characters, are stored as SHA-256 hashes, are shown once at creation, and should never be sent in query parameters."
      }
    },
    "schemas": {
      "CountryOption": {
        "type": "object",
        "required": [
          "code",
          "name"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "DE"
          },
          "name": {
            "type": "string",
            "example": "Germany"
          }
        }
      },
      "CountriesResponse": {
        "type": "object",
        "required": [
          "data",
          "videos_only_countries"
        ],
        "properties": {
          "data": {
            "type": "array",
            "description": "Countries where TokPortal can provision a new account.",
            "items": {
              "$ref": "#/components/schemas/CountryOption"
            }
          },
          "videos_only_countries": {
            "type": "array",
            "description": "Countries where videos can be ordered for an existing TokPortal account. This can include countries absent from data.",
            "items": {
              "$ref": "#/components/schemas/CountryOption"
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      },
      "MeResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "email",
              "credits",
              "api_key"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "full_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "company_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "website": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "company_niche": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "organic_strategy": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "role": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "credits": {
                "type": "object",
                "required": [
                  "balance"
                ],
                "properties": {
                  "balance": {
                    "type": "number"
                  }
                }
              },
              "subscription": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true
              },
              "api_key": {
                "type": "object",
                "required": [
                  "id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "VerificationCodeResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "account_id",
              "verification_code",
              "source"
            ],
            "properties": {
              "account_id": {
                "type": "string",
                "format": "uuid"
              },
              "verification_code": {
                "type": "string",
                "description": "The 6-digit verification code."
              },
              "source": {
                "type": "string",
                "enum": [
                  "email",
                  "cached"
                ],
                "description": "\"email\" when freshly fetched from the TokMail inbox, \"cached\" when no new code was found and the last known code is returned."
              },
              "note": {
                "type": "string",
                "description": "Only present when source is \"cached\"."
              }
            }
          }
        }
      },
      "AdCodeRequestResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "nullable": true,
            "description": "The latest ad code request for the video, or null if none exists.",
            "properties": {
              "ad_code_request_id": {
                "type": "string",
                "format": "uuid"
              },
              "video_id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "accepted",
                  "in_review",
                  "pending_corrections",
                  "finalized",
                  "cancelled",
                  "expired"
                ],
                "description": "Lifecycle: pending → in_review (manager submitted the code) → finalized (client confirmed). pending_corrections if a redo was requested."
              },
              "platform": {
                "type": "string",
                "enum": [
                  "tiktok",
                  "instagram"
                ]
              },
              "code": {
                "type": "string",
                "nullable": true,
                "description": "The Spark Code. Null until the manager submits it (status in_review) or it is delivered (finalized)."
              },
              "note": {
                "type": "string",
                "nullable": true
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "submitted_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "delivered_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          }
        }
      },
      "AcknowledgeSupportForfeitRequest": {
        "type": "object",
        "description": "Explicit acknowledgment that accessing the account's credentials permanently forfeits TokPortal support.",
        "properties": {
          "acknowledge_support_forfeit": {
            "type": "boolean",
            "description": "Set to true to confirm, on behalf of the account owner: \"I understand that accessing this account's credentials will permanently remove all TokPortal support for this account and that no replacement or refund request will be considered.\" Required (true) on the first credential or verification-code access of an account; omitting it returns HTTP 428 with the disclaimer. Ignored once the account's support is already forfeited."
          }
        },
        "additionalProperties": false
      },
      "RevealCredentialsResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "account_id",
              "credentials"
            ],
            "properties": {
              "account_id": {
                "type": "string",
                "format": "uuid"
              },
              "credentials": {
                "type": "object",
                "required": [
                  "tokmail_email",
                  "password"
                ],
                "properties": {
                  "tokmail_email": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "email"
                  },
                  "password": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "social_credentials": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": true
                  }
                }
              },
              "last_verification_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "notice": {
                "type": "string"
              }
            }
          }
        }
      },
      "UpdateCurrentUserSettingsRequest": {
        "type": "object",
        "properties": {
          "company_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "company_niche": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "organic_strategy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          }
        },
        "minProperties": 1,
        "additionalProperties": false
      },
      "UpdateAccountCommentingProfileRequest": {
        "type": "object",
        "properties": {
          "niche": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "persona": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "goal": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "promotion",
              "awareness",
              "product",
              null
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          },
          "tracked_handles": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 50,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          "daily_tracking_enabled": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "minProperties": 1,
        "additionalProperties": false
      },
      "UpdateCurrentUserSettingsResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "company_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "website": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "company_niche": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "organic_strategy": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "CreateBundleRequest": {
        "type": "object",
        "required": [
          "bundle_type"
        ],
        "properties": {
          "bundle_type": {
            "type": "string",
            "enum": [
              "account_only",
              "account_and_videos",
              "videos_only"
            ]
          },
          "platform": {
            "type": "string",
            "enum": [
              "tiktok",
              "instagram"
            ],
            "default": "tiktok"
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 5,
            "description": "Required unless bundle_type is videos_only."
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "videos_quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 500,
            "default": 0
          },
          "edits_quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 500,
            "default": 0
          },
          "wants_niche_warming": {
            "type": "boolean",
            "default": false,
            "description": "Niche warming (7 credits, review-based). Will be deprecated in favor of advanced warming."
          },
          "wants_deep_warming": {
            "type": "boolean",
            "default": false,
            "description": "DISCONTINUED. New orders are rejected with DEEP_WARMING_DEPRECATED — use wants_advanced_warming instead."
          },
          "wants_advanced_warming": {
            "type": "boolean",
            "default": false,
            "description": "Advanced Niche Warming (recommended): niche-target (search-term) based warming with recorded proof and a data report. 3 credits per target. TikTok and Instagram only. Provide advanced_warming_terms now, or advanced_warming_terms_count to configure the targets later."
          },
          "advanced_warming_terms": {
            "type": "array",
            "maxItems": 30,
            "x-item-count-multiple-of": 3,
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 50
            },
            "description": "3-30 search terms, count must be a multiple of 3. Optional when advanced_warming_terms_count is provided instead."
          },
          "advanced_warming_terms_count": {
            "type": "integer",
            "minimum": 3,
            "maximum": 30,
            "x-value-multiple-of": 3,
            "description": "Number of niche targets to purchase (3-30, multiples of 3; 3 credits each); alternative to advanced_warming_terms — configure the terms later via PUT /bundles/{id}/warming-terms. Unconfigured purchases are auto-cancelled and fully refunded after 14 days."
          },
          "niche_warming_instructions": {
            "type": "string",
            "maxLength": 2000
          },
          "auto_finalize_videos": {
            "type": "boolean",
            "default": true
          },
          "account_id": {
            "type": "string",
            "format": "uuid",
            "description": "Required for videos_only bundles."
          },
          "external_ref": {
            "type": "string",
            "maxLength": 200
          }
        },
        "additionalProperties": false
      },
      "PatchBundleRequest": {
        "type": "object",
        "properties": {
          "auto_finalize_videos": {
            "type": "boolean"
          },
          "external_ref": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          }
        },
        "minProperties": 1,
        "additionalProperties": false
      },
      "CreateBundleResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "credits_charged": {
            "type": "number"
          }
        }
      },
      "CreateBulkBundlesRequest": {
        "type": "object",
        "required": [
          "platforms",
          "country",
          "accounts_count"
        ],
        "properties": {
          "platforms": {
            "type": "array",
            "minItems": 1,
            "maxItems": 3,
            "items": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram"
              ]
            }
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 5
          },
          "accounts_count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "upload_accounts_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 0
          },
          "videos_per_account": {
            "type": "integer",
            "minimum": 0,
            "maximum": 500,
            "default": 0
          },
          "wants_niche_warming": {
            "type": "boolean",
            "default": false,
            "description": "Niche warming (7 credits, review-based). Will be deprecated in favor of advanced warming."
          },
          "wants_deep_warming": {
            "type": "boolean",
            "default": false,
            "description": "DISCONTINUED. New orders are rejected with DEEP_WARMING_DEPRECATED — use wants_advanced_warming instead."
          },
          "wants_advanced_warming": {
            "type": "boolean",
            "default": false,
            "description": "Advanced Niche Warming (recommended): niche-target (search-term) based warming with recorded proof and a data report. 3 credits per target, charged per account. TikTok and Instagram only. Provide advanced_warming_terms now, or advanced_warming_terms_count to configure the targets later."
          },
          "advanced_warming_terms": {
            "type": "array",
            "maxItems": 30,
            "x-item-count-multiple-of": 3,
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 50
            },
            "description": "3-30 search terms, count must be a multiple of 3. Optional when advanced_warming_terms_count is provided instead. The same terms apply to every account of the bulk creation."
          },
          "advanced_warming_terms_count": {
            "type": "integer",
            "minimum": 3,
            "maximum": 30,
            "x-value-multiple-of": 3,
            "description": "Number of niche targets purchased PER ACCOUNT (3-30, multiples of 3; 3 credits each); alternative to advanced_warming_terms — configure each bundle's targets later via PUT /bundles/{id}/warming-terms. Unconfigured purchases are auto-cancelled and fully refunded after 14 days."
          },
          "niche_warming_instructions": {
            "type": "string",
            "maxLength": 2000
          },
          "auto_finalize_videos": {
            "type": "boolean",
            "default": true
          },
          "external_ref": {
            "type": "string",
            "maxLength": 200
          }
        },
        "additionalProperties": false
      },
      "ConfigureAccountRequest": {
        "type": "object",
        "required": [
          "username",
          "visible_name"
        ],
        "properties": {
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 24,
            "pattern": "^[a-zA-Z0-9_.]+$",
            "description": "Requested username. Cannot end with a dot."
          },
          "visible_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30
          },
          "biography": {
            "type": "string",
            "maxLength": 120,
            "description": "120 for Instagram, 80 for other platforms."
          },
          "profile_picture_url": {
            "type": "string",
            "description": "Public image URL or TokPortal storage URL/path."
          },
          "link_in_bio": {
            "type": "string",
            "format": "uri"
          },
          "niche_warming_instructions": {
            "type": "string",
            "maxLength": 2000
          },
          "advanced_warming_terms": {
            "type": "array",
            "maxItems": 30,
            "x-item-count-multiple-of": 3,
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 50
            },
            "description": "Backward-compatible account-configuration field for an Advanced Niche Warming purchase made with advanced_warming_terms_count. Prefer PUT /bundles/{id}/warming-terms, which remains available at any account status. Must contain exactly the purchased number of targets and can only be set once."
          }
        },
        "additionalProperties": false
      },
      "ConfigureVideoRequest": {
        "type": "object",
        "required": [
          "video_type",
          "target_publish_date"
        ],
        "properties": {
          "video_type": {
            "type": "string",
            "enum": [
              "video",
              "carousel",
              "story"
            ]
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2200,
            "description": "Required for 'video' and 'carousel'. Stories have no description."
          },
          "target_publish_date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "YYYY-MM-DD."
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "video_url": {
            "type": "string",
            "format": "uri"
          },
          "carousel_images": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "carousel_title": {
            "type": "string",
            "maxLength": 200
          },
          "story_image_url": {
            "type": "string",
            "format": "uri",
            "description": "Story image (TikTok/Instagram). Provide exactly one of video_url or story_image_url for a story."
          },
          "story_repost_url": {
            "type": "string",
            "format": "uri",
            "description": "Optional. Make the story repost an existing post from the SAME platform (TikTok story → tiktok.com, Instagram story → instagram.com). Costs +1 credit."
          },
          "tiktok_sound_url": {
            "type": "string",
            "format": "uri"
          },
          "volume_original_sound": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 200
          },
          "volume_added_sound": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 200
          },
          "editing_instructions": {
            "type": "string",
            "maxLength": 5000
          },
          "external_ref": {
            "type": "string",
            "maxLength": 200
          },
          "instagram_content_type": {
            "type": "string",
            "enum": [
              "reel",
              "post"
            ]
          },
          "instagram_location": {
            "type": "string",
            "maxLength": 200
          },
          "instagram_collaborators": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "string"
            }
          },
          "instagram_audio_name": {
            "type": "string",
            "maxLength": 200
          },
          "instagram_add_to_story": {
            "type": "boolean"
          },
          "ai_content_disclaimer": {
            "type": "boolean",
            "description": "AI content notice (free). If true, the manager will enable the platform's AI-generated content label when posting."
          },
          "disclose_as_ads": {
            "type": "boolean",
            "description": "Disclose as ad (free). If true, the manager will enable branded-content/paid-partnership disclosure (or add #ad) when posting."
          },
          "instant_repost_as_story": {
            "type": "boolean",
            "description": "Instant repost as story (paid, +1 credit charged once when first enabled, no refunds). Right after posting, the manager reposts this video as a story and provides a screenshot proof. Only for video_type 'video' on TikTok/Instagram bundles. Omit to keep the current value."
          },
          "youtube_title": {
            "type": "string",
            "maxLength": 200
          },
          "youtube_tags": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "string"
            }
          },
          "youtube_category": {
            "type": "string",
            "maxLength": 100
          },
          "youtube_visibility": {
            "type": "string",
            "enum": [
              "public",
              "unlisted",
              "private"
            ]
          },
          "youtube_sound_url": {
            "type": "string",
            "format": "uri"
          },
          "auto_publish": {
            "type": "boolean",
            "default": false
          }
        },
        "additionalProperties": false
      },
      "PatchVideoRequest": {
        "type": "object",
        "properties": {
          "external_ref": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2200
          },
          "target_publish_date": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "target_publish_start_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "target_publish_end_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "minProperties": 1,
        "additionalProperties": false
      },
      "BatchConfigureVideosRequest": {
        "type": "object",
        "required": [
          "videos"
        ],
        "properties": {
          "videos": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "video_type",
                    "target_publish_date"
                  ],
                  "properties": {
                    "video_type": {
                      "type": "string",
                      "enum": [
                        "video",
                        "carousel",
                        "story"
                      ]
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2200,
                      "description": "Required for 'video' and 'carousel'. Stories have no description."
                    },
                    "target_publish_date": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                      "description": "YYYY-MM-DD."
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "video_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "carousel_images": {
                      "type": "array",
                      "minItems": 1,
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "carousel_title": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "story_image_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Story image (TikTok/Instagram). Provide exactly one of video_url or story_image_url for a story."
                    },
                    "story_repost_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Optional. Make the story repost an existing post from the SAME platform (TikTok story → tiktok.com, Instagram story → instagram.com). Costs +1 credit."
                    },
                    "tiktok_sound_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "volume_original_sound": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "maximum": 200
                    },
                    "volume_added_sound": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "maximum": 200
                    },
                    "editing_instructions": {
                      "type": "string",
                      "maxLength": 5000
                    },
                    "external_ref": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "instagram_content_type": {
                      "type": "string",
                      "enum": [
                        "reel",
                        "post"
                      ]
                    },
                    "instagram_location": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "instagram_collaborators": {
                      "type": "array",
                      "maxItems": 5,
                      "items": {
                        "type": "string"
                      }
                    },
                    "instagram_audio_name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "instagram_add_to_story": {
                      "type": "boolean"
                    },
                    "ai_content_disclaimer": {
                      "type": "boolean",
                      "description": "AI content notice (free). If true, the manager will enable the platform's AI-generated content label when posting."
                    },
                    "disclose_as_ads": {
                      "type": "boolean",
                      "description": "Disclose as ad (free). If true, the manager will enable branded-content/paid-partnership disclosure (or add #ad) when posting."
                    },
                    "instant_repost_as_story": {
                      "type": "boolean",
                      "description": "Instant repost as story (paid, +1 credit charged once when first enabled, no refunds). Right after posting, the manager reposts this video as a story and provides a screenshot proof. Only for video_type 'video' on TikTok/Instagram bundles. Omit to keep the current value."
                    },
                    "youtube_title": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "youtube_tags": {
                      "type": "array",
                      "maxItems": 30,
                      "items": {
                        "type": "string"
                      }
                    },
                    "youtube_category": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "youtube_visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "unlisted",
                        "private"
                      ]
                    },
                    "youtube_sound_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "auto_publish": {
                      "type": "boolean",
                      "default": false
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "position"
                  ],
                  "properties": {
                    "position": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                }
              ]
            }
          },
          "auto_publish": {
            "type": "boolean",
            "default": false
          }
        },
        "additionalProperties": false
      },
      "QuantityRequest": {
        "type": "object",
        "required": [
          "quantity"
        ],
        "properties": {
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500
          }
        },
        "additionalProperties": false
      },
      "AccountEditRequest": {
        "type": "object",
        "required": [
          "requested_username",
          "requested_visible_name"
        ],
        "properties": {
          "requested_username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 24
          },
          "requested_visible_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30
          },
          "requested_biography": {
            "type": "string",
            "maxLength": 120,
            "description": "120 for Instagram, 80 for other platforms."
          },
          "requested_profile_picture_url": {
            "type": "string"
          },
          "requested_link_in_bio": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": false
      },
      "AdCodeRequest": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 500,
            "description": "Optional note to your manager (e.g. the campaign this ad code is for)."
          },
          "platform": {
            "type": "string",
            "enum": [
              "tiktok",
              "instagram"
            ],
            "description": "Optional. Defaults to the video's platform. TikTok and Instagram are supported."
          }
        },
        "additionalProperties": false
      },
      "RewarmAccountRequest": {
        "type": "object",
        "required": [
          "search_terms"
        ],
        "properties": {
          "search_terms": {
            "type": "array",
            "minItems": 3,
            "maxItems": 30,
            "x-item-count-multiple-of": 3,
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 50
            },
            "description": "3-30 search terms (count must be a multiple of 3), each 2-50 characters. 3 credits per term. For each term the manager screen-records a session that opens on the account profile, searches the term, watches videos from the results, engages with them (likes/saves) and leaves a comment — every recording is verified before the manager is paid."
          }
        },
        "additionalProperties": false
      },
      "ConfigureWarmingTermsRequest": {
        "type": "object",
        "required": [
          "advanced_warming_terms"
        ],
        "properties": {
          "advanced_warming_terms": {
            "type": "array",
            "minItems": 3,
            "maxItems": 30,
            "x-item-count-multiple-of": 3,
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 50
            },
            "description": "The niche targets for a count-only Advanced Niche Warming purchase. Must contain EXACTLY the purchased number of targets (advanced_warming_terms_count at creation), each 2-50 characters. One-shot: once set they cannot be changed. Works at any account status — the warming session starts immediately when the manager already holds the order."
          }
        },
        "additionalProperties": false
      },
      "GenerateWarmingTermsRequest": {
        "type": "object",
        "required": [
          "text",
          "platform",
          "count"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000,
            "description": "Free-text description of the account's niche/brand (max 1000 characters). Terms are generated in the same language."
          },
          "platform": {
            "type": "string",
            "enum": [
              "tiktok",
              "instagram"
            ],
            "description": "Platform the terms will be searched on."
          },
          "count": {
            "type": "integer",
            "minimum": 3,
            "maximum": 30,
            "x-value-multiple-of": 3,
            "description": "Desired number of terms: 3-30, must be a multiple of 3."
          }
        },
        "additionalProperties": false
      },
      "WarmingSessionResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "session_id",
              "status",
              "terms_total",
              "tasks"
            ],
            "properties": {
              "session_id": {
                "type": "string",
                "format": "uuid"
              },
              "account_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "Saved account being warmed (null for bundle-sourced sessions before delivery)."
              },
              "bundle_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "order_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "source": {
                "type": "string",
                "enum": [
                  "bundle",
                  "rewarm"
                ],
                "description": "'bundle' = ordered with wants_advanced_warming at bundle creation; 'rewarm' = ordered later via POST /accounts/{id}/rewarm."
              },
              "platform": {
                "type": "string",
                "enum": [
                  "tiktok",
                  "instagram"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "in_progress",
                  "completed",
                  "expired",
                  "cancelled"
                ]
              },
              "search_terms": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The niche targets. EMPTY while a count-only purchase (advanced_warming_terms_count) has not been configured yet via PUT /bundles/{id}/warming-terms."
              },
              "terms_total": {
                "type": "integer"
              },
              "terms_verified": {
                "type": "integer"
              },
              "credits_cost": {
                "type": "integer"
              },
              "refunded_credits": {
                "type": "integer",
                "description": "Credits refunded — per-term for targets that expired unfinished, or the full purchase when a count-only session was never configured within 14 days (session becomes 'cancelled')."
              },
              "started_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "report": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true,
                "description": "Aggregated client report (per-term details + engagement totals). Null until the session completes."
              },
              "tasks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "term",
                    "day_index",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "term": {
                      "type": "string"
                    },
                    "day_index": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 3,
                      "description": "Warming day (1-3) the term is dispatched to."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "submitted",
                        "verified",
                        "rejected",
                        "expired"
                      ]
                    },
                    "verified_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "report": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true,
                      "description": "Client-facing per-term report (videos watched, likes, saves, comment, sample content). Null until verified."
                    },
                    "proof_video_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  }
                }
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "AccountCorrectionsRequest": {
        "type": "object",
        "required": [
          "comment"
        ],
        "properties": {
          "comment": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "fields": {
            "type": "object",
            "properties": {
              "username": {
                "type": "boolean"
              },
              "visible_name": {
                "type": "boolean"
              },
              "biography": {
                "type": "boolean"
              },
              "profile_picture": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "VideoCorrectionsRequest": {
        "type": "object",
        "required": [
          "comment"
        ],
        "properties": {
          "comment": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "fields": {
            "type": "object",
            "properties": {
              "video_content": {
                "type": "boolean"
              },
              "description": {
                "type": "boolean"
              },
              "video_editing": {
                "type": "boolean"
              },
              "sound": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "FixVideoDownloadRequest": {
        "type": "object",
        "properties": {
          "video_url": {
            "type": "string",
            "format": "uri"
          },
          "carousel_images": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "anyOf": [
          {
            "required": [
              "video_url"
            ]
          },
          {
            "required": [
              "carousel_images"
            ]
          }
        ],
        "additionalProperties": false
      },
      "RefreshAnalyticsRequest": {
        "type": "object",
        "properties": {
          "force": {
            "type": "boolean",
            "default": false
          },
          "includePosts": {
            "type": "boolean",
            "default": true
          },
          "includeComments": {
            "type": "boolean",
            "default": false
          },
          "forcePosts": {
            "type": "boolean",
            "default": false
          },
          "bootstrapPosts": {
            "type": "boolean",
            "default": false
          },
          "postLimit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60,
            "default": 20
          }
        },
        "additionalProperties": false
      },
      "CreateCommentTaskRequest": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "saved_account_id",
              "comment_text"
            ],
            "properties": {
              "saved_account_id": {
                "type": "string",
                "format": "uuid"
              },
              "target_type": {
                "type": "string",
                "enum": [
                  "video",
                  "comment"
                ],
                "description": "Target type. 'video' (default) posts a comment under a video; 'comment' replies to a specific comment (TikTok only)."
              },
              "target_video_url": {
                "type": "string",
                "minLength": 1,
                "description": "Required when target_type is 'video' (or omitted). TikTok/Instagram video URL."
              },
              "target_comment_url": {
                "type": "string",
                "minLength": 1,
                "description": "Required when target_type is 'comment'. TikTok comment deep-link (Share comment → Copy link); short or full form."
              },
              "comment_text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 10000
              },
              "brief_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "tasks"
            ],
            "properties": {
              "tasks": {
                "type": "array",
                "minItems": 1,
                "maxItems": 200,
                "items": {
                  "type": "object",
                  "required": [
                    "saved_account_id",
                    "comment_text"
                  ],
                  "properties": {
                    "saved_account_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "target_type": {
                      "type": "string",
                      "enum": [
                        "video",
                        "comment"
                      ],
                      "description": "Target type. 'video' (default) posts a comment under a video; 'comment' replies to a specific comment (TikTok only)."
                    },
                    "target_video_url": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Required when target_type is 'video' (or omitted). TikTok/Instagram video URL."
                    },
                    "target_comment_url": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Required when target_type is 'comment'. TikTok comment deep-link (Share comment → Copy link); short or full form."
                    },
                    "comment_text": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 10000
                    },
                    "brief_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid"
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "DisputeCommentRequest": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 3,
            "maxLength": 500
          }
        },
        "additionalProperties": false
      },
      "CreateWebhookEndpointRequest": {
        "type": "object",
        "required": [
          "url",
          "events"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "string",
              "enum": [
                "webhook.test",
                "bundle.created",
                "bundle.published",
                "bundle.cancelled",
                "account.configured",
                "account.published",
                "account.in_review",
                "account.pending_corrections",
                "account.finalized",
                "account.remade",
                "account.banned",
                "account.ban_appeal.resolved",
                "video.configured",
                "video.in_review",
                "video.published",
                "video.pending_corrections",
                "video.finalized",
                "warming.session_started",
                "warming.term_verified",
                "warming.session_completed"
              ]
            }
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        },
        "additionalProperties": false
      },
      "UpdateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "string",
              "enum": [
                "webhook.test",
                "bundle.created",
                "bundle.published",
                "bundle.cancelled",
                "account.configured",
                "account.published",
                "account.in_review",
                "account.pending_corrections",
                "account.finalized",
                "account.remade",
                "account.banned",
                "account.ban_appeal.resolved",
                "video.configured",
                "video.in_review",
                "video.published",
                "video.pending_corrections",
                "video.finalized",
                "warming.session_started",
                "warming.term_verified",
                "warming.session_completed"
              ]
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "minProperties": 1,
        "additionalProperties": false
      },
      "WebhookEventsResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "events",
              "envelope",
              "delivery",
              "signature"
            ],
            "properties": {
              "events": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "type",
                    "category",
                    "availability",
                    "description",
                    "when",
                    "payload_schema",
                    "example_payload"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "webhook.test",
                        "bundle.created",
                        "bundle.published",
                        "bundle.cancelled",
                        "account.configured",
                        "account.published",
                        "account.in_review",
                        "account.pending_corrections",
                        "account.finalized",
                        "account.remade",
                        "account.banned",
                        "account.ban_appeal.resolved",
                        "video.configured",
                        "video.in_review",
                        "video.published",
                        "video.pending_corrections",
                        "video.finalized",
                        "warming.session_started",
                        "warming.term_verified",
                        "warming.session_completed"
                      ]
                    },
                    "category": {
                      "type": "string",
                      "enum": [
                        "webhook",
                        "bundle",
                        "account",
                        "video",
                        "comment",
                        "warming"
                      ]
                    },
                    "availability": {
                      "type": "string",
                      "enum": [
                        "emitted",
                        "subscribable"
                      ]
                    },
                    "description": {
                      "type": "string"
                    },
                    "when": {
                      "type": "string"
                    },
                    "payload_schema": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "example_payload": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              },
              "envelope": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "api_version",
                  "created_at",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "webhook.test",
                      "bundle.created",
                      "bundle.published",
                      "bundle.cancelled",
                      "account.configured",
                      "account.published",
                      "account.in_review",
                      "account.pending_corrections",
                      "account.finalized",
                      "account.remade",
                      "account.banned",
                      "account.ban_appeal.resolved",
                      "video.configured",
                      "video.in_review",
                      "video.published",
                      "video.pending_corrections",
                      "video.finalized",
                      "warming.session_started",
                      "warming.term_verified",
                      "warming.session_completed"
                    ]
                  },
                  "api_version": {
                    "type": "string",
                    "example": "2026-05-25"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "delivery": {
                "type": "object",
                "required": [
                  "method",
                  "content_type",
                  "timeout_ms",
                  "user_agent",
                  "headers"
                ],
                "properties": {
                  "method": {
                    "type": "string",
                    "enum": [
                      "POST"
                    ]
                  },
                  "content_type": {
                    "type": "string",
                    "enum": [
                      "application/json"
                    ]
                  },
                  "timeout_ms": {
                    "type": "integer",
                    "example": 8000
                  },
                  "user_agent": {
                    "type": "string",
                    "example": "TokPortal-Webhooks/1.0"
                  },
                  "headers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "signature": {
                "type": "object",
                "required": [
                  "header",
                  "scheme",
                  "signed_payload",
                  "algorithm",
                  "default_tolerance_seconds"
                ],
                "properties": {
                  "header": {
                    "type": "string",
                    "enum": [
                      "TokPortal-Signature"
                    ]
                  },
                  "scheme": {
                    "type": "string",
                    "example": "t={unix_timestamp},v1={hmac_sha256}"
                  },
                  "signed_payload": {
                    "type": "string",
                    "example": "{timestamp}.{raw_body}"
                  },
                  "algorithm": {
                    "type": "string",
                    "enum": [
                      "HMAC-SHA256"
                    ]
                  },
                  "default_tolerance_seconds": {
                    "type": "integer",
                    "example": 300
                  }
                }
              }
            },
            "example": {
              "events": [
                {
                  "type": "webhook.test",
                  "category": "webhook",
                  "availability": "emitted",
                  "description": "A signed test event sent on demand to validate an endpoint.",
                  "when": "Sent when you call POST /webhooks/{id}/test.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "webhook_endpoint_id",
                      "message"
                    ],
                    "properties": {
                      "webhook_endpoint_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "message": {
                        "type": "string"
                      }
                    }
                  },
                  "example_payload": {
                    "webhook_endpoint_id": "33333333-4444-4555-8666-777777777777",
                    "message": "TokPortal webhook test event"
                  }
                },
                {
                  "type": "bundle.created",
                  "category": "bundle",
                  "availability": "emitted",
                  "description": "A bundle was created through the public API.",
                  "when": "Emitted after a successful bundle creation.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "bundle_id"
                    ],
                    "properties": {
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "external_ref": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "platform": {
                        "type": "string"
                      },
                      "bundle_type": {
                        "type": "string"
                      }
                    }
                  },
                  "example_payload": {
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "external_ref": "partner-order-123",
                    "status": "pending_setup",
                    "platform": "tiktok",
                    "bundle_type": "account_and_videos"
                  }
                },
                {
                  "type": "bundle.published",
                  "category": "bundle",
                  "availability": "emitted",
                  "description": "A bundle was published.",
                  "when": "Emitted after a bundle publish request succeeds.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "bundle_id"
                    ],
                    "properties": {
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "external_ref": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "platform": {
                        "type": "string"
                      },
                      "bundle_type": {
                        "type": "string"
                      }
                    }
                  },
                  "example_payload": {
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "external_ref": "partner-order-123",
                    "status": "published",
                    "platform": "tiktok",
                    "bundle_type": "account_and_videos"
                  }
                },
                {
                  "type": "bundle.cancelled",
                  "category": "bundle",
                  "availability": "emitted",
                  "description": "A bundle was cancelled — no further videos will be posted on it.",
                  "when": "Emitted when a bundle is cancelled: the bundle's account was banned (validated ban report — account_banned=true, an account.banned event fires alongside), or a ban-check was accepted with the cancel & refund resolution, or staff cancelled the bundle manually. Publishing to a cancelled bundle returns 409 BUNDLE_INVALID_STATUS.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "bundle_id",
                      "reason",
                      "cancelled_at"
                    ],
                    "properties": {
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "external_ref": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "cancelled_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "account_banned": {
                        "type": "boolean",
                        "description": "True when the cancellation was caused by the bundle's account being banned — an account.banned event fires alongside."
                      },
                      "saved_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "example_payload": {
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "external_ref": "partner-order-123",
                    "platform": "tiktok",
                    "reason": "Account banned: Community guidelines violation",
                    "cancelled_at": "2026-07-06T19:13:43Z",
                    "account_banned": true,
                    "saved_account_id": "7c9e0f1a-2b3c-4d5e-8f6a-1b2c3d4e5f60",
                    "username": "launchprofile"
                  }
                },
                {
                  "type": "account.configured",
                  "category": "account",
                  "availability": "emitted",
                  "description": "An account listing was configured.",
                  "when": "Emitted when PUT /bundles/{id}/account moves an account listing to configured.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "account_id",
                      "bundle_id",
                      "status"
                    ],
                    "properties": {
                      "account_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "saved_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "example_payload": {
                    "account_id": "0d1e2f3a-4b5c-6789-8abc-def012345678",
                    "saved_account_id": null,
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "username": "launchprofile",
                    "platform": "tiktok",
                    "status": "configured",
                    "previous_status": "pending"
                  }
                },
                {
                  "type": "account.in_review",
                  "category": "account",
                  "availability": "emitted",
                  "description": "An account listing entered customer review.",
                  "when": "Emitted when a Bundle Social account handoff moves an accepted account listing to in_review.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "account_id",
                      "bundle_id",
                      "status"
                    ],
                    "properties": {
                      "account_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "saved_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "example_payload": {
                    "account_id": "0d1e2f3a-4b5c-6789-8abc-def012345678",
                    "saved_account_id": "7c9e0f1a-2b3c-4d5e-8f6a-1b2c3d4e5f60",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "username": "launchprofile",
                    "platform": "tiktok",
                    "status": "in_review",
                    "previous_status": "accepted"
                  }
                },
                {
                  "type": "account.published",
                  "category": "account",
                  "availability": "emitted",
                  "description": "An account listing was published to an active bundle.",
                  "when": "Emitted when POST /bundles/{id}/publish moves a configured account listing to published.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "account_id",
                      "bundle_id",
                      "status"
                    ],
                    "properties": {
                      "account_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "saved_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "example_payload": {
                    "account_id": "0d1e2f3a-4b5c-6789-8abc-def012345678",
                    "saved_account_id": null,
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "username": "launchprofile",
                    "platform": "tiktok",
                    "status": "published",
                    "previous_status": "configured"
                  }
                },
                {
                  "type": "account.pending_corrections",
                  "category": "account",
                  "availability": "emitted",
                  "description": "Corrections were requested for an account listing.",
                  "when": "Emitted after POST /bundles/{id}/account/corrections moves an account listing from in_review to pending_corrections.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "account_id",
                      "bundle_id",
                      "status"
                    ],
                    "properties": {
                      "account_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "saved_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "example_payload": {
                    "account_id": "0d1e2f3a-4b5c-6789-8abc-def012345678",
                    "saved_account_id": "7c9e0f1a-2b3c-4d5e-8f6a-1b2c3d4e5f60",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "username": "launchprofile",
                    "platform": "tiktok",
                    "status": "pending_corrections",
                    "previous_status": "in_review"
                  }
                },
                {
                  "type": "account.finalized",
                  "category": "account",
                  "availability": "emitted",
                  "description": "An account listing was approved and finalized.",
                  "when": "Emitted after POST /bundles/{id}/account/finalize succeeds.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "account_id",
                      "bundle_id",
                      "status"
                    ],
                    "properties": {
                      "account_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "saved_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "example_payload": {
                    "account_id": "0d1e2f3a-4b5c-6789-8abc-def012345678",
                    "saved_account_id": "7c9e0f1a-2b3c-4d5e-8f6a-1b2c3d4e5f60",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "username": "launchprofile",
                    "platform": "tiktok",
                    "status": "finalized",
                    "previous_status": "in_review"
                  }
                },
                {
                  "type": "account.remade",
                  "category": "account",
                  "availability": "emitted",
                  "description": "An account was remade after the previous one was banned or lost.",
                  "when": "Emitted when a bundle/account is remade. The previous saved account is removed and the bundle is rebuilt in place under the SAME bundle_id (use it, or your external_ref, as the stable anchor). The rebuilt account is created later by the manager and surfaces through subsequent account.* events on the same bundle_id.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "bundle_id",
                      "remade_count"
                    ],
                    "properties": {
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "external_ref": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "old_username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "new_username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "old_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "mode": {
                        "type": "string"
                      },
                      "remade_count": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "remade_at": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time"
                      }
                    }
                  },
                  "example_payload": {
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "external_ref": "partner-order-123",
                    "platform": "tiktok",
                    "old_username": "launchprofile",
                    "new_username": "launchprofile_",
                    "old_account_id": "0d1e2f3a-4b5c-6789-8abc-def012345678",
                    "reason": "account banned/not found",
                    "mode": "republish",
                    "remade_count": 1,
                    "remade_at": "2026-06-09T00:36:24Z"
                  }
                },
                {
                  "type": "account.banned",
                  "category": "account",
                  "availability": "emitted",
                  "description": "An account managed for one of your bundles was banned by the platform.",
                  "when": "Emitted when the manager reports a ban and no appeal was available, or when the platform refused the ban appeal. The saved account is marked banned (banned_at/banned_reason) but stays visible. Staff reviews every ban report.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "bundle_id",
                      "appeal_status"
                    ],
                    "properties": {
                      "bundle_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "saved_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "appeal_status": {
                        "type": "string",
                        "enum": [
                          "appeal_refused",
                          "no_appeal_banned"
                        ]
                      },
                      "banned_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  },
                  "example_payload": {
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "saved_account_id": "7c9e0f1a-2b3c-4d5e-8f6a-1b2c3d4e5f60",
                    "username": "launchprofile",
                    "platform": "tiktok",
                    "reason": "Community guidelines violation notice shown in-app",
                    "appeal_status": "appeal_refused",
                    "banned_at": "2026-07-03T10:15:00Z"
                  }
                },
                {
                  "type": "account.ban_appeal.resolved",
                  "category": "account",
                  "availability": "emitted",
                  "description": "A platform ban appeal filed by the manager reached a final decision.",
                  "when": "Emitted when the manager reports the platform's answer to a ban appeal: resolution 'appeal_accepted' (account survived, nothing else changes) or 'appeal_refused' (the account is banned — an account.banned event fires alongside).",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "appeal_id",
                      "resolution"
                    ],
                    "properties": {
                      "appeal_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "saved_account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "username": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform": {
                        "type": "string"
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "appeal_accepted",
                          "appeal_refused"
                        ]
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "decided_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  },
                  "example_payload": {
                    "appeal_id": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "saved_account_id": "7c9e0f1a-2b3c-4d5e-8f6a-1b2c3d4e5f60",
                    "username": "launchprofile",
                    "platform": "tiktok",
                    "resolution": "appeal_refused",
                    "reason": "Community guidelines violation notice shown in-app",
                    "decided_at": "2026-07-03T10:15:00Z"
                  }
                },
                {
                  "type": "video.configured",
                  "category": "video",
                  "availability": "emitted",
                  "description": "A video listing was configured or unscheduled back to configured.",
                  "when": "Emitted when a video configuration, CSV import, batch configuration, or unschedule action moves a video listing to configured.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "video_id",
                      "bundle_id",
                      "position",
                      "status"
                    ],
                    "properties": {
                      "video_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "position": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform_url": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uri"
                      }
                    }
                  },
                  "example_payload": {
                    "video_id": "11111111-2222-4333-8444-555555555555",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "position": 1,
                    "status": "configured",
                    "previous_status": "pending",
                    "platform_url": null
                  }
                },
                {
                  "type": "video.in_review",
                  "category": "video",
                  "availability": "emitted",
                  "description": "A video listing entered customer review.",
                  "when": "Emitted when a manager submits a posted video URL and the video listing moves to in_review.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "video_id",
                      "bundle_id",
                      "position",
                      "status"
                    ],
                    "properties": {
                      "video_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "position": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform_url": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uri"
                      }
                    }
                  },
                  "example_payload": {
                    "video_id": "11111111-2222-4333-8444-555555555555",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "position": 1,
                    "status": "in_review",
                    "previous_status": "configured",
                    "platform_url": null
                  }
                },
                {
                  "type": "video.published",
                  "category": "video",
                  "availability": "emitted",
                  "description": "A video was published to its destination platform.",
                  "when": "Emitted after POST /bundles/{id}/videos/{position}/publish succeeds.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "video_id",
                      "bundle_id",
                      "position",
                      "status"
                    ],
                    "properties": {
                      "video_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "position": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform_url": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uri"
                      }
                    }
                  },
                  "example_payload": {
                    "video_id": "11111111-2222-4333-8444-555555555555",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "position": 1,
                    "status": "published",
                    "previous_status": "in_review",
                    "platform_url": "https://www.tiktok.com/@launchprofile/video/123"
                  }
                },
                {
                  "type": "video.pending_corrections",
                  "category": "video",
                  "availability": "emitted",
                  "description": "Corrections were requested for a video listing.",
                  "when": "Emitted after POST /bundles/{id}/videos/{position}/corrections moves a video listing from in_review to pending_corrections.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "video_id",
                      "bundle_id",
                      "position",
                      "status"
                    ],
                    "properties": {
                      "video_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "position": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform_url": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uri"
                      }
                    }
                  },
                  "example_payload": {
                    "video_id": "11111111-2222-4333-8444-555555555555",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "position": 1,
                    "status": "pending_corrections",
                    "previous_status": "in_review",
                    "platform_url": "https://www.tiktok.com/@launchprofile/video/123"
                  }
                },
                {
                  "type": "video.finalized",
                  "category": "video",
                  "availability": "emitted",
                  "description": "A video passed final review.",
                  "when": "Emitted after POST /bundles/{id}/videos/{position}/finalize succeeds.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "video_id",
                      "bundle_id",
                      "position",
                      "status"
                    ],
                    "properties": {
                      "video_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "bundle_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "position": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "status": {
                        "type": "string"
                      },
                      "previous_status": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "platform_url": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uri"
                      }
                    }
                  },
                  "example_payload": {
                    "video_id": "11111111-2222-4333-8444-555555555555",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "position": 1,
                    "status": "finalized",
                    "previous_status": "in_review",
                    "platform_url": "https://www.tiktok.com/@launchprofile/video/123"
                  }
                },
                {
                  "type": "warming.session_started",
                  "category": "warming",
                  "availability": "emitted",
                  "description": "An advanced warming session started on one of your accounts.",
                  "when": "Emitted when POST /accounts/{id}/rewarm creates a session (it starts immediately), and when configuring the niche targets of a count-only purchase (PUT /bundles/{id}/account with advanced_warming_terms) starts the session because the account/order is already active. Bundle-sourced sessions whose targets were set at creation start via an internal transition when the manager begins working on the account and do NOT emit this event — track them through GET /warming-sessions/{id} or GET /accounts/{id}/warming-sessions instead.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "session_id",
                      "terms_total"
                    ],
                    "properties": {
                      "session_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "account_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid",
                        "description": "Saved account the session warms."
                      },
                      "bundle_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "order_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "bundle",
                          "rewarm"
                        ]
                      },
                      "platform": {
                        "type": "string",
                        "enum": [
                          "tiktok",
                          "instagram"
                        ]
                      },
                      "terms_total": {
                        "type": "integer",
                        "minimum": 3,
                        "maximum": 30
                      },
                      "search_terms": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "credits_cost": {
                        "type": "integer"
                      },
                      "started_at": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time"
                      }
                    }
                  },
                  "example_payload": {
                    "session_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                    "account_id": "7c9e0f1a-2b3c-4d5e-8f6a-1b2c3d4e5f60",
                    "bundle_id": "9f3a7b2e-1c4d-4e8f-a5b6-7d9e0f1a2b3c",
                    "order_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
                    "source": "rewarm",
                    "platform": "tiktok",
                    "terms_total": 6,
                    "search_terms": [
                      "healthy meal prep",
                      "high protein recipes",
                      "meal prep containers",
                      "quick healthy dinner",
                      "macro friendly meals",
                      "budget meal prep"
                    ],
                    "credits_cost": 18,
                    "started_at": "2026-07-10T12:00:00Z"
                  }
                },
                {
                  "type": "warming.term_verified",
                  "category": "warming",
                  "availability": "emitted",
                  "description": "One advanced-warming search term was completed and its screen recording passed verification.",
                  "when": "Emitted after the manager's recording for a term is verified. The payload includes the client-facing per-term report (videos watched, likes, saves, comment, sample content, proof video link).",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "session_id",
                      "task_id",
                      "term",
                      "report"
                    ],
                    "properties": {
                      "session_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "task_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "term": {
                        "type": "string"
                      },
                      "report": {
                        "type": "object",
                        "description": "Client-facing per-term warming report, built after the term's screen recording is verified.",
                        "required": [
                          "term",
                          "day_index",
                          "verified_at"
                        ],
                        "properties": {
                          "term": {
                            "type": "string"
                          },
                          "day_index": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3
                          },
                          "verified_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "videos_watched": {
                            "type": "integer"
                          },
                          "likes": {
                            "type": "integer"
                          },
                          "saves": {
                            "type": "integer"
                          },
                          "comments": {
                            "type": "integer"
                          },
                          "keywords_seen": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "sample_videos": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "description": {
                                  "type": "string"
                                },
                                "creator": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "proof_video_url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uri"
                          },
                          "summary": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "example_payload": {
                    "session_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                    "task_id": "0f1e2d3c-4b5a-4697-8877-665544332211",
                    "term": "healthy meal prep",
                    "report": {
                      "term": "healthy meal prep",
                      "day_index": 1,
                      "verified_at": "2026-07-10T14:05:00Z",
                      "videos_watched": 15,
                      "likes": 5,
                      "saves": 5,
                      "comments": 1,
                      "keywords_seen": [
                        "meal prep",
                        "high protein",
                        "recipes"
                      ],
                      "sample_videos": [
                        {
                          "description": "5 high-protein lunches for the week",
                          "creator": "@prepqueen"
                        }
                      ],
                      "proof_video_url": "https://media.tokportal.com/warming/session/task/recording.mp4",
                      "summary": "Searched \"healthy meal prep\" and engaged with the top results — watched the videos through, liked and saved several, and left a comment."
                    }
                  }
                },
                {
                  "type": "warming.session_completed",
                  "category": "warming",
                  "availability": "emitted",
                  "description": "An advanced warming session finished — every search term was verified.",
                  "when": "Emitted when the last term of a session is verified. The payload includes the aggregated session report with per-term details and engagement totals.",
                  "payload_schema": {
                    "type": "object",
                    "required": [
                      "session_id",
                      "report"
                    ],
                    "properties": {
                      "session_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "report": {
                        "type": "object",
                        "description": "Aggregated client-facing report for the whole warming session, built when the session completes.",
                        "required": [
                          "terms_total",
                          "terms_verified",
                          "totals"
                        ],
                        "properties": {
                          "terms_total": {
                            "type": "integer"
                          },
                          "terms_verified": {
                            "type": "integer"
                          },
                          "terms_expired": {
                            "type": "integer"
                          },
                          "totals": {
                            "type": "object",
                            "properties": {
                              "videos_watched": {
                                "type": "integer"
                              },
                              "likes": {
                                "type": "integer"
                              },
                              "saves": {
                                "type": "integer"
                              },
                              "comments": {
                                "type": "integer"
                              }
                            }
                          },
                          "terms": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "description": "Client-facing per-term warming report, built after the term's screen recording is verified.",
                              "required": [
                                "term",
                                "day_index",
                                "verified_at"
                              ],
                              "properties": {
                                "term": {
                                  "type": "string"
                                },
                                "day_index": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3
                                },
                                "verified_at": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "videos_watched": {
                                  "type": "integer"
                                },
                                "likes": {
                                  "type": "integer"
                                },
                                "saves": {
                                  "type": "integer"
                                },
                                "comments": {
                                  "type": "integer"
                                },
                                "keywords_seen": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "sample_videos": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "description": {
                                        "type": "string"
                                      },
                                      "creator": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                },
                                "proof_video_url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "format": "uri"
                                },
                                "summary": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "started_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "summary": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "example_payload": {
                    "session_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                    "report": {
                      "terms_total": 6,
                      "terms_verified": 6,
                      "terms_expired": 0,
                      "totals": {
                        "videos_watched": 91,
                        "likes": 31,
                        "saves": 30,
                        "comments": 6
                      },
                      "terms": [
                        {
                          "term": "healthy meal prep",
                          "day_index": 1,
                          "verified_at": "2026-07-10T14:05:00Z",
                          "videos_watched": 15,
                          "likes": 5,
                          "saves": 5,
                          "comments": 1,
                          "keywords_seen": [
                            "meal prep",
                            "high protein",
                            "recipes"
                          ],
                          "sample_videos": [
                            {
                              "description": "5 high-protein lunches for the week",
                              "creator": "@prepqueen"
                            }
                          ],
                          "proof_video_url": "https://media.tokportal.com/warming/session/task/recording.mp4",
                          "summary": "Searched \"healthy meal prep\" and engaged with the top results — watched the videos through, liked and saved several, and left a comment."
                        }
                      ],
                      "started_at": "2026-07-10T12:00:00Z",
                      "completed_at": "2026-07-13T09:30:00Z",
                      "summary": "Warmed the account over 3 days across 6 search terms: 91 videos watched, 31 likes, 30 saves, and 6 comments posted."
                    }
                  }
                }
              ],
              "envelope": {
                "id": "evt_0123456789abcdef0123456789abcdef",
                "type": "bundle.published",
                "api_version": "2026-05-25",
                "created_at": "2026-06-01T12:00:00.000Z",
                "data": {}
              },
              "delivery": {
                "method": "POST",
                "content_type": "application/json",
                "timeout_ms": 8000,
                "user_agent": "TokPortal-Webhooks/1.0",
                "headers": [
                  "TokPortal-Event-Id",
                  "TokPortal-Event-Type",
                  "TokPortal-Signature"
                ]
              },
              "signature": {
                "header": "TokPortal-Signature",
                "scheme": "t={unix_timestamp},v1={hmac_sha256}",
                "signed_payload": "{timestamp}.{raw_body}",
                "algorithm": "HMAC-SHA256",
                "default_tolerance_seconds": 300
              }
            }
          }
        }
      },
      "UploadVideoRequest": {
        "type": "object",
        "required": [
          "filename",
          "bundle_id"
        ],
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "content_type": {
            "type": "string",
            "default": "video/mp4"
          },
          "bundle_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "UploadImageRequest": {
        "type": "object",
        "required": [
          "filename",
          "content_type",
          "bundle_id"
        ],
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "content_type": {
            "type": "string",
            "pattern": "^image/(jpeg|jpg|png|webp|gif)$",
            "description": "Allowed image MIME types: image/jpeg, image/jpg, image/png, image/webp, image/gif."
          },
          "bundle_id": {
            "type": "string",
            "format": "uuid"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "carousel",
              "profile_picture"
            ],
            "default": "carousel"
          }
        },
        "additionalProperties": false
      },
      "UploadImageFromUrlRequest": {
        "type": "object",
        "required": [
          "url",
          "bundle_id"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public direct image URL."
          },
          "bundle_id": {
            "type": "string",
            "format": "uuid"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "carousel",
              "profile_picture"
            ],
            "default": "carousel"
          }
        },
        "additionalProperties": false
      },
      "CreateAnalyticsReportRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "template": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "brandName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "brandAccent": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "workspaceId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram"
              ]
            }
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 5
            }
          },
          "query": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "x-tokportal": {
    "schemaStatus": "partial-foundation",
    "canonicalBaseUrl": "https://app.tokportal.com/api/ext",
    "intendedConsumers": [
      "docs",
      "typescript-sdk",
      "python-sdk",
      "go-sdk",
      "cli",
      "mcp"
    ]
  }
}
