{
  "openapi": "3.1.0",
  "info": {
    "title": "TrendGuru API",
    "version": "2026-09-05",
    "summary": "Publish and schedule posts to social networks, read analytics and trends, run Studio.",
    "description": "JSON over HTTPS. Send the API key as `Authorization: Bearer tg_live_...` (or `tg_test_...`). Every object carries `object` and `id`; lists are `{ object: \"list\", data, hasMore, nextCursor }` and page with `?cursor=`. Timestamps are ISO 8601 in UTC. Errors share one shape, see the Error schema. A key reaches the operations listed here; team, billing and key management are dashboard-only and answer a key with 403 session_required. One credit is taken per post target when it is sent.",
    "contact": {
      "name": "TrendGuru",
      "url": "https://trend.guru/docs",
      "email": "info@trend.guru"
    },
    "termsOfService": "https://trend.guru/terms/"
  },
  "servers": [
    {
      "url": "https://trend.guru/api/v1"
    }
  ],
  "externalDocs": {
    "description": "API reference with a quickstart",
    "url": "https://trend.guru/docs"
  },
  "tags": [
    {
      "name": "Identity",
      "description": "Who the key is, which scopes exist, the credit balance."
    },
    {
      "name": "Profiles",
      "description": "A profile groups one account per network, usually one brand or client."
    },
    {
      "name": "Connections",
      "description": "Connect social accounts through each network's own sign-in."
    },
    {
      "name": "Accounts",
      "description": "Connected social accounts."
    },
    {
      "name": "Posts",
      "description": "Create, schedule, validate, retry and delete posts."
    },
    {
      "name": "Media",
      "description": "Upload files to use in posts."
    },
    {
      "name": "Webhooks",
      "description": "Subscribe an https endpoint to events."
    },
    {
      "name": "Analytics",
      "description": "Post and account metrics."
    },
    {
      "name": "Logs",
      "description": "API requests and publishing attempts of the last 30 days."
    },
    {
      "name": "Trends",
      "description": "Trend radar for TikTok and YouTube Shorts. Paid plans only: every call answers 402 plan_required on Free."
    },
    {
      "name": "Studio",
      "description": "AI content runs, brand, rubrics (Autopilot), Sources and Feeds. Paid plans only."
    },
    {
      "name": "Generation",
      "description": "Direct AI generation of text, images, video and transcripts. Generating needs a paid plan; the catalog is open to every plan."
    },
    {
      "name": "Render",
      "description": "Render a video from a TrendGuru template. Rendering needs a paid plan."
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "getMe",
        "tags": [
          "Identity"
        ],
        "summary": "Who is calling",
        "description": "Returns the user, the workspace and the scopes of the key. Works with any key.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api-keys/scopes": {
      "get": {
        "operationId": "listScopes",
        "tags": [
          "Identity"
        ],
        "summary": "List scopes and presets",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScopeCatalog"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/billing/usage": {
      "get": {
        "operationId": "getUsage",
        "tags": [
          "Identity"
        ],
        "summary": "Credit balance and prices",
        "description": "Available credits, what a post costs, plans and packs. Works with any key.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/platforms": {
      "get": {
        "operationId": "listPlatforms",
        "tags": [
          "Connections"
        ],
        "summary": "List networks",
        "description": "Public: no key needed. Says which networks this server can connect and which are open on paid plans only.",
        "security": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Platform"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/connections": {
      "post": {
        "operationId": "createConnection",
        "tags": [
          "Connections"
        ],
        "summary": "Start connecting an account",
        "description": "Returns authorizeUrl: send the user there. In redirect mode the flow is bound to the browser that started it. In headless mode (API key, paid plan) the granted account waits up to one hour and is attached only after POST /connections/{id}/complete.",
        "security": [
          {
            "apiKey": [
              "accounts:write"
            ]
          }
        ],
        "x-required-scope": "accounts:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/connections/{id}": {
      "get": {
        "operationId": "getConnection",
        "tags": [
          "Connections"
        ],
        "summary": "Connection status",
        "description": "Shows the selection options while awaiting_selection and who granted access while awaiting_confirmation. A finished connection answers 404.",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/connections/{id}/complete": {
      "post": {
        "operationId": "completeConnection",
        "tags": [
          "Connections"
        ],
        "summary": "Finish a connection",
        "description": "Send { selectionId } to pick a Page, account or organization, {} to confirm a headless connection, or { code } for a headless exchange.",
        "security": [
          {
            "apiKey": [
              "accounts:write"
            ]
          }
        ],
        "x-required-scope": "accounts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionComplete"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/profiles": {
      "get": {
        "operationId": "listProfiles",
        "tags": [
          "Profiles"
        ],
        "summary": "List profiles",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "expand",
            "in": "query",
            "description": "Inline the accounts of every profile.",
            "schema": {
              "type": "string",
              "enum": [
                "accounts"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProfileWithAccounts"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createProfile",
        "tags": [
          "Profiles"
        ],
        "summary": "Create a profile",
        "security": [
          {
            "apiKey": [
              "accounts:write"
            ]
          }
        ],
        "x-required-scope": "accounts:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/profiles/{id}": {
      "get": {
        "operationId": "getProfile",
        "tags": [
          "Profiles"
        ],
        "summary": "Get a profile",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateProfile",
        "tags": [
          "Profiles"
        ],
        "summary": "Update a profile",
        "security": [
          {
            "apiKey": [
              "accounts:write"
            ]
          }
        ],
        "x-required-scope": "accounts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteProfile",
        "tags": [
          "Profiles"
        ],
        "summary": "Delete a profile",
        "description": "Answers 409 profile_has_accounts while accounts are attached.",
        "security": [
          {
            "apiKey": [
              "accounts:write"
            ]
          }
        ],
        "x-required-scope": "accounts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts": {
      "get": {
        "operationId": "listAccounts",
        "tags": [
          "Accounts"
        ],
        "summary": "List connected accounts",
        "description": "The list is complete: hasMore is always false.",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "profileId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PlatformId"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "connected",
                "reconnect_required",
                "disabled"
              ]
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Inline the profile of every account.",
            "schema": {
              "type": "string",
              "enum": [
                "profile"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Account"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/health": {
      "get": {
        "operationId": "getAccountsHealth",
        "tags": [
          "Accounts"
        ],
        "summary": "Health of all accounts",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "profileId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PlatformId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountsHealth"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/{id}": {
      "get": {
        "operationId": "getAccount",
        "tags": [
          "Accounts"
        ],
        "summary": "Get an account",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "profile"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateAccount",
        "tags": [
          "Accounts"
        ],
        "summary": "Update an account",
        "description": "Rename it, move it to another profile or save settings such as defaultOptions applied to every post of the account.",
        "security": [
          {
            "apiKey": [
              "accounts:write"
            ]
          }
        ],
        "x-required-scope": "accounts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteAccount",
        "tags": [
          "Accounts"
        ],
        "summary": "Disconnect an account",
        "security": [
          {
            "apiKey": [
              "accounts:write"
            ]
          }
        ],
        "x-required-scope": "accounts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/{id}/health": {
      "get": {
        "operationId": "getAccountHealth",
        "tags": [
          "Accounts"
        ],
        "summary": "Health of one account",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountHealth"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/{id}/followers": {
      "get": {
        "operationId": "getAccountFollowers",
        "tags": [
          "Accounts"
        ],
        "summary": "Follower history",
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "x-required-scope": "analytics:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Followers"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/{id}/publishing-info": {
      "get": {
        "operationId": "getAccountPublishingInfo",
        "tags": [
          "Accounts"
        ],
        "summary": "What the network allows for this account",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishingInfo"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/{id}/posts": {
      "get": {
        "operationId": "listAccountPosts",
        "tags": [
          "Accounts"
        ],
        "summary": "Posts sent to an account",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "publishing",
                "published",
                "failed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Post"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/{id}/playlists": {
      "get": {
        "operationId": "listAccountPlaylists",
        "tags": [
          "Accounts"
        ],
        "summary": "YouTube playlists of an account",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SelectionOption"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/{id}/organizations": {
      "get": {
        "operationId": "listAccountOrganizations",
        "tags": [
          "Accounts"
        ],
        "summary": "LinkedIn organizations of an account",
        "security": [
          {
            "apiKey": [
              "accounts:read"
            ]
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SelectionOption"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/accounts/{id}/refresh": {
      "post": {
        "operationId": "refreshAccount",
        "tags": [
          "Accounts"
        ],
        "summary": "Re-read name, avatar and followers from the network",
        "security": [
          {
            "apiKey": [
              "accounts:write"
            ]
          }
        ],
        "x-required-scope": "accounts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts": {
      "get": {
        "operationId": "listPosts",
        "tags": [
          "Posts"
        ],
        "summary": "List posts",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "One or several statuses, comma-separated.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "description": "One or several networks, comma-separated.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "ISO 8601 time, lower bound.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "ISO 8601 time, upper bound.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Text search.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Inline the account of every target.",
            "schema": {
              "type": "string",
              "enum": [
                "targets.account"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Post"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createPost",
        "tags": [
          "Posts"
        ],
        "summary": "Create a post",
        "description": "Without publishAt and draft the post is saved as a draft. A post that is not a draft needs at least one target that passes the network checks. One credit per target is taken when the target is sent (X costs more, see GET /billing/usage). A replayed Idempotency-Key answers 200 with Idempotent-Replayed: true.",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored post of an earlier request with the same Idempotency-Key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts/batch": {
      "post": {
        "operationId": "createPostsBatch",
        "tags": [
          "Posts"
        ],
        "summary": "Create up to 50 posts",
        "description": "Every item is created on its own; results keep the order of the request.",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostBatch"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostBatchResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts/validate": {
      "post": {
        "operationId": "validatePost",
        "tags": [
          "Posts"
        ],
        "summary": "Check a post without creating it",
        "description": "Takes the create body and returns the per-target checks. Nothing is saved and nothing is downloaded.",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Validation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts/{id}": {
      "get": {
        "operationId": "getPost",
        "tags": [
          "Posts"
        ],
        "summary": "Get a post",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "targets.account"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updatePost",
        "tags": [
          "Posts"
        ],
        "summary": "Update a post",
        "description": "Not while the post is publishing or after it is published (409).",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deletePost",
        "tags": [
          "Posts"
        ],
        "summary": "Delete the TrendGuru record of a post",
        "description": "Removes only the record here. To remove the published copies from the networks use DELETE /posts/{id}/platform-copies.",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDeletion"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts/{id}/platform-copies": {
      "delete": {
        "operationId": "deletePostFromPlatforms",
        "tags": [
          "Posts"
        ],
        "summary": "Delete a post from the networks too",
        "description": "Tries to delete every published target on its network, then the record. On a partial failure deleted is false and the post is kept. Networks that do not support deletion return a failed result for their target.",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDeletion"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts/{id}/retry": {
      "post": {
        "operationId": "retryPost",
        "tags": [
          "Posts"
        ],
        "summary": "Retry a failed or partial post",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts/{id}/unpublish": {
      "post": {
        "operationId": "unpublishPost",
        "tags": [
          "Posts"
        ],
        "summary": "Remove the published copies, keep the record",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostUnpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts/{id}/approve": {
      "post": {
        "operationId": "approvePost",
        "tags": [
          "Posts"
        ],
        "summary": "Approve a post waiting for review",
        "description": "Needs publish rights on every channel of the post. A past publishAt publishes now.",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/posts/{id}/reject": {
      "post": {
        "operationId": "rejectPost",
        "tags": [
          "Posts"
        ],
        "summary": "Send a post back to draft with a note",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostReject"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/media": {
      "post": {
        "operationId": "createMedia",
        "tags": [
          "Media"
        ],
        "summary": "Start an upload",
        "description": "Returns the media record and upload.url. PUT the file bytes there within one hour, then use the media id in posts.",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUpload"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "get": {
        "operationId": "listMedia",
        "tags": [
          "Media"
        ],
        "summary": "List media files",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "gif",
                "document",
                "audio"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Media"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/media/upload/{token}": {
      "put": {
        "operationId": "uploadMediaBytes",
        "tags": [
          "Media"
        ],
        "summary": "Send the file bytes",
        "description": "The address comes from upload.url of POST /media; the token in it is the credential, no key is sent. Always use upload.url as returned: it may sit on a separate upload host.",
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "Upload token from upload.url.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/media/upload": {
      "post": {
        "operationId": "uploadMedia",
        "tags": [
          "Media"
        ],
        "summary": "Upload a file in one request",
        "description": "Raw body with Content-Type and X-Filename. Takes bodies up to about 100 MB; larger files go through POST /media and PUT upload.url.",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XFilename"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/media/{id}/thumbnail": {
      "post": {
        "operationId": "uploadMediaThumbnail",
        "tags": [
          "Media"
        ],
        "summary": "Attach a JPEG preview to a media file",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/media/{id}": {
      "get": {
        "operationId": "getMedia",
        "tags": [
          "Media"
        ],
        "summary": "Get a media file",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteMedia",
        "tags": [
          "Media"
        ],
        "summary": "Delete a media file",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/events": {
      "get": {
        "operationId": "listWebhookEvents",
        "tags": [
          "Webhooks"
        ],
        "summary": "List event types",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEventType"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "security": [
          {
            "apiKey": [
              "webhooks:read"
            ]
          }
        ],
        "x-required-scope": "webhooks:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook",
        "description": "The signing secret is returned here and by the rotate call only. Up to 50 webhooks per workspace.",
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "x-required-scope": "webhooks:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "tags": [
          "Webhooks"
        ],
        "summary": "List deliveries",
        "security": [
          {
            "apiKey": [
              "webhooks:read"
            ]
          }
        ],
        "x-required-scope": "webhooks:read",
        "parameters": [
          {
            "name": "webhookId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Event type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "success",
                "failed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/deliveries/{id}/redeliver": {
      "post": {
        "operationId": "redeliverWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a delivery again",
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRedelivery"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "operationId": "getWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a webhook",
        "security": [
          {
            "apiKey": [
              "webhooks:read"
            ]
          }
        ],
        "x-required-scope": "webhooks:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook",
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook",
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/{id}/secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "tags": [
          "Webhooks"
        ],
        "summary": "Generate a new signing secret",
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "testWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a ping event",
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          }
        ],
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTest"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/overview": {
      "get": {
        "operationId": "getWorkspaceOverview",
        "tags": [
          "Analytics"
        ],
        "summary": "Workspace overview",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceOverview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/analytics/overview": {
      "get": {
        "operationId": "getAnalyticsOverview",
        "tags": [
          "Analytics"
        ],
        "summary": "Publishing counters and upcoming posts",
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "x-required-scope": "analytics:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsOverview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/analytics/posts": {
      "get": {
        "operationId": "listPostMetrics",
        "tags": [
          "Analytics"
        ],
        "summary": "Latest metrics of published targets",
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "x-required-scope": "analytics:read",
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PlatformId"
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PostMetrics"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/analytics/posts/{postId}/timeline": {
      "get": {
        "operationId": "getPostTimeline",
        "tags": [
          "Analytics"
        ],
        "summary": "Metric snapshots of a post over time",
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "x-required-scope": "analytics:read",
        "parameters": [
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "description": "Post id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostTimeline"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/analytics/daily": {
      "get": {
        "operationId": "getDailyMetrics",
        "tags": [
          "Analytics"
        ],
        "summary": "Posts and metrics by day",
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "x-required-scope": "analytics:read",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30
            }
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PlatformId"
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DailyMetrics"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/analytics/accounts": {
      "get": {
        "operationId": "getAccountAnalytics",
        "tags": [
          "Analytics"
        ],
        "summary": "Account statistics by day",
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "x-required-scope": "analytics:read",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 30
            }
          },
          {
            "name": "accountIds",
            "in": "query",
            "description": "Comma-separated account ids.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountAnalytics"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/analytics/content": {
      "get": {
        "operationId": "listTopContent",
        "tags": [
          "Analytics"
        ],
        "summary": "Top posts of the connected accounts",
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "x-required-scope": "analytics:read",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 30
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "likes",
                "comments",
                "shares",
                "views",
                "saves",
                "recent"
              ],
              "default": "likes"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "trendguru"
              ],
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountContent"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/analytics/accounts/sync": {
      "post": {
        "operationId": "syncAccountAnalytics",
        "tags": [
          "Analytics"
        ],
        "summary": "Refresh account statistics now",
        "description": "At most once every 5 minutes per workspace; otherwise started is false.",
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "x-required-scope": "analytics:read",
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSync"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/logs": {
      "get": {
        "operationId": "listLogs",
        "tags": [
          "Logs"
        ],
        "summary": "List request and publishing logs",
        "security": [
          {
            "apiKey": [
              "logs:read"
            ]
          }
        ],
        "x-required-scope": "logs:read",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30,
              "default": 7
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "api",
                "publishing"
              ]
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "success",
                "failed"
              ]
            }
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Log"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "errors": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total",
                        "errors"
                      ]
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor",
                    "summary"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/settings": {
      "get": {
        "operationId": "getTrendSettings",
        "tags": [
          "Trends"
        ],
        "summary": "Trend radar settings and limits",
        "security": [
          {
            "apiKey": [
              "trends:read"
            ]
          }
        ],
        "x-required-scope": "trends:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateTrendSettings",
        "tags": [
          "Trends"
        ],
        "summary": "Turn the daily digest on or off",
        "security": [
          {
            "apiKey": [
              "trends:write"
            ]
          }
        ],
        "x-required-scope": "trends:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrendSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/presets": {
      "get": {
        "operationId": "listTrendPresets",
        "tags": [
          "Trends"
        ],
        "summary": "List niche presets",
        "security": [
          {
            "apiKey": [
              "trends:read"
            ]
          }
        ],
        "x-required-scope": "trends:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TrendPreset"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/niches": {
      "get": {
        "operationId": "listTrendNiches",
        "tags": [
          "Trends"
        ],
        "summary": "List niches",
        "security": [
          {
            "apiKey": [
              "trends:read"
            ]
          }
        ],
        "x-required-scope": "trends:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TrendNiche"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createTrendNiche",
        "tags": [
          "Trends"
        ],
        "summary": "Create a niche",
        "description": "Answers 409 niche_limit when the plan limit is reached (Creator 3, Pro 10, Business 30).",
        "security": [
          {
            "apiKey": [
              "trends:write"
            ]
          }
        ],
        "x-required-scope": "trends:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrendNicheCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendNiche"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/niches/presets/{key}": {
      "post": {
        "operationId": "createTrendNicheFromPreset",
        "tags": [
          "Trends"
        ],
        "summary": "Create a niche from a preset",
        "security": [
          {
            "apiKey": [
              "trends:write"
            ]
          }
        ],
        "x-required-scope": "trends:write",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "Key of the stage or preset.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendNiche"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/niches/suggest": {
      "post": {
        "operationId": "suggestTrendSeeds",
        "tags": [
          "Trends"
        ],
        "summary": "Suggest hashtags and queries for a niche",
        "description": "AI-picked seeds, excluding the ones passed. 30 calls per hour per workspace.",
        "security": [
          {
            "apiKey": [
              "trends:write"
            ]
          }
        ],
        "x-required-scope": "trends:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrendSuggestInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendSeedSuggestions"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/niches/{id}": {
      "patch": {
        "operationId": "updateTrendNiche",
        "tags": [
          "Trends"
        ],
        "summary": "Update a niche",
        "security": [
          {
            "apiKey": [
              "trends:write"
            ]
          }
        ],
        "x-required-scope": "trends:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrendNicheUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendNiche"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteTrendNiche",
        "tags": [
          "Trends"
        ],
        "summary": "Delete a niche",
        "security": [
          {
            "apiKey": [
              "trends:write"
            ]
          }
        ],
        "x-required-scope": "trends:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendNicheDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/videos": {
      "get": {
        "operationId": "listTrendVideos",
        "tags": [
          "Trends"
        ],
        "summary": "List trending videos",
        "description": "Scored videos of one platform that match one niche or all niches of the workspace. The cursor is keyed on the sort value.",
        "security": [
          {
            "apiKey": [
              "trends:read"
            ]
          }
        ],
        "x-required-scope": "trends:read",
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "youtube"
              ],
              "default": "tiktok"
            }
          },
          {
            "name": "niche",
            "in": "query",
            "description": "Niche id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ru",
                "es",
                "pt",
                "de",
                "fr",
                "it",
                "tr",
                "uk",
                "pl",
                "ar",
                "hi",
                "id",
                "vi",
                "th",
                "ja",
                "ko",
                "zh"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "score",
                "velocity",
                "views"
              ],
              "default": "score"
            }
          },
          {
            "name": "minScore",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "growing",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "analyzed",
            "in": "query",
            "description": "Only videos whose breakdown the workspace bought.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TrendVideo"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/videos/{id}": {
      "get": {
        "operationId": "getTrendVideo",
        "tags": [
          "Trends"
        ],
        "summary": "Get a trending video",
        "security": [
          {
            "apiKey": [
              "trends:read"
            ]
          }
        ],
        "x-required-scope": "trends:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendVideo"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/videos/{id}/breakdown": {
      "get": {
        "operationId": "getTrendBreakdown",
        "tags": [
          "Trends"
        ],
        "summary": "Get the AI breakdown of a video",
        "security": [
          {
            "apiKey": [
              "trends:read"
            ]
          }
        ],
        "x-required-scope": "trends:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ru",
                "es"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendBreakdown"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "buyTrendBreakdown",
        "tags": [
          "Trends"
        ],
        "summary": "Buy the AI breakdown of a TikTok video",
        "description": "Costs priceCredits once per video and language; buying again is free while the purchase stands. Credits come back if the breakdown finally fails.",
        "security": [
          {
            "apiKey": [
              "trends:write"
            ]
          }
        ],
        "x-required-scope": "trends:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ru",
                "es"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendBreakdown"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/languages": {
      "get": {
        "operationId": "listTrendLanguages",
        "tags": [
          "Trends"
        ],
        "summary": "Languages the videos can be filtered by",
        "security": [
          {
            "apiKey": [
              "trends:read"
            ]
          }
        ],
        "x-required-scope": "trends:read",
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "youtube"
              ],
              "default": "tiktok"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TrendLanguage"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/trends/sounds": {
      "get": {
        "operationId": "listTrendSounds",
        "tags": [
          "Trends"
        ],
        "summary": "List trending TikTok sounds",
        "security": [
          {
            "apiKey": [
              "trends:read"
            ]
          }
        ],
        "x-required-scope": "trends:read",
        "parameters": [
          {
            "name": "niche",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "24h",
                "48h",
                "72h"
              ],
              "default": "72h"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TrendSound"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/generators": {
      "get": {
        "operationId": "listStudioGenerators",
        "tags": [
          "Studio"
        ],
        "summary": "List Studio formats",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Generator"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs": {
      "get": {
        "operationId": "listStudioRuns",
        "tags": [
          "Studio"
        ],
        "summary": "List runs",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "draft",
                "active",
                "review",
                "approved",
                "failed",
                "posted"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StudioRun"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Start a run",
        "description": "The run is saved at once and executed in the server queue.",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioRunCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}": {
      "get": {
        "operationId": "getStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Get a run",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Edit a run",
        "description": "Optimistic: send the revision you read. A stale revision answers 409 studio_revision_conflict. Editing clears the approval.",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioRunUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Delete a run",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done, no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}/budget": {
      "patch": {
        "operationId": "updateStudioRunBudget",
        "tags": [
          "Studio"
        ],
        "summary": "Change the AI credit limit of an idle run",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioBudget"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}/launch": {
      "post": {
        "operationId": "launchStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Start a draft run",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioRevision"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}/pause": {
      "post": {
        "operationId": "pauseStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Return queued work to draft",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}/approve": {
      "post": {
        "operationId": "approveStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Approve the ready version",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioRevision"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}/stages/{key}/accept": {
      "post": {
        "operationId": "acceptStudioStage",
        "tags": [
          "Studio"
        ],
        "summary": "Accept a stage and continue",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "Key of the stage or preset.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioRevisionOptional"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}/stages/{key}/redo": {
      "post": {
        "operationId": "redoStudioStage",
        "tags": [
          "Studio"
        ],
        "summary": "Regenerate a stage",
        "description": "Regenerates the stage and everything built on it; counts as a new attempt that may be charged.",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "Key of the stage or preset.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioRedo"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}/video/actions": {
      "post": {
        "operationId": "runStudioVideoAction",
        "tags": [
          "Studio"
        ],
        "summary": "Act on a task of a video run",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioVideoAction"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/runs/{id}/post": {
      "post": {
        "operationId": "postStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Turn a run into a post",
        "description": "One post per run: repeated calls return the same post. Omit publishAt for a post draft.",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioPost"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/estimate": {
      "post": {
        "operationId": "estimateStudioRun",
        "tags": [
          "Studio"
        ],
        "summary": "Estimate length and render credits",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioEstimateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "seconds, renderCredits and related fields of the estimate."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/attention": {
      "get": {
        "operationId": "getStudioAttention",
        "tags": [
          "Studio"
        ],
        "summary": "Video runs waiting for you",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioAttention"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/brand": {
      "get": {
        "operationId": "getStudioBrand",
        "tags": [
          "Studio"
        ],
        "summary": "Get the brand settings",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioBrand"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateStudioBrand",
        "tags": [
          "Studio"
        ],
        "summary": "Save the brand settings",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioBrand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioBrand"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/autopilots": {
      "get": {
        "operationId": "listAutopilots",
        "tags": [
          "Studio"
        ],
        "summary": "List rubrics",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Autopilot"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createAutopilot",
        "tags": [
          "Studio"
        ],
        "summary": "Create a rubric",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutopilotCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Autopilot"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/autopilots/{id}": {
      "patch": {
        "operationId": "updateAutopilot",
        "tags": [
          "Studio"
        ],
        "summary": "Update a rubric",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutopilotUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Autopilot"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteAutopilot",
        "tags": [
          "Studio"
        ],
        "summary": "Delete a rubric",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutopilotDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/autopilots/{id}/batch": {
      "post": {
        "operationId": "createAutopilotBatch",
        "tags": [
          "Studio"
        ],
        "summary": "Create several pieces from topics",
        "description": "Drafts by default, placed into consecutive schedule slots. Repeat the call with the same batchKey to resume without duplicates.",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutopilotBatch"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ids"
                  ],
                  "properties": {
                    "ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/autopilots/{id}/run-now": {
      "post": {
        "operationId": "runAutopilotNow",
        "tags": [
          "Studio"
        ],
        "summary": "Make the next piece now",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "started": {
                      "type": "string",
                      "description": "Id of the new run."
                    },
                    "status": {
                      "type": "string"
                    },
                    "skipped": {
                      "type": "string",
                      "description": "Why nothing was started."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/sources": {
      "get": {
        "operationId": "listSources",
        "tags": [
          "Studio"
        ],
        "summary": "List Sources",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Source"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createSource",
        "tags": [
          "Studio"
        ],
        "summary": "Add a Source",
        "description": "An RSS feed, a website or a public Telegram channel.",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/sources/{id}": {
      "patch": {
        "operationId": "updateSource",
        "tags": [
          "Studio"
        ],
        "summary": "Update a Source",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteSource",
        "tags": [
          "Studio"
        ],
        "summary": "Delete a Source",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/sources/{id}/refresh": {
      "post": {
        "operationId": "refreshSource",
        "tags": [
          "Studio"
        ],
        "summary": "Read a Source now",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "The result of the read."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/sources/{id}/items": {
      "get": {
        "operationId": "listSourceItems",
        "tags": [
          "Studio"
        ],
        "summary": "Items read from a Source",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SourceItem"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/feeds": {
      "get": {
        "operationId": "listFeeds",
        "tags": [
          "Studio"
        ],
        "summary": "List Feeds",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Feed"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createFeed",
        "tags": [
          "Studio"
        ],
        "summary": "Create a Feed from several Sources",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Feed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/studio/feeds/{id}": {
      "patch": {
        "operationId": "updateFeed",
        "tags": [
          "Studio"
        ],
        "summary": "Update a Feed",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Feed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteFeed",
        "tags": [
          "Studio"
        ],
        "summary": "Delete a Feed",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Object id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/generation/catalog": {
      "get": {
        "operationId": "getGenerationCatalog",
        "tags": [
          "Generation"
        ],
        "summary": "Providers, models and connected keys",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationCatalog"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/generation/quote": {
      "post": {
        "operationId": "quoteGeneration",
        "tags": [
          "Generation"
        ],
        "summary": "Estimate the cost of one generation request",
        "description": "An upper reservation estimate for one request, not for a whole video.",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationQuoteInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "maxCredits, priceUsd, providerCostUsd and costBasis of the estimate."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/generation/voices": {
      "get": {
        "operationId": "listVoices",
        "tags": [
          "Generation"
        ],
        "summary": "List narration voices for a language",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "description": "English language name or ISO code; default English.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "selected",
            "in": "query",
            "description": "A saved voice id to check.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paymentSource",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "own",
                "balance"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/generation/text": {
      "post": {
        "operationId": "generateText",
        "tags": [
          "Generation"
        ],
        "summary": "Generate post text",
        "security": [
          {
            "apiKey": [
              "posts:write"
            ]
          }
        ],
        "x-required-scope": "posts:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationTextInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/generation/image": {
      "post": {
        "operationId": "generateImage",
        "tags": [
          "Generation"
        ],
        "summary": "Generate an image",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationImageInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/generation/video": {
      "post": {
        "operationId": "generateVideo",
        "tags": [
          "Generation"
        ],
        "summary": "Generate a video clip",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationVideoInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/generation/transcribe": {
      "post": {
        "operationId": "transcribeMedia",
        "tags": [
          "Generation"
        ],
        "summary": "Transcribe audio or video by URL",
        "description": "Runs on your own provider key.",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationTranscribeInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/generation/jobs": {
      "get": {
        "operationId": "listGenerationJobs",
        "tags": [
          "Generation"
        ],
        "summary": "List generation jobs",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GenerationJob"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/render/templates": {
      "get": {
        "operationId": "listRenderTemplates",
        "tags": [
          "Render"
        ],
        "summary": "List render templates",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RenderTemplate"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/render/quote": {
      "post": {
        "operationId": "quoteRender",
        "tags": [
          "Render"
        ],
        "summary": "Price of a render",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenderQuote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/render": {
      "post": {
        "operationId": "createRender",
        "tags": [
          "Render"
        ],
        "summary": "Render a template to video",
        "description": "Charged in credits per output second. The response comes when the video is ready.",
        "security": [
          {
            "apiKey": [
              "media:write"
            ]
          }
        ],
        "x-required-scope": "media:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenderResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/render/jobs": {
      "get": {
        "operationId": "listRenderJobs",
        "tags": [
          "Render"
        ],
        "summary": "List render jobs",
        "security": [
          {
            "apiKey": [
              "posts:read"
            ]
          }
        ],
        "x-required-scope": "posts:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "TrendGuru-Version": {
                "$ref": "#/components/headers/TrendGuruVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RenderJob"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= to get the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "hasMore",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "webhooks": {
    "post.scheduled": {
      "post": {
        "operationId": "onPostScheduled",
        "tags": [
          "Webhooks"
        ],
        "summary": "A post was scheduled.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "post.published": {
      "post": {
        "operationId": "onPostPublished",
        "tags": [
          "Webhooks"
        ],
        "summary": "Every target of a post was published.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "post.partial": {
      "post": {
        "operationId": "onPostPartial",
        "tags": [
          "Webhooks"
        ],
        "summary": "Some targets of a post were published and some failed.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "post.failed": {
      "post": {
        "operationId": "onPostFailed",
        "tags": [
          "Webhooks"
        ],
        "summary": "Every target of a post failed.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "post.canceled": {
      "post": {
        "operationId": "onPostCanceled",
        "tags": [
          "Webhooks"
        ],
        "summary": "A scheduled post was canceled.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "target.published": {
      "post": {
        "operationId": "onTargetPublished",
        "tags": [
          "Webhooks"
        ],
        "summary": "One target was published on its network.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "target.failed": {
      "post": {
        "operationId": "onTargetFailed",
        "tags": [
          "Webhooks"
        ],
        "summary": "One target finally failed.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "account.connected": {
      "post": {
        "operationId": "onAccountConnected",
        "tags": [
          "Webhooks"
        ],
        "summary": "A social account was connected.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "account.disconnected": {
      "post": {
        "operationId": "onAccountDisconnected",
        "tags": [
          "Webhooks"
        ],
        "summary": "A social account was disconnected or needs reconnection.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "analytics.synced": {
      "post": {
        "operationId": "onAnalyticsSynced",
        "tags": [
          "Webhooks"
        ],
        "summary": "New metrics were collected.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    },
    "trend.detected": {
      "post": {
        "operationId": "onTrendDetected",
        "tags": [
          "Webhooks"
        ],
        "summary": "A video crossed the trend score in one of the workspace niches.",
        "description": "Sent as a POST to every enabled webhook subscribed to the event. Answer with any 2xx. Failed deliveries retry after 1m, 5m, 15m, 1h, 3h and 12h; ten consecutive failures disable the webhook.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TrendGuruEvent"
          },
          {
            "$ref": "#/components/parameters/TrendGuruEventId"
          },
          {
            "$ref": "#/components/parameters/TrendGuruDelivery"
          },
          {
            "$ref": "#/components/parameters/TrendGuruAttempt"
          },
          {
            "$ref": "#/components/parameters/TrendGuruTimestamp"
          },
          {
            "$ref": "#/components/parameters/TrendGuruSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "tg_live_... or tg_test_...",
        "description": "API key from the dashboard. Scopes: posts:read, posts:write, accounts:read, accounts:write, media:write, webhooks:read, webhooks:write, analytics:read, logs:read, trends:read, trends:write. The scope an operation needs is in its security requirement and in x-required-scope."
      }
    },
    "parameters": {
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "description": "nextCursor of the previous page. Opaque: a changed or foreign cursor answers 400 invalid_cursor.",
        "schema": {
          "type": "string",
          "maxLength": 400
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Page size.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 25
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "description": "Makes a retry safe for 24 hours. 8-128 characters of A-Z a-z 0-9 _ . : -. The same key with a different body answers 422 idempotency_mismatch.",
        "schema": {
          "type": "string",
          "pattern": "^[\\w.:-]{8,128}$"
        }
      },
      "XFilename": {
        "name": "X-Filename",
        "in": "header",
        "description": "URL-encoded file name.",
        "schema": {
          "type": "string"
        }
      },
      "TrendGuruEvent": {
        "name": "TrendGuru-Event",
        "in": "header",
        "description": "Event type.",
        "schema": {
          "type": "string"
        }
      },
      "TrendGuruEventId": {
        "name": "TrendGuru-Event-Id",
        "in": "header",
        "description": "Event id, the same across retries.",
        "schema": {
          "type": "string"
        }
      },
      "TrendGuruDelivery": {
        "name": "TrendGuru-Delivery",
        "in": "header",
        "description": "Id of this delivery.",
        "schema": {
          "type": "string"
        }
      },
      "TrendGuruAttempt": {
        "name": "TrendGuru-Attempt",
        "in": "header",
        "description": "Attempt number, starting at 1.",
        "schema": {
          "type": "string"
        }
      },
      "TrendGuruTimestamp": {
        "name": "TrendGuru-Timestamp",
        "in": "header",
        "description": "Unix time of the delivery, the t of the signature.",
        "schema": {
          "type": "string"
        }
      },
      "TrendGuruSignature": {
        "name": "TrendGuru-Signature",
        "in": "header",
        "description": "t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook secret>.",
        "schema": {
          "type": "string"
        }
      }
    },
    "headers": {
      "XRequestId": {
        "description": "Request id; echoes a valid X-Request-Id sent by the client.",
        "schema": {
          "type": "string"
        }
      },
      "TrendGuruVersion": {
        "description": "API version that served the request.",
        "schema": {
          "type": "string",
          "example": "2026-09-05"
        }
      },
      "RateLimitLimit": {
        "description": "Requests allowed per minute for this key (600 by default).",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before the next request.",
        "schema": {
          "type": "integer"
        }
      },
      "IdempotentReplayed": {
        "description": "true when the response is the stored result of an earlier request with the same Idempotency-Key.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request: validation_failed, invalid_cursor, invalid_options and similar codes.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "TrendGuru-Version": {
            "$ref": "#/components/headers/TrendGuruVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid API key (unauthenticated).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "TrendGuru-Version": {
            "$ref": "#/components/headers/TrendGuruVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Not enough credits or a paid plan is needed: insufficient_credits, plan_required, profile_limit, storage_quota, member_spend_limit.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "TrendGuru-Version": {
            "$ref": "#/components/headers/TrendGuruVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key lacks the scope (insufficient_scope), is read-only (read_only_key) or the endpoint is dashboard-only (session_required).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "TrendGuru-Version": {
            "$ref": "#/components/headers/TrendGuruVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "The object does not exist in this workspace.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "TrendGuru-Version": {
            "$ref": "#/components/headers/TrendGuruVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "The request conflicts with the current state, for example duplicate_content or post_publishing.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "TrendGuru-Version": {
            "$ref": "#/components/headers/TrendGuruVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "The request is well-formed but cannot be carried out: invalid_targets, account_reconnect_required, idempotency_mismatch, platform_unavailable, media_expired.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "TrendGuru-Version": {
            "$ref": "#/components/headers/TrendGuruVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded (rate_limited). Retry after the number of seconds in Retry-After.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "TrendGuru-Version": {
            "$ref": "#/components/headers/TrendGuruVersion"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "code",
              "message",
              "status"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "authentication",
                  "permission",
                  "billing",
                  "not_found",
                  "conflict",
                  "rate_limit",
                  "platform",
                  "server"
                ]
              },
              "code": {
                "type": "string",
                "description": "Stable machine-readable code, for example validation_failed, insufficient_scope, duplicate_content."
              },
              "message": {
                "type": "string"
              },
              "status": {
                "type": "integer",
                "description": "HTTP status code."
              },
              "details": {
                "description": "Extra data for some codes (validation issues, limits, ids)."
              },
              "requestId": {
                "type": "string",
                "description": "Same value as the X-Request-Id response header."
              }
            }
          }
        },
        "required": [
          "error"
        ],
        "description": "Every error response has this shape."
      },
      "Me": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "me"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "accountId": {
            "type": "string",
            "description": "Workspace id the caller acts in."
          },
          "auth": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "How the caller is authenticated, for example api_key."
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "profileIds": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "keyId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mode": {
                "type": "string",
                "enum": [
                  "live",
                  "test"
                ]
              }
            },
            "required": [
              "type",
              "scopes",
              "profileIds",
              "keyId",
              "mode"
            ]
          },
          "workspace": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "role": {
                "type": "string"
              },
              "permissions": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true
              }
            },
            "required": [
              "id",
              "role",
              "permissions"
            ]
          },
          "apiVersion": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "user",
          "accountId",
          "auth",
          "workspace",
          "apiVersion"
        ]
      },
      "User": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "user"
          },
          "id": {
            "type": "string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string"
          },
          "plan": {
            "type": "string",
            "enum": [
              "free",
              "creator",
              "pro",
              "business"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "email",
          "name",
          "avatarUrl",
          "role",
          "plan",
          "timezone",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "ScopeCatalog": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "scopes"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presets": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "object",
          "scopes",
          "presets"
        ]
      },
      "PlatformId": {
        "type": "string",
        "enum": [
          "instagram",
          "tiktok",
          "youtube",
          "facebook",
          "twitter",
          "linkedin",
          "threads",
          "telegram",
          "pinterest",
          "reddit",
          "bluesky"
        ]
      },
      "Platform": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "platform"
          },
          "id": {
            "$ref": "#/components/schemas/PlatformId"
          },
          "name": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "paidOnly": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "mock": {
            "type": "boolean"
          },
          "wave": {
            "type": "integer"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "available",
          "paidOnly",
          "reason",
          "mock",
          "wave"
        ]
      },
      "Profile": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "profile"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "description",
          "color",
          "isDefault",
          "createdAt",
          "updatedAt"
        ]
      },
      "ProfileWithAccounts": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Profile"
          },
          {
            "type": "object",
            "properties": {
              "accounts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Account"
                },
                "description": "Present with ?expand=accounts."
              }
            }
          }
        ]
      },
      "ProfileCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 512
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          }
        },
        "required": [
          "name"
        ]
      },
      "ProfileUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 512
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "isDefault": {
            "type": "boolean"
          }
        }
      },
      "ConnectionCreate": {
        "type": "object",
        "properties": {
          "platform": {
            "$ref": "#/components/schemas/PlatformId"
          },
          "profileId": {
            "type": "string"
          },
          "redirectUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 1024,
            "description": "Where the user returns after authorizing. With an API key: any https URL without credentials."
          },
          "mode": {
            "type": "string",
            "enum": [
              "redirect",
              "headless"
            ],
            "default": "redirect",
            "description": "headless needs an API key and a paid plan; the account is attached only after POST /connections/{id}/complete."
          },
          "loginMethod": {
            "type": "string",
            "enum": [
              "instagram",
              "facebook"
            ],
            "description": "Instagram only: sign in with Instagram or through a Facebook Page."
          }
        },
        "required": [
          "platform",
          "profileId"
        ]
      },
      "Connection": {
        "type": "object",
        "required": [
          "object",
          "id",
          "status"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "connection"
          },
          "id": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "profileId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "awaiting_authorization",
              "awaiting_selection",
              "awaiting_confirmation",
              "connected"
            ]
          },
          "authorizeUrl": {
            "type": "string",
            "format": "uri",
            "description": "Returned by POST /connections: send the user here."
          },
          "selection": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "pages",
                  "accounts",
                  "organizations"
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "username": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "avatarUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "username",
                    "avatarUrl"
                  ],
                  "additionalProperties": true
                }
              }
            },
            "required": [
              "type",
              "options"
            ]
          },
          "account": {
            "description": "While awaiting_confirmation: who granted access. When connected: the attached account.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/Account"
              },
              {
                "type": "object",
                "properties": {
                  "platformUserId": {
                    "type": "string"
                  },
                  "username": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "platformUserId",
                  "username",
                  "name"
                ]
              }
            ]
          },
          "redirectUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConnectionComplete": {
        "type": "object",
        "properties": {
          "selectionId": {
            "type": "string",
            "description": "Id of the chosen Page, account or organization."
          },
          "code": {
            "type": "string",
            "description": "Authorization code for a headless exchange."
          }
        },
        "description": "Send {} to confirm a headless connection that is awaiting_confirmation."
      },
      "Account": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account"
          },
          "id": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/PlatformId"
          },
          "profileId": {
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/Profile",
            "description": "Present with ?expand=profile."
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ]
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "profileUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "connected",
              "reconnect_required",
              "disabled"
            ]
          },
          "followers": {
            "type": [
              "integer",
              "null"
            ]
          },
          "followersUpdatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "tokenExpiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "settings": {
            "type": "object",
            "additionalProperties": true,
            "description": "Saved per-account settings, for example defaultOptions."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "connectedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "platform",
          "profileId",
          "username",
          "displayName",
          "avatarUrl",
          "profileUrl",
          "status",
          "followers",
          "followersUpdatedAt",
          "tokenExpiresAt",
          "lastError",
          "settings",
          "metadata",
          "connectedAt",
          "createdAt",
          "updatedAt"
        ]
      },
      "AccountUpdate": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "maxLength": 255
          },
          "profileId": {
            "type": "string",
            "description": "Move the account to another profile."
          },
          "settings": {
            "type": "object",
            "additionalProperties": true,
            "description": "For example { \"defaultOptions\": { ... } }, validated like target options."
          }
        }
      },
      "AccountHealth": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account_health"
          },
          "accountId": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/PlatformId"
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ]
          },
          "profileId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "healthy",
              "warning",
              "error"
            ]
          },
          "canPost": {
            "type": "boolean"
          },
          "canFetchAnalytics": {
            "type": "boolean"
          },
          "tokenValid": {
            "type": "boolean"
          },
          "tokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "needsReconnect": {
            "type": "boolean"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AccountsHealth": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "accounts_health"
          },
          "summary": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "healthy": {
                "type": "integer"
              },
              "warning": {
                "type": "integer"
              },
              "error": {
                "type": "integer"
              },
              "needsReconnect": {
                "type": "integer"
              }
            },
            "required": [
              "total",
              "healthy",
              "warning",
              "error",
              "needsReconnect"
            ]
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountHealth"
            }
          }
        },
        "required": [
          "object",
          "summary",
          "accounts"
        ]
      },
      "Followers": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "followers"
          },
          "accountId": {
            "type": "string"
          },
          "current": {
            "type": [
              "integer",
              "null"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "change": {
            "type": "integer"
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "followers": {
                  "type": "integer"
                }
              },
              "required": [
                "date",
                "followers"
              ]
            }
          }
        },
        "required": [
          "object",
          "accountId",
          "current",
          "updatedAt",
          "change",
          "history"
        ]
      },
      "PublishingInfo": {
        "type": "object",
        "required": [
          "object",
          "accountId"
        ],
        "description": "What the network allows for this account right now. Filled for TikTok; other networks return only object and accountId.",
        "properties": {
          "object": {
            "type": "string",
            "const": "publishing_info"
          },
          "accountId": {
            "type": "string"
          },
          "nickname": {
            "type": "string"
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "privacyOptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "commentDisabled": {
            "type": "boolean"
          },
          "duetDisabled": {
            "type": "boolean"
          },
          "stitchDisabled": {
            "type": "boolean"
          },
          "maxVideoDurationSec": {
            "type": "integer"
          },
          "directPost": {
            "type": "boolean"
          }
        }
      },
      "SelectionOption": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "MediaInput": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Id of an uploaded media file."
              },
              "alt": {
                "type": "string",
                "maxLength": 1000
              },
              "title": {
                "type": "string",
                "maxLength": 400
              },
              "thumbnailUrl": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "id"
            ]
          },
          {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Public URL of the file."
              },
              "type": {
                "type": "string",
                "enum": [
                  "image",
                  "video",
                  "gif",
                  "document"
                ]
              },
              "alt": {
                "type": "string",
                "maxLength": 1000
              },
              "title": {
                "type": "string",
                "maxLength": 400
              },
              "thumbnailUrl": {
                "type": "string",
                "format": "uri"
              },
              "mimeType": {
                "type": "string",
                "maxLength": 128
              }
            },
            "required": [
              "url"
            ]
          }
        ]
      },
      "TargetInput": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "maxLength": 20000
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaInput"
            },
            "maxItems": 35
          },
          "options": {
            "$ref": "#/components/schemas/TargetOptions"
          },
          "publishAt": {
            "type": "string",
            "format": "date-time",
            "description": "Own time for this target."
          }
        },
        "required": [
          "accountId"
        ]
      },
      "TargetOptions": {
        "description": "Options of the network the account belongs to. Validated strictly: unknown keys answer 400 invalid_options.",
        "anyOf": [
          {
            "$ref": "#/components/schemas/InstagramOptions"
          },
          {
            "$ref": "#/components/schemas/TikTokOptions"
          },
          {
            "$ref": "#/components/schemas/YouTubeOptions"
          },
          {
            "$ref": "#/components/schemas/FacebookOptions"
          },
          {
            "$ref": "#/components/schemas/XOptions"
          },
          {
            "$ref": "#/components/schemas/LinkedInOptions"
          }
        ]
      },
      "InstagramOptions": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "auto",
              "feed",
              "reel",
              "story"
            ],
            "default": "auto"
          },
          "firstComment": {
            "type": "string",
            "maxLength": 2200
          },
          "shareToFeed": {
            "type": "boolean"
          },
          "collaborators": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "maxItems": 3
          },
          "userTags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string"
                },
                "x": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "y": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "required": [
                "username"
              ]
            },
            "maxItems": 20
          },
          "coverUrl": {
            "type": "string",
            "format": "uri"
          },
          "coverOffsetMs": {
            "type": "integer",
            "minimum": 0
          },
          "commentsEnabled": {
            "type": "boolean"
          },
          "locationId": {
            "type": "string"
          },
          "audioName": {
            "type": "string",
            "maxLength": 100
          }
        },
        "additionalProperties": false
      },
      "TikTokOptions": {
        "type": "object",
        "properties": {
          "privacy": {
            "type": "string",
            "enum": [
              "public",
              "friends",
              "followers",
              "private"
            ]
          },
          "allowComments": {
            "type": "boolean"
          },
          "allowDuet": {
            "type": "boolean"
          },
          "allowStitch": {
            "type": "boolean"
          },
          "commercial": {
            "type": "string",
            "enum": [
              "none",
              "own_brand",
              "branded"
            ]
          },
          "draft": {
            "type": "boolean",
            "description": "Send to the TikTok inbox as a draft instead of publishing."
          },
          "coverTimeMs": {
            "type": "integer",
            "minimum": 0
          },
          "coverUrl": {
            "type": "string",
            "format": "uri"
          },
          "photoCoverIndex": {
            "type": "integer",
            "minimum": 0
          },
          "autoMusic": {
            "type": "boolean"
          },
          "aiGenerated": {
            "type": "boolean"
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          }
        },
        "additionalProperties": false
      },
      "YouTubeOptions": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 100
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "unlisted",
              "private"
            ]
          },
          "madeForKids": {
            "type": "boolean"
          },
          "aiGenerated": {
            "type": "boolean"
          },
          "categoryId": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "playlistId": {
            "type": "string"
          },
          "firstComment": {
            "type": "string",
            "maxLength": 10000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "maxItems": 50
          }
        },
        "additionalProperties": false
      },
      "FacebookOptions": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "feed",
              "reel",
              "story"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "link": {
            "type": "string",
            "format": "uri"
          },
          "firstComment": {
            "type": "string",
            "maxLength": 8000
          },
          "draft": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "XOptions": {
        "type": "object",
        "properties": {
          "replyTo": {
            "type": "string",
            "description": "Id of the tweet to reply to."
          },
          "quote": {
            "type": "string",
            "description": "Id of the tweet to quote."
          },
          "replies": {
            "type": "string",
            "enum": [
              "everyone",
              "following",
              "mentioned",
              "subscribers",
              "verified"
            ]
          },
          "thread": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string",
                  "maxLength": 4000
                },
                "media": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string",
                        "format": "uri"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "image",
                          "video",
                          "gif",
                          "document"
                        ]
                      },
                      "alt": {
                        "type": "string",
                        "maxLength": 1000
                      }
                    }
                  },
                  "maxItems": 4
                }
              },
              "required": [
                "text"
              ]
            },
            "maxItems": 25
          },
          "poll": {
            "type": "object",
            "properties": {
              "options": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 25
                },
                "minItems": 2,
                "maxItems": 4
              },
              "durationMinutes": {
                "type": "integer",
                "minimum": 5,
                "maximum": 10080
              }
            },
            "required": [
              "options",
              "durationMinutes"
            ]
          }
        },
        "additionalProperties": false
      },
      "LinkedInOptions": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "firstComment": {
            "type": "string",
            "maxLength": 1250
          },
          "documentTitle": {
            "type": "string",
            "maxLength": 400
          },
          "linkPreview": {
            "type": "boolean"
          },
          "reshareUrl": {
            "type": "string"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "connections"
            ]
          },
          "poll": {
            "type": "object",
            "properties": {
              "question": {
                "type": "string",
                "maxLength": 140
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 30
                },
                "minItems": 2,
                "maxItems": 4
              },
              "durationDays": {
                "type": "integer",
                "enum": [
                  1,
                  3,
                  7,
                  14
                ]
              }
            },
            "required": [
              "question",
              "options"
            ]
          }
        },
        "additionalProperties": false
      },
      "PostCreate": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 20000
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaInput"
            },
            "maxItems": 35
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TargetInput"
            },
            "maxItems": 25
          },
          "publishAt": {
            "description": "\"now\" publishes at once; an ISO 8601 time with offset schedules; omit it for a draft.",
            "anyOf": [
              {
                "type": "string",
                "const": "now"
              },
              {
                "type": "string",
                "format": "date-time"
              }
            ]
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "IANA time zone name."
          },
          "draft": {
            "type": "boolean",
            "description": "Save as a draft even when publishAt is set."
          },
          "dryRun": {
            "type": "boolean",
            "description": "Validate and return the would-be post without saving it."
          },
          "wait": {
            "type": "boolean",
            "description": "With publishAt \"now\": false returns immediately instead of waiting for the admitted targets."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "maxItems": 50
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Your own key-value data, up to 16 KB of JSON."
          }
        }
      },
      "PostUpdate": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 20000
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaInput"
            },
            "maxItems": 35
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TargetInput"
            },
            "maxItems": 25
          },
          "publishAt": {
            "description": "\"now\" publishes at once; an ISO 8601 time with offset schedules; omit it for a draft.",
            "anyOf": [
              {
                "type": "string",
                "const": "now"
              },
              {
                "type": "string",
                "format": "date-time"
              }
            ]
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "IANA time zone name."
          },
          "draft": {
            "type": "boolean",
            "description": "Save as a draft even when publishAt is set."
          },
          "dryRun": {
            "type": "boolean",
            "description": "Validate and return the would-be post without saving it."
          },
          "wait": {
            "type": "boolean",
            "description": "With publishAt \"now\": false returns immediately instead of waiting for the admitted targets."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "maxItems": 50
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Your own key-value data, up to 16 KB of JSON."
          }
        },
        "description": "Any subset of the create body."
      },
      "PostBatch": {
        "type": "object",
        "properties": {
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostCreate"
            },
            "minItems": 1,
            "maxItems": 50
          }
        },
        "required": [
          "posts"
        ]
      },
      "PostReject": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 1000
          }
        }
      },
      "Target": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "target"
          },
          "id": {
            "type": "string"
          },
          "postId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/PlatformId"
          },
          "account": {
            "$ref": "#/components/schemas/Account",
            "description": "Present with ?expand=targets.account."
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "media": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "options": {
            "type": "object",
            "additionalProperties": true,
            "description": "The saved target options."
          },
          "publishAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "publishing",
              "published",
              "failed"
            ]
          },
          "remoteId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Id of the post on the network."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Link to the post on the network."
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "unpublishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "unpublishError": {
            "type": [
              "string",
              "null"
            ]
          },
          "deletionSupport": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "available",
              "manual",
              "instagram_reconnect",
              null
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "nextAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "category": {
                "type": "string",
                "description": "auth_expired, user_content, user_abuse, account_issue, platform_rejected, platform_error, platform_rate_limit, quota_exhausted, system_error or unknown."
              },
              "source": {
                "type": "string"
              }
            },
            "required": [
              "message",
              "category",
              "source"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "postId",
          "accountId",
          "platform",
          "text",
          "media",
          "options",
          "publishAt",
          "status",
          "remoteId",
          "url",
          "publishedAt",
          "unpublishedAt",
          "unpublishError",
          "deletionSupport",
          "attempts",
          "nextAttemptAt",
          "error"
        ]
      },
      "Post": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "post"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "review",
              "scheduled",
              "publishing",
              "published",
              "partial",
              "failed",
              "rejected",
              "expired"
            ]
          },
          "text": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "media": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Target"
            }
          },
          "publishAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "timezone": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "dryRun": {
            "type": "boolean"
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deletionRequestedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "review": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "by": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "by",
              "at",
              "note"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "status",
          "text",
          "title",
          "media",
          "targets",
          "publishAt",
          "timezone",
          "tags",
          "metadata",
          "dryRun",
          "publishedAt",
          "deletionRequestedAt",
          "createdBy",
          "review",
          "createdAt",
          "updatedAt"
        ]
      },
      "TargetCheck": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/PlatformId"
          },
          "valid": {
            "type": "boolean"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "characters": {
            "type": "integer"
          },
          "characterLimit": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "accountId",
          "platform",
          "valid",
          "errors",
          "warnings",
          "characters",
          "characterLimit"
        ]
      },
      "Validation": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "validation"
          },
          "valid": {
            "type": "boolean"
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TargetCheck"
            }
          },
          "accountIssues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "accountId": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "accountId",
                "message"
              ]
            }
          }
        },
        "required": [
          "object",
          "valid",
          "targets",
          "accountIssues"
        ]
      },
      "PostBatchResult": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "batch"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "ok"
              ],
              "properties": {
                "ok": {
                  "type": "boolean"
                },
                "post": {
                  "$ref": "#/components/schemas/Post"
                },
                "error": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "The error object of the failed item."
                }
              }
            }
          },
          "succeeded": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          }
        },
        "required": [
          "object",
          "results",
          "succeeded",
          "failed"
        ]
      },
      "UnpublishResult": {
        "type": "object",
        "required": [
          "ok"
        ],
        "additionalProperties": true,
        "properties": {
          "targetId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/PlatformId"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "ok": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "PostDeletion": {
        "type": "object",
        "required": [
          "object",
          "id",
          "deleted",
          "results"
        ],
        "description": "Check deleted, not just the HTTP status: on a partial failure the post is kept and returned.",
        "properties": {
          "object": {
            "type": "string",
            "const": "post"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnpublishResult"
            }
          },
          "post": {
            "$ref": "#/components/schemas/Post"
          }
        }
      },
      "PostUnpublished": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Post"
          },
          {
            "type": "object",
            "properties": {
              "unpublish": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UnpublishResult"
                }
              }
            },
            "required": [
              "unpublish"
            ]
          }
        ]
      },
      "Media": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "media"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "gif",
              "audio",
              "document"
            ]
          },
          "size": {
            "type": [
              "integer",
              "null"
            ]
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "awaiting_upload"
            ]
          },
          "purgedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "uploadedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "url",
          "thumbnailUrl",
          "filename",
          "contentType",
          "kind",
          "size",
          "width",
          "height",
          "durationMs",
          "status",
          "purgedAt",
          "uploadedAt",
          "createdAt"
        ]
      },
      "MediaCreate": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "contentType": {
            "type": "string",
            "description": "MIME type; application/octet-stream is accepted when the file name has a known extension."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "description": "Size in bytes."
          }
        },
        "required": [
          "filename",
          "contentType"
        ]
      },
      "MediaUpload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Media"
          },
          {
            "type": "object",
            "properties": {
              "upload": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "const": "PUT"
                  },
                  "url": {
                    "type": "string",
                    "description": "Send the file bytes here. Use it exactly as returned; it may sit on a separate upload host."
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "method",
                  "url",
                  "headers",
                  "expiresAt"
                ]
              }
            },
            "required": [
              "upload"
            ]
          }
        ]
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "secret": {
            "type": [
              "string",
              "null"
            ],
            "description": "Returned only by POST /webhooks and POST /webhooks/{id}/secret."
          },
          "hasSecret": {
            "type": "boolean"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "lastDeliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "url",
          "hasSecret",
          "events",
          "enabled",
          "headers",
          "lastDeliveredAt",
          "consecutiveFailures",
          "createdAt",
          "updatedAt"
        ]
      },
      "WebhookCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public https address."
          },
          "secret": {
            "type": "string",
            "minLength": 16,
            "maxLength": 255,
            "description": "Signing secret; generated when omitted."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An event type, \"<prefix>.*\" or \"*\"."
            },
            "minItems": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Extra headers sent with every delivery."
          }
        },
        "required": [
          "name",
          "url",
          "events"
        ]
      },
      "WebhookUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public https address."
          },
          "secret": {
            "type": "string",
            "minLength": 16,
            "maxLength": 255,
            "description": "Signing secret; generated when omitted."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An event type, \"<prefix>.*\" or \"*\"."
            },
            "minItems": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Extra headers sent with every delivery."
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_delivery"
          },
          "id": {
            "type": "string"
          },
          "webhookId": {
            "type": "string"
          },
          "eventId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "failed"
            ]
          },
          "statusCode": {
            "type": [
              "integer",
              "null"
            ]
          },
          "attempt": {
            "type": "integer"
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "request": {
            "description": "The event that was sent."
          },
          "response": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "webhookId",
          "eventId",
          "type",
          "url",
          "status",
          "statusCode",
          "attempt",
          "durationMs",
          "request",
          "response",
          "error",
          "createdAt"
        ]
      },
      "WebhookTest": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_test"
          },
          "delivered": {
            "type": "boolean"
          },
          "eventId": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "delivered",
          "eventId"
        ]
      },
      "WebhookRedelivery": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_delivery"
          },
          "redelivered": {
            "type": "boolean"
          },
          "deliveryId": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "redelivered",
          "deliveryId"
        ]
      },
      "WebhookEventType": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ]
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "evt_..."
          },
          "object": {
            "type": "string",
            "const": "event"
          },
          "type": {
            "type": "string",
            "enum": [
              "post.scheduled",
              "post.published",
              "post.partial",
              "post.failed",
              "post.canceled",
              "target.published",
              "target.failed",
              "account.connected",
              "account.disconnected",
              "analytics.synced",
              "trend.detected",
              "ping"
            ]
          },
          "apiVersion": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "post.* events carry post; target.* carry target, account and post; account.* carry account (and reason, reconnectRequired); trend.detected carries niche, video and detectedAt."
          }
        },
        "required": [
          "id",
          "object",
          "type",
          "apiVersion",
          "createdAt",
          "data"
        ]
      },
      "PostMetrics": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "post_metrics"
          },
          "postId": {
            "type": "string"
          },
          "targetId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/PlatformId"
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          },
          "text": {
            "type": "string"
          },
          "remoteId": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "metrics": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "likes": {
                "type": "integer"
              },
              "comments": {
                "type": "integer"
              },
              "shares": {
                "type": "integer"
              },
              "saves": {
                "type": "integer"
              },
              "views": {
                "type": "integer"
              },
              "impressions": {
                "type": "integer"
              },
              "reach": {
                "type": "integer"
              },
              "clicks": {
                "type": "integer"
              },
              "capturedAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "likes",
              "comments",
              "shares",
              "saves",
              "views",
              "impressions",
              "reach",
              "clicks",
              "capturedAt"
            ]
          }
        },
        "required": [
          "object",
          "postId",
          "targetId",
          "accountId",
          "platform",
          "username",
          "text",
          "remoteId",
          "url",
          "publishedAt",
          "metrics"
        ]
      },
      "PostTimeline": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "post_timeline"
          },
          "postId": {
            "type": "string"
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "targetId": {
                  "type": "string"
                },
                "accountId": {
                  "type": "string"
                },
                "platform": {
                  "$ref": "#/components/schemas/PlatformId"
                },
                "points": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "likes": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "comments": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "shares": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "saves": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "views": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "impressions": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "reach": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "at",
                      "likes",
                      "comments",
                      "shares",
                      "saves",
                      "views",
                      "impressions",
                      "reach"
                    ]
                  }
                }
              },
              "required": [
                "targetId",
                "accountId",
                "platform",
                "points"
              ]
            }
          }
        },
        "required": [
          "object",
          "postId",
          "targets"
        ]
      },
      "DailyMetrics": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "daily_metrics"
          },
          "days": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "posts": {
                  "type": "integer"
                },
                "likes": {
                  "type": "integer"
                },
                "comments": {
                  "type": "integer"
                },
                "shares": {
                  "type": "integer"
                },
                "views": {
                  "type": "integer"
                },
                "impressions": {
                  "type": "integer"
                },
                "reach": {
                  "type": "integer"
                }
              },
              "required": [
                "date",
                "posts",
                "likes",
                "comments",
                "shares",
                "views",
                "impressions",
                "reach"
              ]
            }
          }
        },
        "required": [
          "object",
          "days",
          "data"
        ]
      },
      "AnalyticsOverview": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "overview"
          },
          "accounts": {
            "type": "integer"
          },
          "scheduled": {
            "type": "integer"
          },
          "published7d": {
            "type": "integer"
          },
          "failed7d": {
            "type": "integer"
          },
          "drafts": {
            "type": "integer"
          },
          "upcoming": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "publishAt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "platforms": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id",
                "text",
                "publishAt",
                "platforms"
              ]
            }
          }
        },
        "required": [
          "object",
          "accounts",
          "scheduled",
          "published7d",
          "failed7d",
          "drafts",
          "upcoming"
        ]
      },
      "AccountAnalytics": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account_analytics"
          },
          "days": {
            "type": "integer"
          },
          "dates": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "object",
          "days",
          "dates",
          "totals"
        ],
        "additionalProperties": true,
        "description": "Per-account followers, likes, views and platform statistics by day."
      },
      "AccountContent": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account_content"
          },
          "id": {
            "type": "string"
          },
          "account": {
            "type": "object",
            "additionalProperties": true
          },
          "kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "caption": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "account",
          "kind",
          "url",
          "caption"
        ],
        "additionalProperties": true,
        "description": "A post of a connected account with its latest metrics."
      },
      "AnalyticsSync": {
        "type": "object",
        "required": [
          "object",
          "started"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "analytics_sync"
          },
          "started": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "accounts": {
            "type": "integer"
          },
          "synced": {
            "type": "integer"
          }
        }
      },
      "WorkspaceOverview": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "overview"
          },
          "plan": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "studio": {
                "type": "boolean"
              },
              "niches": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "studio",
              "niches"
            ]
          },
          "credits": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "object",
          "plan",
          "credits"
        ],
        "additionalProperties": true,
        "description": "One aggregate of everything open to the caller: credits, publishing, Studio, trends, access."
      },
      "Log": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "log"
          },
          "id": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "description": "api or publishing."
          },
          "method": {
            "type": [
              "string",
              "null"
            ]
          },
          "path": {
            "type": [
              "string",
              "null"
            ]
          },
          "activity": {
            "type": [
              "string",
              "null"
            ]
          },
          "statusCode": {
            "type": [
              "integer",
              "null"
            ]
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "platform": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountId": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "auth": {
            "type": [
              "string",
              "null"
            ]
          },
          "apiKeyId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "at",
          "kind",
          "method",
          "path",
          "activity",
          "statusCode",
          "durationMs",
          "platform",
          "accountId",
          "message",
          "auth",
          "apiKeyId"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "usage"
          },
          "plan": {
            "type": "string",
            "enum": [
              "free",
              "creator",
              "pro",
              "business"
            ]
          },
          "credits": {
            "type": "object",
            "properties": {
              "available": {
                "type": "integer"
              },
              "plan": {
                "type": "integer"
              },
              "pack": {
                "type": "integer"
              },
              "allotment": {
                "type": "integer"
              },
              "renewsAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "available",
              "plan",
              "pack",
              "allotment",
              "renewsAt"
            ]
          },
          "postsThisMonth": {
            "type": "integer"
          },
          "creditUsd": {
            "type": "number",
            "description": "Nominal value of one credit in USD."
          },
          "costs": {
            "type": "object",
            "properties": {
              "post": {
                "type": "integer"
              },
              "xPost": {
                "type": "integer"
              },
              "xLinkPost": {
                "type": "integer"
              },
              "montagePerMinute": {
                "type": "integer"
              },
              "renderPerSecond": {
                "type": "integer"
              },
              "renderMin": {
                "type": "integer"
              }
            },
            "required": [
              "post",
              "xPost",
              "xLinkPost",
              "montagePerMinute",
              "renderPerSecond",
              "renderMin"
            ]
          },
          "plans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "credits": {
                  "type": "integer"
                },
                "priceUsd": {
                  "type": "number"
                },
                "studio": {
                  "type": "boolean"
                },
                "niches": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "name",
                "credits",
                "priceUsd",
                "studio",
                "niches"
              ]
            }
          },
          "packs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "credits": {
                  "type": "integer"
                },
                "priceUsd": {
                  "type": "number"
                }
              },
              "required": [
                "id",
                "credits",
                "priceUsd"
              ],
              "additionalProperties": true
            }
          },
          "profiles": {
            "type": "object",
            "properties": {
              "used": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "freeLimit": {
                "type": "integer"
              },
              "paidLimit": {
                "type": "integer"
              },
              "locked": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "used",
              "limit",
              "freeLimit",
              "paidLimit",
              "locked"
            ]
          }
        },
        "required": [
          "object",
          "plan",
          "credits",
          "postsThisMonth",
          "creditUsd",
          "costs",
          "plans",
          "packs",
          "profiles"
        ]
      },
      "TrendSeed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "hashtag",
              "query",
              "sound"
            ]
          },
          "value": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "type",
          "value"
        ]
      },
      "TrendNiche": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_niche"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "seeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendSeed"
            }
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tiktok",
                "youtube"
              ]
            }
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "minViews": {
            "type": [
              "integer",
              "null"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "presetKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "topic": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "topic",
              "own"
            ]
          },
          "topicNiches": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scan": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "partial",
                  "ready"
                ]
              },
              "seeds": {
                "type": "integer"
              },
              "scanned": {
                "type": "integer"
              },
              "lastScanAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "videos": {
                "type": "integer"
              }
            },
            "required": [
              "status",
              "seeds",
              "scanned",
              "lastScanAt",
              "videos"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "seeds",
          "platforms",
          "languages",
          "minViews",
          "active",
          "presetKey",
          "topic",
          "scope",
          "topicNiches",
          "scan",
          "createdAt",
          "updatedAt"
        ]
      },
      "TrendNicheCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "seeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendSeed"
            },
            "minItems": 1,
            "maxItems": 20
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tiktok",
                "youtube"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "en",
                "ru",
                "es",
                "pt",
                "de",
                "fr",
                "it",
                "tr",
                "uk",
                "pl",
                "ar",
                "hi",
                "id",
                "vi",
                "th",
                "ja",
                "ko",
                "zh"
              ]
            },
            "maxItems": 10
          },
          "minViews": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1000,
            "maximum": 100000000
          },
          "active": {
            "type": "boolean"
          },
          "scope": {
            "type": "string",
            "enum": [
              "topic",
              "own"
            ]
          }
        },
        "required": [
          "name",
          "seeds"
        ]
      },
      "TrendNicheUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "seeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendSeed"
            },
            "minItems": 1,
            "maxItems": 20
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tiktok",
                "youtube"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "en",
                "ru",
                "es",
                "pt",
                "de",
                "fr",
                "it",
                "tr",
                "uk",
                "pl",
                "ar",
                "hi",
                "id",
                "vi",
                "th",
                "ja",
                "ko",
                "zh"
              ]
            },
            "maxItems": 10
          },
          "minViews": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1000,
            "maximum": 100000000
          },
          "active": {
            "type": "boolean"
          },
          "scope": {
            "type": "string",
            "enum": [
              "topic",
              "own"
            ]
          }
        },
        "minProperties": 1
      },
      "TrendPreset": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_preset"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "seeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendSeed"
            }
          }
        },
        "required": [
          "object",
          "key",
          "name",
          "seeds"
        ]
      },
      "TrendSuggestInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "seeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendSeed"
            },
            "maxItems": 20
          },
          "hint": {
            "type": "string",
            "maxLength": 300
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "en",
                "ru",
                "es",
                "pt",
                "de",
                "fr",
                "it",
                "tr",
                "uk",
                "pl",
                "ar",
                "hi",
                "id",
                "vi",
                "th",
                "ja",
                "ko",
                "zh"
              ]
            },
            "maxItems": 10
          }
        },
        "required": [
          "name"
        ]
      },
      "TrendSeedSuggestions": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_seed_suggestions"
          },
          "seeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendSeed"
            }
          }
        },
        "required": [
          "object",
          "seeds"
        ]
      },
      "TrendVideo": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_video"
          },
          "id": {
            "type": "string"
          },
          "platform": {
            "type": "string",
            "enum": [
              "tiktok",
              "youtube"
            ]
          },
          "platformVideoId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "coverUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "duration": {
            "type": [
              "integer",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "author": {
            "type": "object",
            "properties": {
              "handle": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "nickname": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "avatarUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "followers": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "medianViews": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "handle",
              "id",
              "nickname",
              "avatarUrl",
              "followers",
              "medianViews",
              "url"
            ]
          },
          "music": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "title",
              "url"
            ]
          },
          "stats": {
            "type": "object",
            "properties": {
              "views": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "likes": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "comments": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "shares": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "saves": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "views",
              "likes",
              "comments",
              "shares",
              "saves"
            ]
          },
          "ageHours": {
            "type": [
              "number",
              "null"
            ]
          },
          "viewsPerHour": {
            "type": [
              "number",
              "null"
            ]
          },
          "outlierRatio": {
            "type": [
              "number",
              "null"
            ]
          },
          "score": {
            "type": [
              "number",
              "null"
            ]
          },
          "growing": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "lowData": {
            "type": "boolean"
          },
          "promoted": {
            "type": "boolean"
          },
          "fetchedAt": {
            "type": "string",
            "format": "date-time"
          },
          "scoredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "platform",
          "platformVideoId",
          "url",
          "caption",
          "coverUrl",
          "publishedAt",
          "duration",
          "language",
          "author",
          "music",
          "stats",
          "ageHours",
          "viewsPerHour",
          "outlierRatio",
          "score",
          "growing",
          "lowData",
          "promoted",
          "fetchedAt",
          "scoredAt"
        ],
        "additionalProperties": true,
        "description": "Lists add analyzed and niches[]; the single video adds seeds[]."
      },
      "TrendLanguage": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_language"
          },
          "code": {
            "type": "string"
          },
          "videos": {
            "type": "integer"
          }
        },
        "required": [
          "object",
          "code",
          "videos"
        ]
      },
      "TrendSound": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_sound"
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "author": {
            "type": [
              "string",
              "null"
            ]
          },
          "original": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "coverUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "previewUrl": {
            "type": "string"
          },
          "topVideos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "coverUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "views": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "author": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "url",
                "coverUrl",
                "views",
                "author"
              ]
            }
          },
          "url": {
            "type": "string"
          },
          "videos": {
            "type": "integer"
          },
          "viewsPerHour": {
            "type": "integer"
          },
          "views": {
            "type": "integer"
          },
          "topScore": {
            "type": [
              "number",
              "null"
            ]
          },
          "window": {
            "type": "string",
            "enum": [
              "24h",
              "48h",
              "72h"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "title",
          "author",
          "original",
          "coverUrl",
          "previewUrl",
          "topVideos",
          "url",
          "videos",
          "viewsPerHour",
          "views",
          "topScore",
          "window"
        ]
      },
      "TrendBreakdown": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_breakdown"
          },
          "videoId": {
            "type": "string"
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "ru",
              "es"
            ]
          },
          "priceCredits": {
            "type": "integer"
          },
          "purchased": {
            "type": "boolean"
          },
          "refunded": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "none",
              "queued",
              "ready",
              "failed"
            ]
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "summary, hook, format, scenes[], speech, audio, whyItWorks[], recreate."
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "videoId",
          "lang",
          "priceCredits",
          "purchased",
          "refunded",
          "status",
          "result",
          "error",
          "updatedAt"
        ]
      },
      "TrendSettings": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_settings"
          },
          "plan": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "nicheLimit": {
            "type": "integer"
          },
          "nichesUsed": {
            "type": "integer"
          },
          "scanEveryHours": {
            "type": "number"
          },
          "digest": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "plan",
          "enabled",
          "nicheLimit",
          "nichesUsed",
          "scanEveryHours",
          "digest"
        ]
      },
      "TrendSettingsUpdate": {
        "type": "object",
        "properties": {
          "digest": {
            "type": "boolean"
          }
        },
        "required": [
          "digest"
        ]
      },
      "Generator": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "generator"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "label"
        ],
        "additionalProperties": true,
        "description": "A Studio format with its input fields and model readiness."
      },
      "StudioRun": {
        "type": "object",
        "required": [
          "object",
          "id",
          "status"
        ],
        "additionalProperties": true,
        "description": "The detail call adds input, stages, history, targetIds and costs; the list omits the heavy fields.",
        "properties": {
          "object": {
            "type": "string",
            "const": "studio_run"
          },
          "id": {
            "type": "string"
          },
          "generator": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "description": "auto or step."
          },
          "status": {
            "type": "string",
            "description": "draft, queued, running, review, ready, posting, posted or failed."
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          },
          "mediaIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scheduledFor": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "approvedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "postId": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StudioRunCreate": {
        "type": "object",
        "properties": {
          "generator": {
            "type": "string",
            "description": "Generator id from GET /studio/generators."
          },
          "input": {
            "type": "object",
            "additionalProperties": true,
            "description": "Fields of the chosen generator."
          },
          "mode": {
            "type": "string",
            "enum": [
              "auto",
              "step"
            ]
          },
          "draft": {
            "type": "boolean"
          },
          "requestKey": {
            "type": "string",
            "format": "uuid",
            "description": "Repeating the call with the same key returns the original run."
          },
          "scheduledFor": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "generator"
        ]
      },
      "StudioRunUpdate": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "text": {
            "type": "string",
            "maxLength": 10000
          },
          "input": {
            "type": "object",
            "additionalProperties": true
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50
          },
          "scheduledFor": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "revision"
        ]
      },
      "StudioRevision": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "revision"
        ]
      },
      "StudioRevisionOptional": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "StudioRedo": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "tweak": {
            "type": "object",
            "additionalProperties": true,
            "description": "Changed fields for the regenerated stage."
          }
        }
      },
      "StudioBudget": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "maxAiCredits": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          }
        },
        "required": [
          "revision",
          "maxAiCredits"
        ]
      },
      "StudioPost": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "publishAt": {
            "anyOf": [
              {
                "type": "string",
                "const": "now"
              },
              {
                "type": "string",
                "format": "date-time"
              }
            ],
            "description": "Omit for a post draft."
          },
          "text": {
            "type": "string",
            "maxLength": 20000
          }
        },
        "required": [
          "accountIds"
        ]
      },
      "StudioVideoAction": {
        "type": "object",
        "properties": {
          "taskId": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "action": {
            "type": "string",
            "enum": [
              "accept",
              "redo",
              "save",
              "replace",
              "restore",
              "resume"
            ]
          },
          "output": {},
          "feedback": {
            "type": "string",
            "maxLength": 2000
          },
          "url": {
            "type": "string",
            "maxLength": 2048
          },
          "historyRevision": {
            "type": "integer",
            "minimum": 1
          },
          "videoModel": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "taskId",
          "revision",
          "action"
        ]
      },
      "StudioEstimateInput": {
        "type": "object",
        "properties": {
          "generator": {
            "type": "string",
            "enum": [
              "video",
              "chat-video"
            ]
          },
          "input": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "generator",
          "input"
        ]
      },
      "StudioAttention": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "scheduledFor": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "status": {
                  "type": "string"
                },
                "waiting": {
                  "type": "integer"
                },
                "next": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "title",
                "scheduledFor",
                "status",
                "waiting",
                "next"
              ],
              "additionalProperties": true
            }
          }
        },
        "required": [
          "count",
          "data"
        ]
      },
      "StudioBrand": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "audience": {
            "type": "string",
            "maxLength": 2000
          },
          "language": {
            "type": "string",
            "maxLength": 64
          },
          "tone": {
            "type": "string",
            "maxLength": 1000
          },
          "facts": {
            "type": "string",
            "maxLength": 6000
          },
          "avoid": {
            "type": "string",
            "maxLength": 2000
          },
          "examples": {
            "type": "string",
            "maxLength": 6000
          },
          "logo": {
            "type": "string",
            "maxLength": 1024
          },
          "accent": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "dailyLimit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 30
          },
          "subtitleStyle": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "Autopilot": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "autopilot"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "generator": {
            "type": "string"
          },
          "config": {
            "type": "object",
            "additionalProperties": true
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "feedId": {
            "type": [
              "string",
              "null"
            ]
          },
          "topicMode": {
            "type": "string"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "theme": {
            "type": [
              "string",
              "null"
            ]
          },
          "frequency": {
            "type": "string"
          },
          "timeOfDay": {
            "type": "string"
          },
          "days": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "windowFrom": {
            "type": [
              "string",
              "null"
            ]
          },
          "windowTo": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "cadence": {
            "type": "string",
            "description": "The schedule in words."
          },
          "nextSlotAt": {
            "type": "string",
            "format": "date-time"
          },
          "keepReady": {
            "type": "integer"
          },
          "leadHours": {
            "type": "integer"
          },
          "needsApproval": {
            "type": "boolean"
          },
          "dedupeWindow": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "pausedReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastPostedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "generator",
          "config",
          "accountIds",
          "feedId",
          "topicMode",
          "topics",
          "theme",
          "frequency",
          "timeOfDay",
          "days",
          "windowFrom",
          "windowTo",
          "timezone",
          "cadence",
          "nextSlotAt",
          "keepReady",
          "leadHours",
          "needsApproval",
          "dedupeWindow",
          "enabled",
          "pausedReason",
          "lastRunAt",
          "lastPostedAt"
        ],
        "additionalProperties": true,
        "description": "A rubric: a generator on a schedule. The list adds the state of its ready pieces."
      },
      "AutopilotCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "generator": {
            "type": "string",
            "description": "Generator id from GET /studio/generators."
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "Generator input for every piece this rubric makes."
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50
          },
          "feedId": {
            "type": [
              "string",
              "null"
            ]
          },
          "topicMode": {
            "type": "string",
            "enum": [
              "feed",
              "list",
              "model"
            ]
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 300
            },
            "maxItems": 200
          },
          "theme": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 512
          },
          "frequency": {
            "type": "string",
            "pattern": "^(daily|days:[a-z,]+|hours:\\d+)$"
          },
          "timeOfDay": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "days": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "enum": [
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat",
                "sun"
              ]
            },
            "maxItems": 7
          },
          "windowFrom": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "windowTo": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "IANA time zone name."
          },
          "keepReady": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "leadHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 168
          },
          "needsApproval": {
            "type": "boolean"
          },
          "dedupeWindow": {
            "type": "integer",
            "minimum": 0,
            "maximum": 200
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "generator",
          "frequency",
          "timeOfDay"
        ]
      },
      "AutopilotUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "generator": {
            "type": "string",
            "description": "Generator id from GET /studio/generators."
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "Generator input for every piece this rubric makes."
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50
          },
          "feedId": {
            "type": [
              "string",
              "null"
            ]
          },
          "topicMode": {
            "type": "string",
            "enum": [
              "feed",
              "list",
              "model"
            ]
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 300
            },
            "maxItems": 200
          },
          "theme": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 512
          },
          "frequency": {
            "type": "string",
            "pattern": "^(daily|days:[a-z,]+|hours:\\d+)$"
          },
          "timeOfDay": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "days": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "enum": [
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat",
                "sun"
              ]
            },
            "maxItems": 7
          },
          "windowFrom": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "windowTo": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "IANA time zone name."
          },
          "keepReady": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "leadHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 168
          },
          "needsApproval": {
            "type": "boolean"
          },
          "dedupeWindow": {
            "type": "integer",
            "minimum": 0,
            "maximum": 200
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AutopilotBatch": {
        "type": "object",
        "properties": {
          "topics": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            },
            "minItems": 1,
            "maxItems": 7
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "batchKey": {
            "type": "string",
            "format": "uuid"
          },
          "generate": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "topics",
          "startAt",
          "batchKey"
        ]
      },
      "Source": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "source"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "rss",
              "website",
              "telegram"
            ]
          },
          "address": {
            "type": "string"
          },
          "include": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "exclude": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "intervalMin": {
            "type": "integer"
          },
          "mediaOnly": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastCheckedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "type",
          "address",
          "include",
          "exclude",
          "intervalMin",
          "mediaOnly",
          "status",
          "lastError",
          "lastCheckedAt",
          "createdAt"
        ]
      },
      "SourceCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "type": {
            "type": "string",
            "enum": [
              "rss",
              "website",
              "telegram"
            ]
          },
          "address": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "include": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "maxItems": 20
          },
          "exclude": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "maxItems": 20
          },
          "intervalMin": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440
          },
          "mediaOnly": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "type",
          "address"
        ]
      },
      "SourceUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "address": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "include": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "maxItems": 20
          },
          "exclude": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "maxItems": 20
          },
          "intervalMin": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440
          },
          "mediaOnly": {
            "type": "boolean"
          }
        }
      },
      "SourceItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "source_item"
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "media": {
            "type": "array",
            "items": {}
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "usedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dropped": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "title",
          "url",
          "media",
          "publishedAt",
          "usedAt",
          "dropped"
        ]
      },
      "Feed": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "feed"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sourceIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "sourceIds",
          "createdAt"
        ]
      },
      "FeedCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "sourceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 50
          }
        },
        "required": [
          "name",
          "sourceIds"
        ]
      },
      "FeedUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "sourceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 50
          }
        }
      },
      "GenerationCatalog": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "generation_catalog"
          },
          "plan": {
            "type": "string"
          },
          "unlocked": {
            "type": "boolean"
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "transcribers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "preferences": {
            "type": "object",
            "properties": {
              "transcriber": {
                "type": "string"
              }
            },
            "required": [
              "transcriber"
            ]
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "required": [
          "object",
          "plan",
          "unlocked",
          "providers",
          "models",
          "transcribers",
          "preferences",
          "keys"
        ],
        "additionalProperties": true
      },
      "GenerationQuoteInput": {
        "type": "object",
        "properties": {
          "paymentSource": {
            "type": "string",
            "enum": [
              "own",
              "balance"
            ]
          },
          "paymentRequestKey": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Required when spending from the balance; the same key with the same input replays the stored result."
          },
          "model": {
            "type": "string",
            "minLength": 2
          },
          "kind": {
            "type": "string"
          },
          "prompt": {
            "type": "string",
            "maxLength": 32000
          },
          "brief": {
            "type": "string",
            "maxLength": 300000
          },
          "text": {
            "type": "string",
            "maxLength": 1500
          },
          "seconds": {
            "type": "number",
            "minimum": 1,
            "maximum": 30
          },
          "image": {
            "type": "string",
            "maxLength": 2000
          },
          "reference": {
            "type": "string",
            "maxLength": 2000
          },
          "structured": {
            "type": "boolean"
          }
        },
        "required": [
          "model"
        ]
      },
      "GenerationTextInput": {
        "type": "object",
        "properties": {
          "paymentSource": {
            "type": "string",
            "enum": [
              "own",
              "balance"
            ]
          },
          "paymentRequestKey": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Required when spending from the balance; the same key with the same input replays the stored result."
          },
          "model": {
            "type": "string",
            "minLength": 2
          },
          "brief": {
            "type": "string",
            "minLength": 3,
            "maxLength": 4000
          },
          "language": {
            "type": "string",
            "maxLength": 32
          },
          "tone": {
            "type": "string",
            "maxLength": 64
          },
          "maxChars": {
            "type": "integer",
            "minimum": 50,
            "maximum": 4000
          },
          "hashtags": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          }
        },
        "required": [
          "model",
          "brief"
        ]
      },
      "GenerationImageInput": {
        "type": "object",
        "properties": {
          "paymentSource": {
            "type": "string",
            "enum": [
              "own",
              "balance"
            ]
          },
          "paymentRequestKey": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Required when spending from the balance; the same key with the same input replays the stored result."
          },
          "model": {
            "type": "string",
            "minLength": 2
          },
          "prompt": {
            "type": "string",
            "minLength": 3,
            "maxLength": 2000
          },
          "aspect": {
            "type": "string",
            "maxLength": 8
          },
          "reference": {
            "type": "string",
            "maxLength": 2000,
            "description": "Direct URL of a reference image."
          }
        },
        "required": [
          "model",
          "prompt"
        ]
      },
      "GenerationVideoInput": {
        "type": "object",
        "properties": {
          "paymentSource": {
            "type": "string",
            "enum": [
              "own",
              "balance"
            ]
          },
          "paymentRequestKey": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Required when spending from the balance; the same key with the same input replays the stored result."
          },
          "model": {
            "type": "string",
            "minLength": 2
          },
          "prompt": {
            "type": "string",
            "minLength": 3,
            "maxLength": 2000
          },
          "aspect": {
            "type": "string",
            "maxLength": 8
          },
          "seconds": {
            "type": "integer",
            "minimum": 2,
            "maximum": 20
          },
          "image": {
            "type": "string",
            "maxLength": 2000,
            "description": "Direct URL of the key frame; required by image-to-video models."
          }
        },
        "required": [
          "model",
          "prompt"
        ]
      },
      "GenerationTranscribeInput": {
        "type": "object",
        "properties": {
          "paymentSource": {
            "type": "string",
            "enum": [
              "own",
              "balance"
            ]
          },
          "paymentRequestKey": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Required when spending from the balance; the same key with the same input replays the stored result."
          },
          "url": {
            "type": "string",
            "minLength": 4,
            "maxLength": 2000
          },
          "model": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64
          },
          "language": {
            "type": "string",
            "maxLength": 8
          }
        },
        "required": [
          "url"
        ]
      },
      "GenerationResult": {
        "type": "object",
        "additionalProperties": true,
        "description": "The finished generation: the job fields plus the output of that kind (text variants, media, transcript)."
      },
      "GenerationJob": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "generation"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "paymentSource": {
            "type": [
              "string",
              "null"
            ]
          },
          "billingState": {
            "type": [
              "string",
              "null"
            ],
            "description": "reserved, submitted, uncertain, settled or refunded."
          },
          "reservedCredits": {
            "type": [
              "integer",
              "null"
            ]
          },
          "chargedCredits": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mediaId": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "output": {},
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "kind",
          "provider",
          "model",
          "status",
          "paymentSource",
          "billingState",
          "reservedCredits",
          "chargedCredits",
          "mediaId",
          "error",
          "output",
          "createdAt",
          "finishedAt"
        ]
      },
      "Voice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "VoiceList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Voice"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as ?cursor= to get the next page; null on the last page."
          },
          "connected": {
            "type": "boolean"
          },
          "language": {
            "type": "string"
          },
          "selected": {},
          "selectionUnavailable": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "data",
          "hasMore",
          "nextCursor",
          "connected",
          "language",
          "selected"
        ]
      },
      "RenderTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "seconds": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "label",
          "width",
          "height",
          "seconds"
        ],
        "additionalProperties": true
      },
      "RenderInput": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "description": "Template id from GET /render/templates."
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Template variables: strings, numbers, string arrays or objects."
          },
          "seconds": {
            "type": "integer",
            "minimum": 3,
            "maximum": 60,
            "description": "Must equal the template duration when sent."
          }
        },
        "required": [
          "template",
          "data"
        ]
      },
      "RenderQuote": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string"
          },
          "runner": {
            "type": "string"
          },
          "seconds": {
            "type": "number"
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "credits": {
            "type": "integer"
          }
        },
        "required": [
          "template",
          "runner",
          "seconds",
          "width",
          "height",
          "credits"
        ]
      },
      "RenderJob": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "render_job"
          },
          "id": {
            "type": "string"
          },
          "template": {
            "type": "string"
          },
          "runner": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "seconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "costUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "mediaId": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "template",
          "runner",
          "status",
          "seconds",
          "costUsd",
          "mediaId",
          "error",
          "createdAt"
        ]
      },
      "RenderResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "mediaId": {
            "type": "string"
          },
          "credits": {
            "type": "integer"
          },
          "runner": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "url",
          "mediaId",
          "credits",
          "runner"
        ]
      },
      "ProfileDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "profile"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "id",
          "deleted"
        ]
      },
      "AccountDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "id",
          "deleted"
        ]
      },
      "MediaDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "media"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "id",
          "deleted"
        ]
      },
      "WebhookDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "id",
          "deleted"
        ]
      },
      "TrendNicheDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "trend_niche"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "id",
          "deleted"
        ]
      },
      "AutopilotDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "autopilot"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "id",
          "deleted"
        ]
      },
      "SourceDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "source"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "id",
          "deleted"
        ]
      },
      "FeedDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "feed"
          },
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "id",
          "deleted"
        ]
      }
    }
  }
}
