{
  "openapi": "3.0.1",
  "info": {
    "title": "Upload-Post API",
    "description": "Upload-Post is a unified social media API that allows you to upload videos, photos, text, and documents to 22 social media platforms (TikTok, Instagram, LinkedIn, YouTube, Facebook, X/Twitter, Threads, Pinterest, Bluesky, Reddit, Discord, Telegram, WordPress and more) with a single API call. Features include scheduling, queue system, async uploads, FFmpeg media processing, analytics, webhooks, and white-label user management.",
    "version": "1.0.0",
    "contact": {
      "name": "Upload-Post Support",
      "url": "https://upload-post.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://upload-post.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://api.upload-post.com/api",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "Telegram",
      "description": "Telegram through your own bot: chat data and analytics, Stars and payments, chat management, bot profile, commands and sticker sets, updates and direct messages."
    },
    {
      "name": "Content Upload",
      "description": "Upload video, photo, text, and document content to social media platforms."
    },
    {
      "name": "Upload Management",
      "description": "Check upload status, view history, and manage scheduled posts."
    },
    {
      "name": "Queue System",
      "description": "Configure and preview the automatic post queue."
    },
    {
      "name": "Platform Integration",
      "description": "Retrieve platform-specific data: Facebook pages, LinkedIn pages, Pinterest boards, Reddit posts, and analytics."
    },
    {
      "name": "User Management",
      "description": "Create, list, get, and delete user profiles."
    },
    {
      "name": "Authentication",
      "description": "Verify API keys, generate and validate JWT tokens for white-label integration."
    },
    {
      "name": "FFmpeg Editor",
      "description": "Process and transform media using FFmpeg commands on Upload-Post infrastructure."
    },
    {
      "name": "Webhooks",
      "description": "Configure real-time webhook and Telegram notifications for upload events."
    },
    {
      "name": "Instagram Interactions",
      "description": "Retrieve Instagram media, comments, conversations, and send direct messages or private replies."
    },
    {
      "name": "Bluesky",
      "description": "Bluesky reads (read-only XRPC gateway, post engagement, profiles, search, followers) and notifications; actions, profile, graph, moderation and drafts. Likes, reposts, follows and list additions share daily limits per Bluesky account (200), per Upload-Post account and app-wide (Bluesky Developer Guidelines); reports, 20 per account per day. Repeating the same action within a short window returns the first answer (replayed: true)."
    },
    {
      "name": "Teams and Approvals",
      "description": "Team roles, post approval queue, end-client approval and the team activity log. Members call the API with their own credentials plus `X-Act-As-User: <owner email>`."
    },
    {
      "name": "Feedback",
      "description": "Report an unclear error, a doc that does not match, a bug or a missing feature to the Upload-Post team."
    },
    {
      "name": "Google Business",
      "description": "Google Business Profile: locations, reviews, posts, media, verification, attributes, menus, services, lodging, place actions, performance and account administration. Some writes are switched off or need confirm: true (see each operation)."
    },
    {
      "name": "ChatGPT Ads",
      "description": "Ads in ChatGPT through the customer's own OpenAI ad account: accounts, campaigns, ad groups, ads, creatives, insights and one-call promote."
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/uploadposts/telegram/payments/unanswered": {
      "get": {
        "operationId": "getTelegramUnansweredPayments",
        "summary": "Payment queries an automatic rule failed to answer",
        "description": "Last 30 days: failed, unknown or expired automatic pre-checkout/shipping answers.",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-100, default 50.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Unanswered payment queries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/chat-info": {
      "get": {
        "operationId": "getTelegramChatInfo",
        "summary": "Telegram chat details",
        "description": "getChat, getChatMemberCount, administrators and the bot's rights for the profile's Telegram chat. Telegram's Bot API has no views or channel statistics.",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_administrators",
            "in": "query",
            "required": false,
            "description": "Default true.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "return_bots",
            "in": "query",
            "required": false,
            "description": "Also list other admin bots.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chat details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "patch": {
        "operationId": "telegramUpdateChatInfo",
        "summary": "Update the Telegram chat info",
        "description": "setChatTitle, setChatDescription, setChatPhoto, deleteChatPhoto, setChatPermissions, setChatStickerSet, deleteChatStickerSet. Needs can_change_info (can_restrict_members for permissions).",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "title": {
                    "type": "string",
                    "description": "1-128 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "0-255 characters."
                  },
                  "clear_description": {
                    "type": "boolean"
                  },
                  "photo": {
                    "type": "string",
                    "description": "Multipart file.",
                    "format": "binary"
                  },
                  "photo_url": {
                    "type": "string"
                  },
                  "delete_photo": {
                    "type": "boolean"
                  },
                  "permissions": {
                    "type": "object",
                    "description": "ChatPermissions: only the keys sent change (merged with the current permissions); the response returns the resulting set."
                  },
                  "use_independent_chat_permissions": {
                    "type": "boolean"
                  },
                  "sticker_set_name": {
                    "type": "string"
                  },
                  "delete_sticker_set": {
                    "type": "boolean"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "title": {
                    "type": "string",
                    "description": "1-128 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "0-255 characters."
                  },
                  "clear_description": {
                    "type": "boolean"
                  },
                  "photo": {
                    "type": "string",
                    "description": "Multipart file.",
                    "format": "binary"
                  },
                  "photo_url": {
                    "type": "string"
                  },
                  "delete_photo": {
                    "type": "boolean"
                  },
                  "permissions": {
                    "type": "object",
                    "description": "ChatPermissions: only the keys sent change (merged with the current permissions); the response returns the resulting set."
                  },
                  "use_independent_chat_permissions": {
                    "type": "boolean"
                  },
                  "sticker_set_name": {
                    "type": "string"
                  },
                  "delete_sticker_set": {
                    "type": "boolean"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/boosts": {
      "get": {
        "operationId": "getTelegramBoosts",
        "summary": "Telegram chat boosts",
        "description": "With user_id: getUserChatBoosts. Without it: active boosts received as updates.",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "description": "Telegram user id.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Boosts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/stars": {
      "get": {
        "operationId": "getTelegramStarBalance",
        "summary": "Bot Telegram Stars balance",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "StarAmount.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/stars/transactions": {
      "get": {
        "operationId": "getTelegramStarTransactions",
        "summary": "Bot Telegram Stars transactions",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Transactions to skip.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-100, default 100.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "StarTransaction list with next_offset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/invoices": {
      "post": {
        "operationId": "sendTelegramInvoice",
        "summary": "Send a Telegram invoice",
        "description": "sendInvoice in Telegram Stars (XTR) or a provider currency. An invoice that spends the bot's Stars (paid broadcast) is off by default: 503 `telegram_stars_spend_disabled`.",
        "tags": [
          "Telegram"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "title",
                  "description",
                  "payload",
                  "prices"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "payload": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string",
                    "default": "XTR"
                  },
                  "prices": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "provider_token": {
                    "type": "string"
                  },
                  "max_tip_amount": {
                    "type": "integer"
                  },
                  "suggested_tip_amounts": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "photo_url": {
                    "type": "string"
                  },
                  "need_name": {
                    "type": "boolean"
                  },
                  "need_phone_number": {
                    "type": "boolean"
                  },
                  "need_email": {
                    "type": "boolean"
                  },
                  "need_shipping_address": {
                    "type": "boolean"
                  },
                  "is_flexible": {
                    "type": "boolean"
                  },
                  "provider_data": {
                    "type": "string"
                  },
                  "chat_id": {
                    "type": "string",
                    "description": "Defaults to the connected chat."
                  },
                  "start_parameter": {
                    "type": "string"
                  },
                  "message_thread_id": {
                    "type": "integer"
                  },
                  "disable_notification": {
                    "type": "boolean"
                  },
                  "protect_content": {
                    "type": "boolean"
                  },
                  "allow_paid_broadcast": {
                    "type": "boolean",
                    "description": "Spends 0.1 Stars per message; requires confirm."
                  },
                  "reply_markup": {
                    "type": "object"
                  },
                  "confirm": {
                    "type": "boolean"
                  },
                  "suggested_post_parameters": {
                    "type": "object",
                    "description": "With a price the bot pays it on approval: needs suggested_post_max_amount, confirm and idempotency_key."
                  },
                  "suggested_post_max_amount": {
                    "type": "integer"
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 128,
                    "description": "Required when the invoice spends Stars."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice message sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/invoice-links": {
      "post": {
        "operationId": "createTelegramInvoiceLink",
        "summary": "Create a Telegram invoice link",
        "description": "createInvoiceLink; subscription_period=2592000 makes a 30-day Stars subscription.",
        "tags": [
          "Telegram"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "title",
                  "description",
                  "payload",
                  "prices"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 32
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "payload": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string",
                    "default": "XTR"
                  },
                  "prices": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "provider_token": {
                    "type": "string"
                  },
                  "max_tip_amount": {
                    "type": "integer"
                  },
                  "suggested_tip_amounts": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "photo_url": {
                    "type": "string"
                  },
                  "need_name": {
                    "type": "boolean"
                  },
                  "need_phone_number": {
                    "type": "boolean"
                  },
                  "need_email": {
                    "type": "boolean"
                  },
                  "need_shipping_address": {
                    "type": "boolean"
                  },
                  "is_flexible": {
                    "type": "boolean"
                  },
                  "provider_data": {
                    "type": "string"
                  },
                  "subscription_period": {
                    "type": "integer",
                    "enum": [
                      2592000
                    ]
                  },
                  "business_connection_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "invoice_link.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/stars/refund": {
      "post": {
        "operationId": "refundTelegramStarPayment",
        "summary": "Refund a Telegram Stars payment",
        "description": "refundStarPayment. Requires confirm=true. Never retried automatically; 504 telegram_outcome_unknown if the result could not be confirmed.",
        "tags": [
          "Telegram"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "user_id",
                  "telegram_payment_charge_id",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "user_id": {
                    "type": "integer"
                  },
                  "telegram_payment_charge_id": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 128
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refunded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/stars/subscription": {
      "post": {
        "operationId": "editTelegramStarSubscription",
        "summary": "Cancel or re-enable a Stars subscription",
        "tags": [
          "Telegram"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "user_id",
                  "telegram_payment_charge_id",
                  "is_canceled",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "user_id": {
                    "type": "integer"
                  },
                  "telegram_payment_charge_id": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "is_canceled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subscription updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/gifts": {
      "get": {
        "operationId": "getTelegramAvailableGifts",
        "summary": "Gifts the bot can send",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gifts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "sendTelegramGift",
        "summary": "Send a gift from the bot's Stars",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_stars_spend_disabled` until the feature is available.\n\nsendGift. Spends the bot's Stars. Requires confirm=true and max_star_count (checked against the current price).",
        "tags": [
          "Telegram"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "gift_id",
                  "max_star_count",
                  "confirm",
                  "idempotency_key"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "user_id": {
                    "type": "integer"
                  },
                  "chat_id": {
                    "type": "string"
                  },
                  "gift_id": {
                    "type": "string"
                  },
                  "max_star_count": {
                    "type": "integer"
                  },
                  "pay_for_upgrade": {
                    "type": "boolean"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "text_parse_mode": {
                    "type": "string"
                  },
                  "text_entities": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 128
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gift sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "503": {
            "description": "Not generally available yet. error_code: `telegram_stars_spend_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "telegram_stars_spend_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/gifts/premium": {
      "post": {
        "operationId": "giftTelegramPremium",
        "summary": "Gift Telegram Premium from the bot's Stars",
        "tags": [
          "Telegram"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "user_id",
                  "month_count",
                  "star_count",
                  "confirm",
                  "idempotency_key"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "user_id": {
                    "type": "integer"
                  },
                  "month_count": {
                    "type": "integer",
                    "enum": [
                      3,
                      6,
                      12
                    ]
                  },
                  "star_count": {
                    "type": "integer",
                    "enum": [
                      1000,
                      1500,
                      2500
                    ]
                  },
                  "text": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 128
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Premium gifted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "503": {
            "description": "Not generally available yet. error_code: `telegram_stars_spend_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "telegram_stars_spend_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_stars_spend_disabled` until the feature is available.\n\nSpends the bot's Stars.",
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/gifts/owned": {
      "get": {
        "operationId": "getTelegramOwnedGifts",
        "summary": "Gifts owned by a user or chat",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "description": "getUserGifts.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "chat_id",
            "in": "query",
            "required": false,
            "description": "getChatGifts; default the connected chat.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "next_offset of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-100.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "exclude_unlimited",
            "in": "query",
            "required": false,
            "description": "Official filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "exclude_limited_upgradable",
            "in": "query",
            "required": false,
            "description": "Official filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "exclude_limited_non_upgradable",
            "in": "query",
            "required": false,
            "description": "Official filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "exclude_from_blockchain",
            "in": "query",
            "required": false,
            "description": "Official filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "exclude_unique",
            "in": "query",
            "required": false,
            "description": "Official filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort_by_price",
            "in": "query",
            "required": false,
            "description": "Official filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "exclude_unsaved",
            "in": "query",
            "required": false,
            "description": "Official filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "exclude_saved",
            "in": "query",
            "required": false,
            "description": "Official filter.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OwnedGifts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/gifts/unique": {
      "get": {
        "operationId": "getTelegramUniqueGift",
        "summary": "A unique gift by name",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "UniqueGift.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/telegram/payments/settings": {
      "get": {
        "operationId": "getTelegramPaymentSettings",
        "summary": "Automatic pre-checkout rules",
        "tags": [
          "Telegram"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Settings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "description": "**The automatic answers need the bot's updates turned on (POST /api/uploadposts/telegram/updates).**"
      },
      "put": {
        "operationId": "updateTelegramPaymentSettings",
        "summary": "Set automatic pre-checkout rules",
        "description": "**The automatic answers need the bot's updates turned on (POST /api/uploadposts/telegram/updates).**\n\nTelegram cancels a checkout not answered within 10 seconds; with a rule Upload-Post answers at once (needs update receiving for the bot).",
        "tags": [
          "Telegram"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "pre_checkout": {
                    "type": "string",
                    "enum": [
                      "off",
                      "approve",
                      "reject"
                    ]
                  },
                  "max_total_amount": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    },
                    "description": "Required for approve: maximum order total per currency, e.g. {\"XTR\": 500}. Setting pre_checkout to off without it clears the stored value."
                  },
                  "allowed_payload_prefixes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "error_message": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "shipping": {
                    "type": "string",
                    "enum": [
                      "off",
                      "static"
                    ]
                  },
                  "shipping_options": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "shipping_countries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "only_upload_post_invoices": {
                    "type": "boolean",
                    "default": true
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required to save a rule that answers (approve, reject, shipping static)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Settings saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error, profile without Telegram, or Telegram rejected the request (error_code)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/upload": {
      "post": {
        "operationId": "uploadVideo",
        "summary": "Upload video",
        "description": "Upload a video to one or more social media platforms. Supports TikTok, Instagram, LinkedIn, YouTube, Facebook, X (Twitter), Threads, Pinterest, Bluesky, Reddit, Discord, and Telegram. Supports immediate, async, scheduled, and queued uploads.",
        "tags": [
          "Content Upload"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "platform[]",
                  "video"
                ],
                "properties": {
                  "paid_partnership": {
                    "type": "boolean",
                    "description": "[All] Marks the post as sponsored / paid partnership. Mapped to TikTok brand_content_toggle, YouTube hasPaidProductPlacement and X paid_partnership; Facebook and Pinterest also need the sponsor id. Networks without a native label publish without it and get a warning. Network-specific fields win. On TikTok it is not allowed with privacy_level=SELF_ONLY (400 commercial_disclosure_privacy_conflict) and drafts do not carry it. See https://docs.upload-post.com/guides/paid-partnership",
                    "default": false
                  },
                  "x_paid_partnership": {
                    "type": "boolean",
                    "description": "[X] Paid partnership disclosure on the first post. Wins over paid_partnership.",
                    "default": false
                  },
                  "facebook_sponsor_id": {
                    "type": "string",
                    "pattern": "^\\d+$",
                    "description": "[Facebook] Sponsor's Page id for the branded content tag (sponsor_id). Page photos, Page videos (facebook_media_type=VIDEO) and text posts; not Reels or Stories."
                  },
                  "pinterest_sponsor_id": {
                    "type": "string",
                    "pattern": "^\\d+$",
                    "description": "[Pinterest] Sponsor account id for the paid partnership label (sponsor_id). Pinterest closed beta only."
                  },
                  "disclose_commercial": {
                    "type": "boolean",
                    "description": "[TikTok] Disclose post content switch. With true, send your_brand and/or branded_content.",
                    "default": false
                  },
                  "your_brand": {
                    "type": "boolean",
                    "description": "[TikTok] With disclose_commercial: promoting your own business.",
                    "default": false
                  },
                  "branded_content": {
                    "type": "boolean",
                    "description": "[TikTok] With disclose_commercial: paid partnership with a third-party brand. With privacy_level=SELF_ONLY the post is published as PUBLIC_TO_EVERYONE.",
                    "default": false
                  },
                  "user": {
                    "type": "string",
                    "description": "User profile identifier."
                  },
                  "platform[]": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/VideoPlatformEnum"
                    },
                    "description": "Platform(s) to upload to."
                  },
                  "video": {
                    "type": "string",
                    "format": "binary",
                    "description": "The video file to upload (binary file) or a public video URL."
                  },
                  "title": {
                    "type": "string",
                    "description": "Default title/caption of the video. Required for YouTube and Reddit; optional for all other platforms. Platform-specific titles override this."
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional extended text used on LinkedIn commentary, Facebook descriptions, YouTube descriptions, and Pinterest notes. Ignored elsewhere."
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 date/time to schedule publishing (e.g., '2025-12-31T23:45:00Z'). Must be in the future (≤365 days). Omit for immediate upload. Cannot be used with `add_to_queue`."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA timezone identifier (e.g., 'Europe/Madrid', 'America/New_York'). If provided, `scheduled_date` is interpreted in this timezone. Defaults to UTC."
                  },
                  "async_upload": {
                    "type": "boolean",
                    "description": "If true, returns immediately with a `request_id` and processes in the background. If false but upload takes >59s, automatically switches to async.",
                    "default": false
                  },
                  "add_to_queue": {
                    "type": "boolean",
                    "description": "If true, automatically schedules the post to the next available queue slot. Cannot be used with `scheduled_date`.",
                    "default": false
                  },
                  "first_comment": {
                    "type": "string",
                    "description": "Automatically post a first comment after publishing. Supported on Instagram, Facebook, Threads, Bluesky, Reddit, X, YouTube, and LinkedIn."
                  },
                  "instagram_first_comment": {
                    "type": "string",
                    "description": "[Instagram] Platform-specific first comment. Overrides `first_comment`."
                  },
                  "facebook_first_comment": {
                    "type": "string",
                    "description": "[Facebook] Platform-specific first comment. Overrides `first_comment`."
                  },
                  "x_first_comment": {
                    "type": "string",
                    "description": "[X] Platform-specific first comment. Overrides `first_comment`."
                  },
                  "threads_first_comment": {
                    "type": "string",
                    "description": "[Threads] Platform-specific first comment. Overrides `first_comment`."
                  },
                  "youtube_first_comment": {
                    "type": "string",
                    "description": "[YouTube] Platform-specific first comment. Overrides `first_comment`."
                  },
                  "reddit_first_comment": {
                    "type": "string",
                    "description": "[Reddit] Platform-specific first comment. Overrides `first_comment`."
                  },
                  "bluesky_first_comment": {
                    "type": "string",
                    "description": "[Bluesky] Platform-specific first comment. Overrides `first_comment`."
                  },
                  "linkedin_first_comment": {
                    "type": "string",
                    "description": "[LinkedIn] Platform-specific first comment. Overrides `first_comment`."
                  },
                  "first_comment_media[]": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "Image files to attach to the first comment as inline images. Currently supported on Reddit. Not available for scheduled or queued posts. Files only (multipart parts): a URL sent in this field is ignored."
                  },
                  "instagram_title": {
                    "type": "string",
                    "description": "[Instagram] Specific title. Fallbacks to `title`."
                  },
                  "facebook_title": {
                    "type": "string",
                    "description": "[Facebook] Specific title. Fallbacks to `title`. Ignored if facebook_media_type is STORIES."
                  },
                  "tiktok_title": {
                    "type": "string",
                    "description": "[TikTok] Specific title. Fallbacks to `title`."
                  },
                  "linkedin_title": {
                    "type": "string",
                    "description": "[LinkedIn] Specific title. Fallbacks to `title`."
                  },
                  "x_title": {
                    "type": "string",
                    "description": "[X] Specific title. Fallbacks to `title`."
                  },
                  "youtube_title": {
                    "type": "string",
                    "description": "[YouTube] Specific title. Fallbacks to `title`."
                  },
                  "pinterest_title": {
                    "type": "string",
                    "description": "[Pinterest] Specific title. Fallbacks to `title`."
                  },
                  "threads_title": {
                    "type": "string",
                    "description": "[Threads] Specific title. Fallbacks to `title`."
                  },
                  "threads_topic_tag": {
                    "type": "string",
                    "description": "[Threads] A topic tag for the post (1-50 characters). Cannot contain periods (.) or ampersands (&). One tag per post.",
                    "maxLength": 50
                  },
                  "bluesky_title": {
                    "type": "string",
                    "description": "[Bluesky] Specific text. Fallbacks to `title`."
                  },
                  "bluesky_tags": {
                    "type": "string",
                    "description": "[Bluesky] Up to 8 extra hashtags stored on the post without appearing in the text (comma list or JSON array; leading # optional; 64 characters each). More than 8, like any invalid new Bluesky field, fails only the Bluesky result (results.bluesky.success=false, error_code bluesky_invalid_parameter; HTTP 200)."
                  },
                  "bluesky_created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "[Bluesky] Date the post is shown and sorted by (ISO 8601 with timezone, not in the future; 2 minutes of clock skew allowed). Default: now."
                  },
                  "bluesky_thread_overflow": {
                    "type": "boolean",
                    "description": "[Bluesky] Text longer than one post (300 characters): publish the rest as replies under the media post (adds thread_count). Without it the text is cut and a warning is returned."
                  },
                  "bluesky_captions": {
                    "type": "string",
                    "description": "[Bluesky] JSON array of up to 20 subtitle tracks, one per language: [{\"lang\":\"es\",\"url\":\"https://.../es.vtt\"}] or [{\"lang\":\"en\",\"vtt\":\"WEBVTT...\"}]. WebVTT, at most 20,000 bytes each."
                  },
                  "bluesky_video_presentation": {
                    "type": "string",
                    "enum": [
                      "default",
                      "gif"
                    ],
                    "description": "[Bluesky] How the video is presented: default, or gif (looping, muted, no controls)."
                  },
                  "reddit_title": {
                    "type": "string",
                    "description": "[Reddit] Specific title. Fallbacks to `title`."
                  },
                  "privacy_level": {
                    "$ref": "#/components/schemas/TikTokPrivacyLevel"
                  },
                  "disable_duet": {
                    "type": "boolean",
                    "description": "[TikTok] Disable duet feature.",
                    "default": false
                  },
                  "disable_comment": {
                    "type": "boolean",
                    "description": "[TikTok] Disable comments.",
                    "default": false
                  },
                  "disable_stitch": {
                    "type": "boolean",
                    "description": "[TikTok] Disable stitch feature.",
                    "default": false
                  },
                  "post_mode": {
                    "$ref": "#/components/schemas/TikTokPostMode"
                  },
                  "cover_timestamp": {
                    "type": "integer",
                    "description": "[TikTok] Timestamp in milliseconds for video cover.",
                    "default": 1000
                  },
                  "brand_content_toggle": {
                    "type": "boolean",
                    "description": "[TikTok] Set to true for paid partnerships promoting third-party brands.",
                    "default": false
                  },
                  "brand_organic_toggle": {
                    "type": "boolean",
                    "description": "[TikTok] Set to true when promoting the creator's own business.",
                    "default": false
                  },
                  "is_aigc": {
                    "type": "boolean",
                    "description": "[TikTok] Indicates if content is AI-generated.",
                    "default": false
                  },
                  "media_type": {
                    "$ref": "#/components/schemas/InstagramVideoMediaType"
                  },
                  "share_mode": {
                    "$ref": "#/components/schemas/InstagramShareMode"
                  },
                  "share_to_feed": {
                    "type": "boolean",
                    "description": "[Instagram] Whether to share to feed (only for regular Reels, not Trial Reels).",
                    "default": true
                  },
                  "collaborators": {
                    "type": "string",
                    "description": "[Instagram] Comma-separated list of collaborator usernames. Not available for Trial Reels."
                  },
                  "cover_url": {
                    "type": "string",
                    "description": "[Instagram] URL for custom video cover. Alternative to cover_image binary upload."
                  },
                  "cover_image": {
                    "type": "string",
                    "format": "binary",
                    "description": "[Instagram] Binary cover image for Reels (JPEG, max 8MB). If both cover_image and cover_url are provided, cover_url takes precedence."
                  },
                  "audio_name": {
                    "type": "string",
                    "description": "[Instagram] Name of the audio track embedded in your video (Reels only)."
                  },
                  "user_tags": {
                    "type": "string",
                    "description": "[Instagram] Comma-separated list of user tags."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "[Instagram] Instagram location ID."
                  },
                  "is_ai_generated": {
                    "type": "boolean",
                    "description": "Cross-platform AI-disclosure flag. Set to `true` to self-disclose the content as AI-generated. On Instagram (Reels, photos, carousels) it is forwarded as Meta's `is_ai_generated` and shows the \"AI info\" label under the account name; the label cannot be added or removed after publishing. On TikTok it maps to `is_aigc`, on YouTube to `containsSyntheticMedia` and on X to `made_with_ai`; a platform-specific value takes precedence over this alias. See the AI Content Labeling guide.",
                    "default": false
                  },
                  "thumb_offset": {
                    "type": "string",
                    "description": "[Instagram] Timestamp offset for video thumbnail."
                  },
                  "linkedin_description": {
                    "type": "string",
                    "description": "[LinkedIn] Sent as the LinkedIn commentary. If omitted, reuses `title`."
                  },
                  "visibility": {
                    "$ref": "#/components/schemas/LinkedInVisibility"
                  },
                  "target_linkedin_page_id": {
                    "type": "string",
                    "description": "[LinkedIn] LinkedIn page ID to upload to an organization page."
                  },
                  "youtube_description": {
                    "type": "string",
                    "description": "[YouTube] Populates snippet.description. If omitted, uses `title`."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "[YouTube] Array of video tags."
                  },
                  "categoryId": {
                    "type": "string",
                    "description": "[YouTube] Video category ID.",
                    "default": "22"
                  },
                  "privacyStatus": {
                    "$ref": "#/components/schemas/YouTubePrivacyStatus"
                  },
                  "embeddable": {
                    "type": "boolean",
                    "description": "[YouTube] Whether video is embeddable.",
                    "default": true
                  },
                  "license": {
                    "type": "string",
                    "description": "[YouTube] Video license ('youtube' or 'creativeCommon').",
                    "default": "youtube",
                    "enum": [
                      "youtube",
                      "creativeCommon"
                    ]
                  },
                  "publicStatsViewable": {
                    "type": "boolean",
                    "description": "[YouTube] Whether public stats are viewable.",
                    "default": true
                  },
                  "thumbnail": {
                    "type": "string",
                    "format": "binary",
                    "description": "[YouTube] Custom thumbnail image file (JPG/PNG/GIF/BMP, max 50MB). On Shorts it is set once YouTube finishes processing."
                  },
                  "thumbnail_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "[YouTube] Alternative: provide thumbnail as a public URL."
                  },
                  "selfDeclaredMadeForKids": {
                    "type": "boolean",
                    "description": "[YouTube] Explicit declaration for COPPA compliance.",
                    "default": false
                  },
                  "containsSyntheticMedia": {
                    "type": "boolean",
                    "description": "[YouTube] Declaration that video contains AI-generated content.",
                    "default": false
                  },
                  "defaultLanguage": {
                    "type": "string",
                    "description": "[YouTube] Language of title and description (BCP-47 code, e.g., 'es', 'en')."
                  },
                  "defaultAudioLanguage": {
                    "type": "string",
                    "description": "[YouTube] Language of the video audio (BCP-47 code, e.g., 'es-ES', 'en-US')."
                  },
                  "allowedCountries": {
                    "type": "string",
                    "description": "[YouTube] Comma-separated ISO 3166-1 alpha-2 country codes where the video is allowed. Cannot be used with `blockedCountries`. YouTube ignores it on API uploads (not saved); use YouTube Studio."
                  },
                  "blockedCountries": {
                    "type": "string",
                    "description": "[YouTube] Comma-separated ISO 3166-1 alpha-2 country codes where the video is blocked. Cannot be used with `allowedCountries`. YouTube ignores it on API uploads (not saved); use YouTube Studio."
                  },
                  "hasPaidProductPlacement": {
                    "type": "boolean",
                    "description": "[YouTube] Paid product placement / sponsorship declaration (paidProductPlacementDetails). Also set by paid_partnership. If YouTube answers it as false the YouTube result carries a warning.",
                    "default": false
                  },
                  "recordingDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "[YouTube] Recording date (ISO 8601, e.g., '2024-01-15T14:30:00Z')."
                  },
                  "youtube_localizations": {
                    "type": "string",
                    "description": "[YouTube] JSON object with the translated title and description per BCP-47 language, e.g. {\"es\": {\"title\": \"...\", \"description\": \"...\"}}. Requires `defaultLanguage`. Ignored with a warning if YouTube management features are temporarily off."
                  },
                  "youtube_brand_partner": {
                    "type": "string",
                    "description": "[YouTube] Brand partner for creator-initiated brand partner access: channel ID (UC..., 24 characters). Handles are not accepted. Ignored with a warning if YouTube management features are temporarily off."
                  },
                  "facebook_page_id": {
                    "type": "string",
                    "description": "[Facebook] Facebook Page ID where the video will be posted. Required for Facebook. Auto-detected if only one page is connected."
                  },
                  "facebook_description": {
                    "type": "string",
                    "description": "[Facebook] Sent as video description. Ignored for STORIES."
                  },
                  "facebook_media_type": {
                    "$ref": "#/components/schemas/FacebookVideoMediaType"
                  },
                  "video_state": {
                    "type": "string",
                    "description": "[Facebook] Desired state of the video.",
                    "default": "PUBLISHED",
                    "enum": [
                      "DRAFT",
                      "PUBLISHED"
                    ]
                  },
                  "x_long_text_as_post": {
                    "type": "boolean",
                    "description": "[X] When true, publishes long text as a single post instead of a thread.",
                    "default": false
                  },
                  "reply_settings": {
                    "$ref": "#/components/schemas/XReplySettings"
                  },
                  "geo_place_id": {
                    "type": "string",
                    "description": "[X] Place ID for geographic location."
                  },
                  "nullcast": {
                    "type": "boolean",
                    "description": "[X] Whether to publish without broadcasting (promoted-only posts).",
                    "default": false
                  },
                  "for_super_followers_only": {
                    "type": "boolean",
                    "description": "[X] Tweet exclusive for super followers.",
                    "default": false
                  },
                  "community_id": {
                    "type": "string",
                    "description": "[X] Community ID for posting to specific communities."
                  },
                  "share_with_followers": {
                    "type": "boolean",
                    "description": "[X] Share community post with followers.",
                    "default": false
                  },
                  "direct_message_deep_link": {
                    "type": "string",
                    "description": "[X] Link to take conversation to private Direct Message."
                  },
                  "tagged_user_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "[X] Array of user IDs to tag in the media (max 10)."
                  },
                  "reply_to_id": {
                    "type": "string",
                    "description": "[X] ID of the tweet to reply to."
                  },
                  "exclude_reply_user_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "[X] User IDs to exclude from replying. Requires `reply_to_id`."
                  },
                  "pinterest_description": {
                    "type": "string",
                    "description": "[Pinterest] Pin description. If omitted, reuses `title`."
                  },
                  "pinterest_board_id": {
                    "type": "string",
                    "description": "[Pinterest] Pinterest board ID to publish to. Required when platform includes pinterest."
                  },
                  "pinterest_alt_text": {
                    "type": "string",
                    "description": "[Pinterest] Alt text for the video."
                  },
                  "pinterest_link": {
                    "type": "string",
                    "description": "[Pinterest] Destination link for the video Pin."
                  },
                  "pinterest_cover_image_url": {
                    "type": "string",
                    "description": "[Pinterest] URL of an image to use as the video cover."
                  },
                  "pinterest_cover_image_content_type": {
                    "type": "string",
                    "description": "[Pinterest] Content type of the cover image (e.g., image/jpeg)."
                  },
                  "pinterest_cover_image_data": {
                    "type": "string",
                    "description": "[Pinterest] Base64 encoded cover image data."
                  },
                  "pinterest_cover_image_key_frame_time": {
                    "type": "integer",
                    "description": "[Pinterest] Time in milliseconds of the video frame to use as cover."
                  },
                  "subreddit": {
                    "type": "string",
                    "description": "[Reddit] Name of the subreddit (without 'r/'). Required when platform includes reddit."
                  },
                  "flair_id": {
                    "type": "string",
                    "description": "[Reddit] ID of the flair to apply to the post."
                  },
                  "telegram_parse_mode": {
                    "type": "string",
                    "description": "Telegram: MarkdownV2 or HTML.",
                    "enum": [
                      "MarkdownV2",
                      "HTML"
                    ]
                  },
                  "telegram_message_thread_id": {
                    "type": "integer",
                    "description": "Telegram: forum topic to post in."
                  },
                  "telegram_direct_messages_topic_id": {
                    "type": "integer",
                    "description": "Telegram: topic of a channel direct messages chat."
                  },
                  "telegram_disable_notification": {
                    "type": "boolean",
                    "description": "Telegram: send silently."
                  },
                  "telegram_protect_content": {
                    "type": "boolean",
                    "description": "Telegram: disallow forwarding and saving."
                  },
                  "telegram_reply_markup": {
                    "type": "string",
                    "description": "Telegram: InlineKeyboardMarkup JSON with URL buttons."
                  },
                  "telegram_reply_to_message_id": {
                    "type": "integer",
                    "description": "Telegram: publish as a reply to this message."
                  },
                  "telegram_reply_quote": {
                    "type": "string",
                    "description": "Telegram: exact part of the replied message to quote (max 1024)."
                  },
                  "telegram_reply_parameters": {
                    "type": "string",
                    "description": "Telegram: full ReplyParameters JSON (instead of reply_to_message_id/reply_quote)."
                  },
                  "telegram_message_effect_id": {
                    "type": "string",
                    "description": "Telegram: message effect (private chats only)."
                  },
                  "telegram_pin": {
                    "type": "boolean",
                    "description": "Telegram: pin the post after publishing."
                  },
                  "telegram_first_comment_as_reply": {
                    "type": "boolean",
                    "description": "Telegram: first comment as a reply to the post (default true)."
                  },
                  "telegram_suggested_post_parameters": {
                    "type": "string",
                    "description": "Telegram: SuggestedPostParameters JSON (channel direct messages chats only; a price is not available for now)."
                  },
                  "telegram_ephemeral_message_parameters": {
                    "type": "string",
                    "description": "Telegram: EphemeralMessageParameters JSON (receiver_user_id)."
                  },
                  "telegram_allow_paid_broadcast": {
                    "type": "boolean",
                    "description": "Telegram: it can spend your bot's Stars. Paid broadcasts charge 0.1 Telegram Stars per message above the free 30 messages/s, from the bot's balance."
                  },
                  "telegram_pin_notify": {
                    "type": "boolean",
                    "description": "Telegram: with telegram_pin, notify group members about the pin (pinning is silent by default; Telegram never notifies a pin in channels or private chats)."
                  },
                  "telegram_caption_entities": {
                    "type": "string",
                    "description": "Telegram: MessageEntity JSON array for the caption, instead of telegram_parse_mode."
                  },
                  "telegram_has_spoiler": {
                    "type": "boolean",
                    "description": "Telegram: cover the media with a spoiler."
                  },
                  "telegram_show_caption_above_media": {
                    "type": "boolean",
                    "description": "Telegram: show the caption above the media."
                  },
                  "telegram_as_document": {
                    "type": "boolean",
                    "description": "Telegram: send as document (no compression)."
                  },
                  "telegram_caption_overflow": {
                    "type": "string",
                    "description": "Telegram: caption over 1024 characters: truncate (default, the request is refused with 400) or split (the rest goes as a reply).",
                    "enum": [
                      "truncate",
                      "split"
                    ]
                  },
                  "telegram_send_by_url": {
                    "type": "boolean",
                    "description": "Telegram: let Telegram download the URL itself (5 MB photos, 20 MB other files)."
                  },
                  "telegram_paid_star_count": {
                    "type": "integer",
                    "description": "Telegram: paid media price in Telegram Stars (1-25000), paid by the reader.",
                    "minimum": 1,
                    "maximum": 25000
                  },
                  "telegram_paid_payload": {
                    "type": "string",
                    "description": "Telegram: internal reference of the paid media (max 128 bytes)."
                  },
                  "telegram_send_as": {
                    "type": "string",
                    "description": "Telegram: send the video as animation, video_note, live_photo or document.",
                    "enum": [
                      "animation",
                      "video_note",
                      "live_photo",
                      "document"
                    ]
                  },
                  "telegram_cover": {
                    "type": "string",
                    "description": "Telegram: video cover (public URL or file_id)."
                  },
                  "telegram_start_timestamp": {
                    "type": "integer",
                    "description": "Telegram: second where playback starts."
                  },
                  "telegram_thumbnail": {
                    "type": "string",
                    "description": "Telegram: thumbnail URL (JPEG, under 200 kB, max 320x320)."
                  },
                  "telegram_media_urls": {
                    "type": "string",
                    "description": "Telegram: comma-separated photo/video URLs (max 9) sent with the video as one album."
                  },
                  "telegram_live_photo_photo": {
                    "type": "string",
                    "description": "Telegram: still photo URL of a live photo."
                  },
                  "telegram_length": {
                    "type": "integer",
                    "description": "Telegram: video note diameter."
                  },
                  "telegram_send_title": {
                    "type": "boolean",
                    "description": "Telegram: send the text before a video note (default true)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upload completed synchronously or async processing started.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SyncUploadResponse"
                    },
                    {
                      "$ref": "#/components/schemas/AsyncUploadResponse"
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Post scheduled or queued successfully.\n\nOr: Not generally available yet (team roles and post approvals). The caller is an Editor or Contributor team member: the post is NOT published or scheduled; it waits for review (pending_approval) or stays as a draft. Track it with approval_id (`/uploadposts/approvals/{approval_id}`) or with GET /uploadposts/status?request_id=.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/ScheduledUploadResponse"
                        },
                        {
                          "$ref": "#/components/schemas/QueuedUploadResponse"
                        }
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "example": true
                        },
                        "pending_approval": {
                          "type": "boolean",
                          "example": true
                        },
                        "approval_id": {
                          "type": "string"
                        },
                        "approval_status": {
                          "type": "string",
                          "enum": [
                            "pending_approval",
                            "draft"
                          ]
                        },
                        "job_id": {
                          "type": "string",
                          "nullable": true,
                          "example": null
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "scheduled_date": {
                          "type": "string",
                          "nullable": true
                        },
                        "queued": {
                          "type": "boolean"
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden",
            "description": " With team roles on: error_code team_role_forbidden, team_profile_forbidden, team_approvals_disabled, team_page_forbidden or team_page_not_pinned (see TeamAccessError)."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/UploadTooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/upload_photos": {
      "post": {
        "operationId": "uploadPhotos",
        "summary": "Upload photos",
        "description": "Upload photos (and mixed media for Instagram/Threads carousels) to social media platforms. Supports TikTok, Instagram, LinkedIn, Facebook, X (Twitter), Threads, Pinterest, Bluesky, Reddit, Discord, and Telegram.",
        "tags": [
          "Content Upload"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "platform[]",
                  "photos[]"
                ],
                "properties": {
                  "paid_partnership": {
                    "type": "boolean",
                    "description": "[All] Marks the post as sponsored / paid partnership. Mapped to TikTok brand_content_toggle, YouTube hasPaidProductPlacement and X paid_partnership; Facebook and Pinterest also need the sponsor id. Networks without a native label publish without it and get a warning. Network-specific fields win. On TikTok it is not allowed with privacy_level=SELF_ONLY (400 commercial_disclosure_privacy_conflict) and drafts do not carry it. See https://docs.upload-post.com/guides/paid-partnership",
                    "default": false
                  },
                  "x_paid_partnership": {
                    "type": "boolean",
                    "description": "[X] Paid partnership disclosure on the first post. Wins over paid_partnership.",
                    "default": false
                  },
                  "facebook_sponsor_id": {
                    "type": "string",
                    "pattern": "^\\d+$",
                    "description": "[Facebook] Sponsor's Page id for the branded content tag (sponsor_id). Page photos, Page videos (facebook_media_type=VIDEO) and text posts; not Reels or Stories."
                  },
                  "pinterest_sponsor_id": {
                    "type": "string",
                    "pattern": "^\\d+$",
                    "description": "[Pinterest] Sponsor account id for the paid partnership label (sponsor_id). Pinterest closed beta only."
                  },
                  "disclose_commercial": {
                    "type": "boolean",
                    "description": "[TikTok] Disclose post content switch. With true, send your_brand and/or branded_content.",
                    "default": false
                  },
                  "your_brand": {
                    "type": "boolean",
                    "description": "[TikTok] With disclose_commercial: promoting your own business.",
                    "default": false
                  },
                  "branded_content": {
                    "type": "boolean",
                    "description": "[TikTok] With disclose_commercial: paid partnership with a third-party brand. With privacy_level=SELF_ONLY the post is published as PUBLIC_TO_EVERYONE.",
                    "default": false
                  },
                  "user": {
                    "type": "string",
                    "description": "User profile identifier."
                  },
                  "platform[]": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/PhotoPlatformEnum"
                    },
                    "description": "Platform(s) to upload to."
                  },
                  "photos[]": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "Array of photo files. Instagram & Threads also accept videos for mixed carousels."
                  },
                  "title": {
                    "type": "string",
                    "description": "Default title/caption. Required for Reddit; optional for all other platforms. Platform-specific titles override this."
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional extended text used on LinkedIn commentary, Facebook descriptions, Pinterest notes, and Reddit bodies. Ignored elsewhere, including TikTok: a TikTok photo description must be sent as `tiktok_description` (the TikTok caption comes from `tiktok_title`, falling back to `title`)."
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 date/time to schedule publishing. Must be in the future (≤365 days). Cannot be used with `add_to_queue`."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA timezone identifier. Defaults to UTC."
                  },
                  "async_upload": {
                    "type": "boolean",
                    "description": "If true, returns immediately with a `request_id`.",
                    "default": false
                  },
                  "add_to_queue": {
                    "type": "boolean",
                    "description": "If true, schedules to next available queue slot. Cannot be used with `scheduled_date`.",
                    "default": false
                  },
                  "first_comment": {
                    "type": "string",
                    "description": "Automatically post a first comment after publishing."
                  },
                  "instagram_first_comment": {
                    "type": "string",
                    "description": "[Instagram] Platform-specific first comment."
                  },
                  "facebook_first_comment": {
                    "type": "string",
                    "description": "[Facebook] Platform-specific first comment."
                  },
                  "x_first_comment": {
                    "type": "string",
                    "description": "[X] Platform-specific first comment."
                  },
                  "threads_first_comment": {
                    "type": "string",
                    "description": "[Threads] Platform-specific first comment."
                  },
                  "reddit_first_comment": {
                    "type": "string",
                    "description": "[Reddit] Platform-specific first comment."
                  },
                  "bluesky_first_comment": {
                    "type": "string",
                    "description": "[Bluesky] Platform-specific first comment."
                  },
                  "first_comment_media[]": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "One or more image files to attach to the first comment. Currently supported on Reddit. Not available for scheduled or queued posts. Files only (multipart parts): a URL sent in this field is ignored."
                  },
                  "instagram_title": {
                    "type": "string",
                    "description": "[Instagram] Specific title."
                  },
                  "facebook_title": {
                    "type": "string",
                    "description": "[Facebook] Specific title."
                  },
                  "tiktok_title": {
                    "type": "string",
                    "description": "[TikTok] Specific title."
                  },
                  "linkedin_title": {
                    "type": "string",
                    "description": "[LinkedIn] Specific title."
                  },
                  "x_title": {
                    "type": "string",
                    "description": "[X] Specific title."
                  },
                  "pinterest_title": {
                    "type": "string",
                    "description": "[Pinterest] Specific title."
                  },
                  "threads_title": {
                    "type": "string",
                    "description": "[Threads] Specific title."
                  },
                  "threads_topic_tag": {
                    "type": "string",
                    "description": "[Threads] A topic tag for the post (1-50 characters). Cannot contain periods (.) or ampersands (&). One tag per post.",
                    "maxLength": 50
                  },
                  "bluesky_title": {
                    "type": "string",
                    "description": "[Bluesky] Specific text."
                  },
                  "bluesky_tags": {
                    "type": "string",
                    "description": "[Bluesky] Up to 8 extra hashtags stored on the post without appearing in the text (comma list or JSON array; leading # optional; 64 characters each). More than 8, like any invalid new Bluesky field, fails only the Bluesky result (results.bluesky.success=false, error_code bluesky_invalid_parameter; HTTP 200)."
                  },
                  "bluesky_created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "[Bluesky] Date the post is shown and sorted by (ISO 8601 with timezone, not in the future; 2 minutes of clock skew allowed). Default: now."
                  },
                  "bluesky_thread_overflow": {
                    "type": "boolean",
                    "description": "[Bluesky] Text longer than one post (300 characters): publish the rest as replies under the media post (adds thread_count). Without it the text is cut and a warning is returned."
                  },
                  "bluesky_gif_as_video": {
                    "type": "boolean",
                    "description": "[Bluesky] Publish a single animated GIF as a looping video (presentation gif). Counts against the account's daily Bluesky video quota and needs a verified email in Bluesky."
                  },
                  "reddit_title": {
                    "type": "string",
                    "description": "[Reddit] Specific title."
                  },
                  "linkedin_description": {
                    "type": "string",
                    "description": "[LinkedIn] Post commentary."
                  },
                  "visibility": {
                    "type": "string",
                    "description": "[LinkedIn] Visibility setting.",
                    "default": "PUBLIC",
                    "enum": [
                      "PUBLIC"
                    ]
                  },
                  "target_linkedin_page_id": {
                    "type": "string",
                    "description": "[LinkedIn] LinkedIn page ID to upload to an organization."
                  },
                  "facebook_page_id": {
                    "type": "string",
                    "description": "[Facebook] Facebook Page ID. Required when platform includes facebook. Auto-detected if only one page is connected."
                  },
                  "facebook_media_type": {
                    "$ref": "#/components/schemas/FacebookPhotoMediaType"
                  },
                  "x_long_text_as_post": {
                    "type": "boolean",
                    "description": "[X] When true, publishes long text as a single post.",
                    "default": false
                  },
                  "reply_settings": {
                    "$ref": "#/components/schemas/XReplySettings"
                  },
                  "geo_place_id": {
                    "type": "string",
                    "description": "[X] Place ID for geographic location."
                  },
                  "nullcast": {
                    "type": "boolean",
                    "description": "[X] Publish without broadcasting.",
                    "default": false
                  },
                  "for_super_followers_only": {
                    "type": "boolean",
                    "description": "[X] Exclusive for super followers.",
                    "default": false
                  },
                  "community_id": {
                    "type": "string",
                    "description": "[X] Community ID."
                  },
                  "share_with_followers": {
                    "type": "boolean",
                    "description": "[X] Share community post with followers.",
                    "default": false
                  },
                  "direct_message_deep_link": {
                    "type": "string",
                    "description": "[X] Direct Message deep link."
                  },
                  "tagged_user_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "[X] User IDs to tag in photos (max 10)."
                  },
                  "reply_to_id": {
                    "type": "string",
                    "description": "[X] ID of the tweet to reply to."
                  },
                  "exclude_reply_user_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "[X] User IDs to exclude from replying."
                  },
                  "post_mode": {
                    "$ref": "#/components/schemas/TikTokPostMode"
                  },
                  "privacy_level": {
                    "$ref": "#/components/schemas/TikTokPrivacyLevel"
                  },
                  "auto_add_music": {
                    "type": "boolean",
                    "description": "[TikTok] Automatically add background music to photos.",
                    "default": false
                  },
                  "disable_comment": {
                    "type": "boolean",
                    "description": "[TikTok] Disable comments.",
                    "default": false
                  },
                  "brand_content_toggle": {
                    "type": "boolean",
                    "description": "[TikTok] Paid partnership promoting third-party brands.",
                    "default": false
                  },
                  "brand_organic_toggle": {
                    "type": "boolean",
                    "description": "[TikTok] Promoting the creator's own business.",
                    "default": false
                  },
                  "photo_cover_index": {
                    "type": "integer",
                    "description": "[TikTok] Index (0-based) of the photo to use as cover/thumbnail.",
                    "default": 0
                  },
                  "tiktok_description": {
                    "type": "string",
                    "description": "[TikTok] Description for photo posts. The only description TikTok uses: the generic `description` / `caption` fields never reach TikTok."
                  },
                  "media_type": {
                    "$ref": "#/components/schemas/InstagramPhotoMediaType"
                  },
                  "collaborators": {
                    "type": "string",
                    "description": "[Instagram] Comma-separated collaborator usernames."
                  },
                  "user_tags": {
                    "type": "string",
                    "description": "[Instagram] Comma-separated user tags."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "[Instagram] Instagram location ID."
                  },
                  "is_ai_generated": {
                    "type": "boolean",
                    "description": "Cross-platform AI-disclosure flag. Set to `true` to self-disclose the content as AI-generated. On Instagram (single photos and carousels) it is forwarded as Meta's `is_ai_generated` and shows the \"AI info\" label under the account name; for carousels it applies to the whole post. The label cannot be added or removed after publishing. On X it maps to `made_with_ai`. See the AI Content Labeling guide.",
                    "default": false
                  },
                  "pinterest_description": {
                    "type": "string",
                    "description": "[Pinterest] Pin description."
                  },
                  "pinterest_board_id": {
                    "type": "string",
                    "description": "[Pinterest] Board ID. Required when platform includes pinterest."
                  },
                  "pinterest_alt_text": {
                    "type": "string",
                    "description": "[Pinterest] Alt text for the image."
                  },
                  "pinterest_link": {
                    "type": "string",
                    "description": "[Pinterest] Destination link for the Pin."
                  },
                  "subreddit": {
                    "type": "string",
                    "description": "[Reddit] Subreddit name (without 'r/'). Required when platform includes reddit."
                  },
                  "flair_id": {
                    "type": "string",
                    "description": "[Reddit] Flair ID to apply."
                  },
                  "telegram_parse_mode": {
                    "type": "string",
                    "description": "Telegram: MarkdownV2 or HTML.",
                    "enum": [
                      "MarkdownV2",
                      "HTML"
                    ]
                  },
                  "telegram_message_thread_id": {
                    "type": "integer",
                    "description": "Telegram: forum topic to post in."
                  },
                  "telegram_direct_messages_topic_id": {
                    "type": "integer",
                    "description": "Telegram: topic of a channel direct messages chat."
                  },
                  "telegram_disable_notification": {
                    "type": "boolean",
                    "description": "Telegram: send silently."
                  },
                  "telegram_protect_content": {
                    "type": "boolean",
                    "description": "Telegram: disallow forwarding and saving."
                  },
                  "telegram_reply_markup": {
                    "type": "string",
                    "description": "Telegram: InlineKeyboardMarkup JSON with URL buttons."
                  },
                  "telegram_reply_to_message_id": {
                    "type": "integer",
                    "description": "Telegram: publish as a reply to this message."
                  },
                  "telegram_reply_quote": {
                    "type": "string",
                    "description": "Telegram: exact part of the replied message to quote (max 1024)."
                  },
                  "telegram_reply_parameters": {
                    "type": "string",
                    "description": "Telegram: full ReplyParameters JSON (instead of reply_to_message_id/reply_quote)."
                  },
                  "telegram_message_effect_id": {
                    "type": "string",
                    "description": "Telegram: message effect (private chats only)."
                  },
                  "telegram_pin": {
                    "type": "boolean",
                    "description": "Telegram: pin the post after publishing."
                  },
                  "telegram_first_comment_as_reply": {
                    "type": "boolean",
                    "description": "Telegram: first comment as a reply to the post (default true)."
                  },
                  "telegram_suggested_post_parameters": {
                    "type": "string",
                    "description": "Telegram: SuggestedPostParameters JSON (channel direct messages chats only; a price is not available for now)."
                  },
                  "telegram_ephemeral_message_parameters": {
                    "type": "string",
                    "description": "Telegram: EphemeralMessageParameters JSON (receiver_user_id)."
                  },
                  "telegram_allow_paid_broadcast": {
                    "type": "boolean",
                    "description": "Telegram: it can spend your bot's Stars. Paid broadcasts charge 0.1 Telegram Stars per message above the free 30 messages/s, from the bot's balance."
                  },
                  "telegram_pin_notify": {
                    "type": "boolean",
                    "description": "Telegram: with telegram_pin, notify group members about the pin (pinning is silent by default; Telegram never notifies a pin in channels or private chats)."
                  },
                  "telegram_caption_entities": {
                    "type": "string",
                    "description": "Telegram: MessageEntity JSON array for the caption, instead of telegram_parse_mode."
                  },
                  "telegram_has_spoiler": {
                    "type": "boolean",
                    "description": "Telegram: cover the media with a spoiler."
                  },
                  "telegram_show_caption_above_media": {
                    "type": "boolean",
                    "description": "Telegram: show the caption above the media."
                  },
                  "telegram_as_document": {
                    "type": "boolean",
                    "description": "Telegram: send as document (no compression)."
                  },
                  "telegram_caption_overflow": {
                    "type": "string",
                    "description": "Telegram: caption over 1024 characters: truncate (default, the request is refused with 400) or split (the rest goes as a reply).",
                    "enum": [
                      "truncate",
                      "split"
                    ]
                  },
                  "telegram_send_by_url": {
                    "type": "boolean",
                    "description": "Telegram: let Telegram download the URL itself (5 MB photos, 20 MB other files)."
                  },
                  "telegram_paid_star_count": {
                    "type": "integer",
                    "description": "Telegram: paid media price in Telegram Stars (1-25000), paid by the reader.",
                    "minimum": 1,
                    "maximum": 25000
                  },
                  "telegram_paid_payload": {
                    "type": "string",
                    "description": "Telegram: internal reference of the paid media (max 128 bytes)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upload completed synchronously or async processing started.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SyncUploadResponse"
                    },
                    {
                      "$ref": "#/components/schemas/AsyncUploadResponse"
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Post scheduled or queued successfully.\n\nOr: Not generally available yet (team roles and post approvals). The caller is an Editor or Contributor team member: the post is NOT published or scheduled; it waits for review (pending_approval) or stays as a draft. Track it with approval_id (`/uploadposts/approvals/{approval_id}`) or with GET /uploadposts/status?request_id=.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/ScheduledUploadResponse"
                        },
                        {
                          "$ref": "#/components/schemas/QueuedUploadResponse"
                        }
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "example": true
                        },
                        "pending_approval": {
                          "type": "boolean",
                          "example": true
                        },
                        "approval_id": {
                          "type": "string"
                        },
                        "approval_status": {
                          "type": "string",
                          "enum": [
                            "pending_approval",
                            "draft"
                          ]
                        },
                        "job_id": {
                          "type": "string",
                          "nullable": true,
                          "example": null
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "scheduled_date": {
                          "type": "string",
                          "nullable": true
                        },
                        "queued": {
                          "type": "boolean"
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden",
            "description": " With team roles on: error_code team_role_forbidden, team_profile_forbidden, team_approvals_disabled, team_page_forbidden or team_page_not_pinned (see TeamAccessError)."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/UploadTooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/upload_text": {
      "post": {
        "operationId": "uploadText",
        "summary": "Upload text post",
        "description": "Upload text-only posts to social media platforms. Supports X (Twitter), LinkedIn, Facebook, Threads, Reddit, Bluesky, Discord, and Telegram. Automatically creates threads on X (>280 chars), Threads (>500 chars), and Bluesky (>300 chars).",
        "tags": [
          "Content Upload"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "platform[]",
                  "title"
                ],
                "properties": {
                  "paid_partnership": {
                    "type": "boolean",
                    "description": "[All] Marks the post as sponsored / paid partnership. Mapped to TikTok brand_content_toggle, YouTube hasPaidProductPlacement and X paid_partnership; Facebook and Pinterest also need the sponsor id. Networks without a native label publish without it and get a warning. Network-specific fields win. On TikTok it is not allowed with privacy_level=SELF_ONLY (400 commercial_disclosure_privacy_conflict) and drafts do not carry it. See https://docs.upload-post.com/guides/paid-partnership",
                    "default": false
                  },
                  "x_paid_partnership": {
                    "type": "boolean",
                    "description": "[X] Paid partnership disclosure on the first post. Wins over paid_partnership.",
                    "default": false
                  },
                  "facebook_sponsor_id": {
                    "type": "string",
                    "pattern": "^\\d+$",
                    "description": "[Facebook] Sponsor's Page id for the branded content tag (sponsor_id). Page photos, Page videos (facebook_media_type=VIDEO) and text posts; not Reels or Stories."
                  },
                  "user": {
                    "type": "string",
                    "description": "User profile identifier."
                  },
                  "platform[]": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/TextPlatformEnum"
                    },
                    "description": "Platform(s) to upload to."
                  },
                  "title": {
                    "type": "string",
                    "description": "Default text content for the post."
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional extended body used on Reddit (becomes post text). Ignored elsewhere."
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 date/time to schedule publishing. Cannot be used with `add_to_queue`."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA timezone identifier. Defaults to UTC."
                  },
                  "async_upload": {
                    "type": "boolean",
                    "description": "If true, returns immediately with a `request_id`.",
                    "default": false
                  },
                  "add_to_queue": {
                    "type": "boolean",
                    "description": "If true, schedules to next queue slot.",
                    "default": false
                  },
                  "first_comment": {
                    "type": "string",
                    "description": "Automatically post a first comment after publishing."
                  },
                  "facebook_first_comment": {
                    "type": "string",
                    "description": "[Facebook] Platform-specific first comment."
                  },
                  "x_first_comment": {
                    "type": "string",
                    "description": "[X] Platform-specific first comment."
                  },
                  "threads_first_comment": {
                    "type": "string",
                    "description": "[Threads] Platform-specific first comment."
                  },
                  "reddit_first_comment": {
                    "type": "string",
                    "description": "[Reddit] Platform-specific first comment."
                  },
                  "bluesky_first_comment": {
                    "type": "string",
                    "description": "[Bluesky] Platform-specific first comment."
                  },
                  "first_comment_media[]": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "One or more image files to attach to the first comment. Currently supported on Reddit. Not available for scheduled or queued posts. Files only (multipart parts): a URL sent in this field is ignored."
                  },
                  "linkedin_title": {
                    "type": "string",
                    "description": "[LinkedIn] Specific text for LinkedIn."
                  },
                  "x_title": {
                    "type": "string",
                    "description": "[X] Specific text for X."
                  },
                  "facebook_title": {
                    "type": "string",
                    "description": "[Facebook] Specific text for Facebook."
                  },
                  "threads_title": {
                    "type": "string",
                    "description": "[Threads] Specific text for Threads."
                  },
                  "threads_topic_tag": {
                    "type": "string",
                    "description": "[Threads] A topic tag for the post (1-50 characters). Cannot contain periods (.) or ampersands (&). One tag per post.",
                    "maxLength": 50
                  },
                  "bluesky_title": {
                    "type": "string",
                    "description": "[Bluesky] Specific text for Bluesky."
                  },
                  "bluesky_tags": {
                    "type": "string",
                    "description": "[Bluesky] Up to 8 extra hashtags stored on the post without appearing in the text (comma list or JSON array; leading # optional; 64 characters each). More than 8, like any invalid new Bluesky field, fails only the Bluesky result (results.bluesky.success=false, error_code bluesky_invalid_parameter; HTTP 200)."
                  },
                  "bluesky_created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "[Bluesky] Date the post is shown and sorted by (ISO 8601 with timezone, not in the future; 2 minutes of clock skew allowed). Default: now."
                  },
                  "target_linkedin_page_id": {
                    "type": "string",
                    "description": "[LinkedIn] LinkedIn page ID to post to an organization page."
                  },
                  "x_long_text_as_post": {
                    "type": "boolean",
                    "description": "[X] When true, long text is published as a single post.",
                    "default": false
                  },
                  "reply_settings": {
                    "$ref": "#/components/schemas/XReplySettings"
                  },
                  "quote_tweet_id": {
                    "type": "string",
                    "description": "[X] ID of the tweet to quote. Mutually exclusive with `card_uri`, `poll_options`, and `direct_message_deep_link`."
                  },
                  "geo_place_id": {
                    "type": "string",
                    "description": "[X] Place ID for geographic location."
                  },
                  "nullcast": {
                    "type": "boolean",
                    "description": "[X] Publish without broadcasting.",
                    "default": false
                  },
                  "for_super_followers_only": {
                    "type": "boolean",
                    "description": "[X] Exclusive for super followers.",
                    "default": false
                  },
                  "community_id": {
                    "type": "string",
                    "description": "[X] Community ID."
                  },
                  "share_with_followers": {
                    "type": "boolean",
                    "description": "[X] Share community post with followers.",
                    "default": false
                  },
                  "direct_message_deep_link": {
                    "type": "string",
                    "description": "[X] Direct Message deep link. Mutually exclusive with `card_uri`, `quote_tweet_id`, and `poll_options`."
                  },
                  "card_uri": {
                    "type": "string",
                    "description": "[X] Card URI for Twitter Cards/ads. Mutually exclusive with `quote_tweet_id`, `direct_message_deep_link`, and `poll_options`."
                  },
                  "poll_options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "[X] Array of poll options (2-4 options, max 25 chars each). Mutually exclusive with `card_uri`, `quote_tweet_id`, and `direct_message_deep_link`."
                  },
                  "poll_duration": {
                    "type": "integer",
                    "description": "[X] Poll duration in minutes (5-10080). Requires `poll_options`.",
                    "default": 1440,
                    "minimum": 5,
                    "maximum": 10080
                  },
                  "poll_reply_settings": {
                    "type": "string",
                    "description": "[X] Who can reply to poll. Requires `poll_options`.",
                    "enum": [
                      "following",
                      "mentionedUsers",
                      "subscribers",
                      "verified"
                    ]
                  },
                  "reply_to_id": {
                    "type": "string",
                    "description": "[X/Bluesky] ID or URL of the post to reply to."
                  },
                  "exclude_reply_user_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "[X] User IDs to exclude from replying. Requires `reply_to_id`."
                  },
                  "facebook_page_id": {
                    "type": "string",
                    "description": "[Facebook] Facebook Page ID. Required when platform includes facebook. Auto-detected if only one page is connected."
                  },
                  "facebook_link_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "[Facebook] Optional URL for link preview in text posts. Overrides generic `link_url` for Facebook."
                  },
                  "link_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Generic URL to include as a link preview card. Works for LinkedIn, Bluesky, Facebook, and Reddit. Platform-specific parameters (`linkedin_link_url`, `bluesky_link_url`, `facebook_link_url`, `reddit_link_url`) take priority."
                  },
                  "linkedin_link_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "[LinkedIn] Optional URL for link preview card in text posts. Overrides generic `link_url` for LinkedIn."
                  },
                  "bluesky_link_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "[Bluesky] Optional URL for external embed link preview in text posts. Overrides generic `link_url` for Bluesky."
                  },
                  "reddit_link_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "[Reddit] URL for creating a Reddit link post with a URL preview card. Overrides generic `link_url` for Reddit."
                  },
                  "threads_long_text_as_post": {
                    "type": "boolean",
                    "description": "[Threads] If true, long text is a single post. If false, creates a thread if >500 chars.",
                    "default": false
                  },
                  "subreddit": {
                    "type": "string",
                    "description": "[Reddit] Subreddit name (without 'r/'). Required when platform includes reddit."
                  },
                  "flair_id": {
                    "type": "string",
                    "description": "[Reddit] Flair template ID."
                  },
                  "telegram_parse_mode": {
                    "type": "string",
                    "description": "Telegram: MarkdownV2 or HTML.",
                    "enum": [
                      "MarkdownV2",
                      "HTML"
                    ]
                  },
                  "telegram_message_thread_id": {
                    "type": "integer",
                    "description": "Telegram: forum topic to post in."
                  },
                  "telegram_direct_messages_topic_id": {
                    "type": "integer",
                    "description": "Telegram: topic of a channel direct messages chat."
                  },
                  "telegram_disable_notification": {
                    "type": "boolean",
                    "description": "Telegram: send silently."
                  },
                  "telegram_protect_content": {
                    "type": "boolean",
                    "description": "Telegram: disallow forwarding and saving."
                  },
                  "telegram_reply_markup": {
                    "type": "string",
                    "description": "Telegram: InlineKeyboardMarkup JSON with URL buttons."
                  },
                  "telegram_reply_to_message_id": {
                    "type": "integer",
                    "description": "Telegram: publish as a reply to this message."
                  },
                  "telegram_reply_quote": {
                    "type": "string",
                    "description": "Telegram: exact part of the replied message to quote (max 1024)."
                  },
                  "telegram_reply_parameters": {
                    "type": "string",
                    "description": "Telegram: full ReplyParameters JSON (instead of reply_to_message_id/reply_quote)."
                  },
                  "telegram_message_effect_id": {
                    "type": "string",
                    "description": "Telegram: message effect (private chats only)."
                  },
                  "telegram_pin": {
                    "type": "boolean",
                    "description": "Telegram: pin the post after publishing."
                  },
                  "telegram_first_comment_as_reply": {
                    "type": "boolean",
                    "description": "Telegram: first comment as a reply to the post (default true)."
                  },
                  "telegram_suggested_post_parameters": {
                    "type": "string",
                    "description": "Telegram: SuggestedPostParameters JSON (channel direct messages chats only; a price is not available for now)."
                  },
                  "telegram_ephemeral_message_parameters": {
                    "type": "string",
                    "description": "Telegram: EphemeralMessageParameters JSON (receiver_user_id)."
                  },
                  "telegram_allow_paid_broadcast": {
                    "type": "boolean",
                    "description": "Telegram: it can spend your bot's Stars. Paid broadcasts charge 0.1 Telegram Stars per message above the free 30 messages/s, from the bot's balance."
                  },
                  "telegram_pin_notify": {
                    "type": "boolean",
                    "description": "Telegram: with telegram_pin, notify group members about the pin (pinning is silent by default; Telegram never notifies a pin in channels or private chats)."
                  },
                  "telegram_entities": {
                    "type": "string",
                    "description": "Telegram: MessageEntity JSON array, instead of telegram_parse_mode."
                  },
                  "telegram_link_preview": {
                    "type": "boolean",
                    "description": "Telegram: false turns the link preview off."
                  },
                  "telegram_link_preview_options": {
                    "type": "string",
                    "description": "Telegram: LinkPreviewOptions JSON."
                  },
                  "telegram_rich_message": {
                    "type": "string",
                    "description": "Telegram: send a rich message: true (Markdown), html, or an InputRichMessage JSON."
                  },
                  "telegram_poll": {
                    "type": "string",
                    "description": "Telegram: poll/quiz JSON (options 1-12, question defaults to the text, official sendPoll fields)."
                  },
                  "telegram_location": {
                    "type": "string",
                    "description": "Telegram: location JSON (latitude, longitude, live_period...)."
                  },
                  "telegram_venue": {
                    "type": "string",
                    "description": "Telegram: venue JSON (latitude, longitude, address, title...)."
                  },
                  "telegram_contact": {
                    "type": "string",
                    "description": "Telegram: contact JSON (phone_number, first_name, last_name, vcard)."
                  },
                  "telegram_dice": {
                    "type": "string",
                    "description": "Telegram: dice emoji or true."
                  },
                  "telegram_game_short_name": {
                    "type": "string",
                    "description": "Telegram: game created in @BotFather."
                  },
                  "telegram_send_title": {
                    "type": "boolean",
                    "description": "Telegram: send the text before a location/contact/dice/game (default true)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upload completed synchronously or async processing started.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SyncUploadResponse"
                    },
                    {
                      "$ref": "#/components/schemas/AsyncUploadResponse"
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Post scheduled or queued successfully.\n\nOr: Not generally available yet (team roles and post approvals). The caller is an Editor or Contributor team member: the post is NOT published or scheduled; it waits for review (pending_approval) or stays as a draft. Track it with approval_id (`/uploadposts/approvals/{approval_id}`) or with GET /uploadposts/status?request_id=.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/ScheduledUploadResponse"
                        },
                        {
                          "$ref": "#/components/schemas/QueuedUploadResponse"
                        }
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "example": true
                        },
                        "pending_approval": {
                          "type": "boolean",
                          "example": true
                        },
                        "approval_id": {
                          "type": "string"
                        },
                        "approval_status": {
                          "type": "string",
                          "enum": [
                            "pending_approval",
                            "draft"
                          ]
                        },
                        "job_id": {
                          "type": "string",
                          "nullable": true,
                          "example": null
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "scheduled_date": {
                          "type": "string",
                          "nullable": true
                        },
                        "queued": {
                          "type": "boolean"
                        },
                        "idempotent_replay": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden",
            "description": " With team roles on: error_code team_role_forbidden, team_profile_forbidden, team_approvals_disabled, team_page_forbidden or team_page_not_pinned (see TeamAccessError)."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/UploadTooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/upload_document": {
      "post": {
        "operationId": "uploadDocument",
        "summary": "Upload document",
        "description": "Upload documents (PDF, PPT, PPTX, DOC, DOCX) to LinkedIn as native document posts displayed as carousels/viewers, or any file up to 50 MB to Telegram (document, audio, voice, sticker, GIF...).",
        "tags": [
          "Content Upload"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "platform[]",
                  "document",
                  "title"
                ],
                "properties": {
                  "telegram_parse_mode": {
                    "type": "string",
                    "description": "Telegram: MarkdownV2 or HTML.",
                    "enum": [
                      "MarkdownV2",
                      "HTML"
                    ]
                  },
                  "telegram_message_thread_id": {
                    "type": "integer",
                    "description": "Telegram: forum topic to post in."
                  },
                  "telegram_direct_messages_topic_id": {
                    "type": "integer",
                    "description": "Telegram: topic of a channel direct messages chat."
                  },
                  "telegram_disable_notification": {
                    "type": "boolean",
                    "description": "Telegram: send silently."
                  },
                  "telegram_protect_content": {
                    "type": "boolean",
                    "description": "Telegram: disallow forwarding and saving."
                  },
                  "telegram_reply_to_message_id": {
                    "type": "integer",
                    "description": "Telegram: publish as a reply to this message."
                  },
                  "telegram_reply_quote": {
                    "type": "string",
                    "description": "Telegram: exact part of the replied message to quote (max 1024)."
                  },
                  "telegram_reply_parameters": {
                    "type": "string",
                    "description": "Telegram: full ReplyParameters JSON (instead of reply_to_message_id/reply_quote)."
                  },
                  "telegram_message_effect_id": {
                    "type": "string",
                    "description": "Telegram: message effect (private chats only)."
                  },
                  "telegram_pin": {
                    "type": "boolean",
                    "description": "Telegram: pin the post after publishing."
                  },
                  "telegram_first_comment_as_reply": {
                    "type": "boolean",
                    "description": "Telegram: first comment as a reply to the post (default true)."
                  },
                  "telegram_suggested_post_parameters": {
                    "type": "string",
                    "description": "Telegram: SuggestedPostParameters JSON (channel direct messages chats only; a price is not available for now)."
                  },
                  "telegram_ephemeral_message_parameters": {
                    "type": "string",
                    "description": "Telegram: EphemeralMessageParameters JSON (receiver_user_id)."
                  },
                  "telegram_allow_paid_broadcast": {
                    "type": "boolean",
                    "description": "Telegram: it can spend your bot's Stars. Paid broadcasts charge 0.1 Telegram Stars per message above the free 30 messages/s, from the bot's balance."
                  },
                  "telegram_pin_notify": {
                    "type": "boolean",
                    "description": "Telegram: with telegram_pin, notify group members about the pin (pinning is silent by default; Telegram never notifies a pin in channels or private chats)."
                  },
                  "telegram_caption_entities": {
                    "type": "string",
                    "description": "Telegram: MessageEntity JSON array for the caption, instead of telegram_parse_mode."
                  },
                  "telegram_caption_overflow": {
                    "type": "string",
                    "description": "Telegram: caption over 1024 characters: truncate (default, the request is refused with 400) or split (the rest goes as a reply).",
                    "enum": [
                      "truncate",
                      "split"
                    ]
                  },
                  "telegram_send_as": {
                    "type": "string",
                    "description": "Telegram: how to send the file.",
                    "enum": [
                      "document",
                      "audio",
                      "voice",
                      "animation",
                      "sticker",
                      "video_note",
                      "video",
                      "photo"
                    ]
                  },
                  "telegram_first_comment": {
                    "type": "string",
                    "description": "Telegram: first comment (falls back to first_comment)."
                  },
                  "telegram_performer": {
                    "type": "string",
                    "description": "Telegram audio: performer."
                  },
                  "telegram_title_audio": {
                    "type": "string",
                    "description": "Telegram audio: track name."
                  },
                  "telegram_duration": {
                    "type": "integer",
                    "description": "Telegram audio/voice/video note: duration in seconds."
                  },
                  "telegram_emoji": {
                    "type": "string",
                    "description": "Telegram sticker: emoji."
                  },
                  "telegram_thumbnail": {
                    "type": "string",
                    "description": "Telegram: thumbnail URL (JPEG, under 200 kB, max 320x320)."
                  },
                  "telegram_disable_content_type_detection": {
                    "type": "boolean",
                    "description": "Telegram: disable content type detection of the document."
                  },
                  "telegram_media_urls": {
                    "type": "string",
                    "description": "Telegram: more documents/audios by URL to make an album."
                  },
                  "telegram_send_by_url": {
                    "type": "boolean",
                    "description": "Telegram: let Telegram download the document URL (PDF and ZIP only)."
                  },
                  "telegram_send_title": {
                    "type": "boolean",
                    "description": "Telegram: send the text before a sticker or video note (default true)."
                  },
                  "user": {
                    "type": "string",
                    "description": "User profile identifier."
                  },
                  "platform[]": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "linkedin",
                        "telegram"
                      ]
                    },
                    "description": "linkedin and/or telegram. With LinkedIn the file must be PDF, PPT, PPTX, DOC or DOCX; Telegram accepts any file up to 50 MB."
                  },
                  "document": {
                    "type": "string",
                    "format": "binary",
                    "description": "The document file (PDF, PPT, PPTX, DOC, DOCX) or a public URL. Max 100MB, 300 pages."
                  },
                  "title": {
                    "type": "string",
                    "description": "Document title displayed on the post."
                  },
                  "description": {
                    "type": "string",
                    "description": "Post commentary/text that appears above the document."
                  },
                  "visibility": {
                    "$ref": "#/components/schemas/LinkedInVisibility"
                  },
                  "target_linkedin_page_id": {
                    "type": "string",
                    "description": "LinkedIn page ID to post to a company page instead of personal profile."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Document uploaded successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUploadResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden",
            "description": " With team roles on: error_code team_role_forbidden, team_profile_forbidden, team_approvals_disabled, team_page_forbidden or team_page_not_pinned (see TeamAccessError)."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/UploadTooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "202": {
            "description": "Not generally available yet (team roles and post approvals). The caller is an Editor or Contributor team member: the post is NOT published or scheduled; it waits for review (pending_approval) or stays as a draft. Track it with approval_id (`/uploadposts/approvals/{approval_id}`) or with GET /uploadposts/status?request_id=.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "pending_approval": {
                      "type": "boolean",
                      "example": true
                    },
                    "approval_id": {
                      "type": "string"
                    },
                    "approval_status": {
                      "type": "string",
                      "enum": [
                        "pending_approval",
                        "draft"
                      ]
                    },
                    "job_id": {
                      "type": "string",
                      "nullable": true,
                      "example": null
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "scheduled_date": {
                      "type": "string",
                      "nullable": true
                    },
                    "queued": {
                      "type": "boolean"
                    },
                    "idempotent_replay": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/status": {
      "get": {
        "operationId": "getUploadStatus",
        "summary": "Get upload status",
        "description": "Check the status of asynchronous uploads (via `request_id`) or scheduled posts (via `job_id`). At least one parameter must be provided.",
        "tags": [
          "Upload Management"
        ],
        "parameters": [
          {
            "name": "request_id",
            "in": "query",
            "description": "The request identifier returned by upload endpoints when `async_upload=true`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job_id",
            "in": "query",
            "description": "The job identifier returned by scheduled posts (with `scheduled_date`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing both request_id and job_id.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "request_id or job_id is required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/history": {
      "get": {
        "operationId": "getUploadHistory",
        "summary": "Get upload history",
        "description": "Retrieve a paginated list of past uploads across all platforms, ordered most recent first.",
        "tags": [
          "Upload Management"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Upload history retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadHistoryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/schedule": {
      "get": {
        "operationId": "listScheduledPosts",
        "summary": "List scheduled posts",
        "description": "Retrieve all pending scheduled posts for the authenticated user.",
        "tags": [
          "Upload Management"
        ],
        "responses": {
          "200": {
            "description": "Scheduled posts retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scheduled_posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ScheduledPost"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/schedule/{job_id}": {
      "get": {
        "operationId": "getScheduledPost",
        "summary": "Get a scheduled post",
        "description": "The options a scheduled post was scheduled with (limited to what PATCH can change), signed media URLs and whether it can still be edited.",
        "tags": [
          "Upload Management"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/JobIdPathParam"
          }
        ],
        "responses": {
          "200": {
            "description": "The scheduled post.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "post_type": {
                      "type": "string",
                      "enum": [
                        "video",
                        "photo",
                        "text",
                        "document",
                        "unknown"
                      ]
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "platforms": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "scheduled_date": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "original_timezone": {
                      "type": "string",
                      "nullable": true
                    },
                    "form": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "media_urls": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "thumbnail_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "cover_preview_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "kept_files": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "editable": {
                      "type": "boolean"
                    },
                    "not_editable_reason": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "editScheduledPost",
        "summary": "Edit a scheduled post",
        "description": "Update a pending scheduled post: date, text and any other upload option. The stored media is reused (it cannot be replaced), and so are the profile and platforms. Edits are refused with 409 once the scheduler has picked the post up or within 60 seconds of its publish time.",
        "tags": [
          "Upload Management"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/JobIdPathParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "New ISO-8601 date/time in UTC. Must be in the future and within 1 year."
                  },
                  "title": {
                    "type": "string",
                    "description": "New post title/caption, applied to every platform of the post."
                  },
                  "caption": {
                    "type": "string",
                    "description": "New caption/description, applied to every platform of the post."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA timezone; when set, scheduled_date is read in it."
                  },
                  "platform_content": {
                    "type": "object",
                    "description": "Per-platform text keyed by platform, e.g. {\"youtube\": {\"title\": \"...\"}}. Only the platforms listed change.",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "caption": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "fields": {
                    "type": "object",
                    "description": "Other upload options by their form field names (as the upload endpoints take them): per-platform titles/descriptions/first comments on video and photo posts, TikTok privacy_level/cover_timestamp/is_aigc/..., Instagram thumb_offset/share_to_feed/is_ai_generated/..., YouTube privacyStatus/tags/categoryId/..., and the options of the other platforms. null removes an option. Unknown or internal keys are ignored.",
                    "additionalProperties": true,
                    "example": {
                      "cover_timestamp": 4200,
                      "is_aigc": true,
                      "youtube_title": "New title"
                    }
                  },
                  "cover_image_base64": {
                    "type": "string",
                    "description": "New Reels cover image (Instagram/Facebook), base64 or data URL."
                  },
                  "remove_cover": {
                    "type": "boolean",
                    "description": "Remove the stored cover image."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scheduled post updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "scheduled_date": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "title": {
                      "type": "string"
                    },
                    "caption": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "409": {
            "description": "The post is being published, has already run, or is due within 60 seconds. Nothing was changed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "This post is being published right now, so it can no longer be edited."
                    },
                    "error_code": {
                      "type": "string",
                      "example": "scheduled_post_in_progress"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "cancelScheduledPost",
        "summary": "Cancel a scheduled post",
        "description": "Cancel and delete a scheduled post and its associated assets.",
        "tags": [
          "Upload Management"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/JobIdPathParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled post cancelled successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Job abc123 cancelled and assets deleted."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/schedule/{job_id}/thumbnail": {
      "get": {
        "operationId": "getScheduledPostThumbnail",
        "summary": "Get a scheduled post's thumbnail",
        "description": "Signed URL of a small JPEG of the post's video or first image. A post without one gets it built once and kept. Call it only for posts you display; the list already carries most thumbnails.",
        "tags": [
          "Upload Management"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/JobIdPathParam"
          }
        ],
        "responses": {
          "200": {
            "description": "thumbnail_url, or null when the post has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string"
                    },
                    "thumbnail_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Another request is building it. Retry after retry_after seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string"
                    },
                    "thumbnail_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many thumbnails being built at once. Retry after retry_after seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string"
                    },
                    "thumbnail_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/queue/settings": {
      "get": {
        "operationId": "getQueueSettings",
        "summary": "Get queue settings",
        "description": "Retrieve the current queue configuration (timezone, time slots, active days) for a profile.",
        "tags": [
          "Queue System"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ProfileQueryParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Queue settings retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueSettingsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "updateQueueSettings",
        "summary": "Update queue settings",
        "description": "Update the queue configuration (timezone, time slots, active days) for a profile.",
        "tags": [
          "Queue System"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "profile_username"
                ],
                "properties": {
                  "profile_username": {
                    "type": "string",
                    "description": "The profile to update settings for."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA timezone (e.g., 'Europe/London')."
                  },
                  "slots": {
                    "description": "Array of slot objects (max 24), or the string \"auto\" to let the queue use the best times.",
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/QueueSlot"
                        },
                        "maxItems": 24
                      },
                      {
                        "type": "string",
                        "enum": [
                          "auto"
                        ]
                      }
                    ]
                  },
                  "days_of_week": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 6
                    },
                    "description": "Active days: 0=Monday, 1=Tuesday, ..., 6=Sunday."
                  },
                  "slots_mode": {
                    "type": "string",
                    "enum": [
                      "fixed",
                      "auto"
                    ],
                    "description": "Same as slots=\"auto\" / back to the fixed slots."
                  },
                  "auto_slots_count": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12,
                    "description": "Auto mode: hours per day. Default: number of fixed slots, or 3."
                  },
                  "auto_platforms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "tiktok",
                        "instagram",
                        "facebook",
                        "youtube",
                        "linkedin",
                        "x",
                        "threads",
                        "pinterest",
                        "bluesky",
                        "reddit"
                      ]
                    },
                    "maxItems": 6,
                    "description": "Auto mode: networks to use. Default: every connected network with best times except X, which is only used when listed."
                  },
                  "refresh": {
                    "type": "boolean",
                    "description": "Auto mode: recompute the best times if their cached answer is at least 24 h old (YouTube and X: 7 days)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Queue settings updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueSettingsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/queue/preview": {
      "get": {
        "operationId": "getQueuePreview",
        "summary": "Preview queue slots",
        "description": "Preview the next upcoming queue slots and their availability for a profile.",
        "tags": [
          "Queue System"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ProfileQueryParam"
          },
          {
            "name": "count",
            "in": "query",
            "description": "Number of slots to return.",
            "schema": {
              "type": "integer",
              "default": 10,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queue preview retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuePreviewResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/queue/next-slot": {
      "get": {
        "operationId": "getNextQueueSlot",
        "summary": "Get next available queue slot",
        "description": "Get the next available queue slot for a profile.",
        "tags": [
          "Queue System"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ProfileQueryParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Next slot retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextSlotResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/analytics/{profile_username}": {
      "get": {
        "operationId": "getAnalytics",
        "summary": "Get analytics",
        "description": "Retrieve analytics data for a user profile across one or more social media platforms. Returns metrics like followers, views, impressions, reach, and time series data. Note: Instagram's API renamed 'impressions' to 'views'; both fields are returned for compatibility.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "path",
            "required": true,
            "description": "The unique username of the profile.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platforms",
            "in": "query",
            "required": true,
            "description": "Comma-separated list of platforms: instagram, tiktok, linkedin, facebook, x, youtube, threads, pinterest, reddit, bluesky.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_id",
            "in": "query",
            "description": "Required for Facebook analytics. The Facebook Page ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_urn",
            "in": "query",
            "description": "LinkedIn only. Organization/company page URN or numeric ID to fetch analytics for. LinkedIn analytics are available only for organization/company pages you administer — personal profiles are not supported, because LinkedIn's API does not expose member-level analytics. If omitted, the first administered organization page is used.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics data retrieved successfully. Response keys are platform names with platform-specific metrics.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/post-analytics/cached": {
      "get": {
        "operationId": "getCachedPostAnalytics",
        "summary": "Get cached per-post analytics",
        "description": "Replays per-post metrics that Upload-Post already fetched, instead of calling the social platforms again. Because it never touches the platforms during the request, it is NOT subject to the platform analytics rate limit of 100 requests / 5 minutes that applies to the live /uploadposts/post-analytics endpoints, and it is paginated — built for re-reading a large back catalogue. IMPORTANT: this is a write-through cache filled as a side effect of live reads. A post appears here only after it has been fetched at least once through a live per-post endpoint, and there is no background refresh — captured_at is the last time that post was read live. To refresh a post, call the live endpoint for it.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The profile_username of the profile to read snapshots for."
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "tiktok",
                "youtube",
                "facebook",
                "linkedin",
                "threads",
                "pinterest",
                "reddit"
              ]
            },
            "description": "Restrict the result to a single platform. When omitted, all platforms are returned and the response echoes platform: null."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 200
            },
            "description": "Number of posts per page. Defaults to 50, maximum 200."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque next-page token. Pass back exactly the value returned in next_cursor by the previous response. An invalid cursor returns 400."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start of the date range in YYYY-MM-DD format. Defaults to 30 days ago."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End of the date range in YYYY-MM-DD format. Defaults to today."
          }
        ],
        "responses": {
          "200": {
            "description": "Cached post analytics retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string",
                      "nullable": true,
                      "description": "The platform filter applied, or null when none was requested."
                    },
                    "since": {
                      "type": "string",
                      "format": "date"
                    },
                    "until": {
                      "type": "string",
                      "format": "date"
                    },
                    "source": {
                      "type": "string",
                      "example": "snapshot_cache",
                      "description": "Always 'snapshot_cache' — a marker that these numbers came from the daily snapshot, not a live platform call."
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "post_id": {
                            "type": "string",
                            "description": "The post's native ID on the platform."
                          },
                          "platform": {
                            "type": "string"
                          },
                          "profile_username": {
                            "type": "string"
                          },
                          "date": {
                            "type": "string",
                            "format": "date",
                            "description": "Snapshot date this row belongs to."
                          },
                          "captured_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The last time this post was fetched live from the platform. Use it to judge freshness; nothing refreshes it in the background."
                          },
                          "metrics": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "Metrics captured for this post. Keys vary per platform (e.g. YouTube returns views, likes, comments, favorites; TikTok adds reach, favorites, new_followers, profile_views, full_video_watched_rate, average_time_watched, total_time_watched, is_ai_generated, the per-second retention curve, impression_sources and audience_types). What the platform did not report is omitted, never zeroed. Read the keys present rather than assuming a fixed schema."
                          },
                          "post_url": {
                            "type": "string",
                            "nullable": true
                          },
                          "media_type": {
                            "type": "string",
                            "nullable": true
                          },
                          "upload_timestamp": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "limit": {
                      "type": "integer",
                      "description": "The effective page size applied."
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true,
                      "description": "Token to pass as 'cursor' on the next request. Null when there are no more pages."
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing user, invalid platform, malformed since/until date, or an invalid cursor."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/facebook/pages": {
      "get": {
        "operationId": "getFacebookPages",
        "summary": "Get Facebook pages",
        "description": "Retrieve Facebook page IDs associated with user profiles. Use the page_id for posting to Facebook pages.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "description": "Profile username. If not specified, returns all pages for your account.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Facebook pages retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FacebookPage"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/linkedin/pages": {
      "get": {
        "operationId": "getLinkedInPages",
        "summary": "Get LinkedIn pages",
        "description": "Retrieve LinkedIn company pages associated with the authenticated user's accounts. Use the page ID for posting to LinkedIn organization pages.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "description": "Profile username. If omitted, returns pages from all connected LinkedIn accounts.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "LinkedIn pages retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LinkedInPage"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/linkedin/resolve-organization": {
      "get": {
        "operationId": "resolveLinkedInOrganization",
        "summary": "Resolve a LinkedIn company Page to its URN and exact name",
        "description": "Turns a LinkedIn company, showcase or school Page URL, vanity name or id into the urn and the exact name a post mention needs (@[Name](urn:li:organization:ID)); LinkedIn only links a company mention when the name matches the Page's full name, case included. Works for any Page, looked up with the profile's own LinkedIn connection. Cached Pages answer from a shared 7-day cache; new lookups are limited to 60 per hour per account. Person profiles cannot be resolved (400 linkedin_person_not_resolvable).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username whose LinkedIn connection makes the lookup (alias: profile)."
          },
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Page URL (linkedin.com/company|showcase|school/<vanity>), vanity name, numeric id or urn:li:organization:ID (alias: vanity)."
          }
        ],
        "responses": {
          "200": {
            "description": "The Page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "urn": {
                      "type": "string",
                      "example": "urn:li:organization:2414183"
                    },
                    "id": {
                      "type": "string",
                      "example": "2414183"
                    },
                    "name": {
                      "type": "string",
                      "example": "Devtestco"
                    },
                    "vanity_name": {
                      "type": "string",
                      "example": "devtestco"
                    },
                    "mention": {
                      "type": "string",
                      "example": "@[Devtestco](urn:li:organization:2414183)"
                    },
                    "cached": {
                      "type": "boolean",
                      "example": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "error_code `invalid_parameter` (missing user/url, not a LinkedIn Page) or `linkedin_person_not_resolvable` (a person's profile URL). Also `profile_not_found` (no profile with that user) and, without error_code, a profile with no LinkedIn connection."
          },
          "401": {
            "description": "`linkedin_reauth_required` (in error_code, or in code when the account was already flagged for reconnection): LinkedIn rejected the token, reconnect LinkedIn."
          },
          "403": {
            "description": "error_code `linkedin_permission_missing`: the connection lacks the company Page permission (rw_organization_admin); reconnect LinkedIn approving it."
          },
          "404": {
            "description": "error_code `organization_not_found`: no Page with that vanity or id (remembered for 7 days). Also `User not found`."
          },
          "429": {
            "description": "error_code `rate_limited` (60 live lookups per hour per account, `retry_after` seconds) or `linkedin_rate_limited`."
          },
          "502": {
            "description": "error_code `linkedin_unavailable`: LinkedIn did not answer."
          }
        }
      }
    },
    "/uploadposts/pinterest/boards": {
      "get": {
        "operationId": "getPinterestBoards",
        "summary": "Get Pinterest boards",
        "description": "Retrieve all Pinterest boards (public and secret) from a connected Pinterest account. Use the board ID for posting Pins.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "description": "Profile username. If omitted, uses the first connected Pinterest account.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pinterest boards retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "boards": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PinterestBoard"
                      }
                    },
                    "pinterest_account_used": {
                      "type": "string",
                      "description": "Pinterest username of the account used."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createPinterestBoard",
        "summary": "Create a Pinterest board",
        "tags": [
          "Platform Integration"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username. Also accepted as profile, or as ?profile= / ?user= in the query."
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "privacy": {
                    "type": "string",
                    "enum": [
                      "PUBLIC",
                      "PROTECTED"
                    ],
                    "description": "SECRET is rejected (400)."
                  },
                  "profile": {
                    "type": "string",
                    "description": "Alias of user."
                  }
                },
                "required": [
                  "name"
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username. Also accepted as profile, or as ?profile= / ?user= in the query."
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "privacy": {
                    "type": "string",
                    "enum": [
                      "PUBLIC",
                      "PROTECTED"
                    ],
                    "description": "SECRET is rejected (400)."
                  },
                  "profile": {
                    "type": "string",
                    "description": "Alias of user."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Board created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "board": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "privacy": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string",
                          "nullable": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Profile username (alias user); default the first profile with Pinterest."
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of profile."
          }
        ],
        "description": "Without a profile the first profile of the account with a Pinterest account is used."
      }
    },
    "/uploadposts/youtube/videos": {
      "get": {
        "operationId": "getYoutubeVideos",
        "summary": "Get YouTube video details",
        "description": "Details of YouTube videos (videos.list): status, processing, statistics, translations, recording date, paid product placement, topics and, with include_owner_details, file details and suggestions. Exactly one of ids, chart or my_rating. Costs 1 YouTube quota unit of the account's daily allowance for YouTube management features.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Up to 50 video IDs, comma separated.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chart",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "mostPopular"
              ]
            }
          },
          {
            "name": "my_rating",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "like",
                "dislike"
              ]
            }
          },
          {
            "name": "parts",
            "in": "query",
            "description": "Comma-separated subset of snippet, status, contentDetails, statistics, processingDetails, localizations, recordingDetails, paidProductPlacementDetails, topicDetails, brandPartner, player, liveStreamingDetails. Default: all except processingDetails, brandPartner, player and liveStreamingDetails.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_owner_details",
            "in": "query",
            "description": "Adds processingDetails, fileDetails and suggestions (own videos only).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "hl",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region_code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "video_category_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Videos as YouTube returns them.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "not_found": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Missing permission or channel unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance used up (youtube_daily_budget_exhausted, youtube_shared_budget_exhausted, youtube_quota_exhausted) or rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "YouTube management features temporarily off (youtube_feature_disabled).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/youtube/quota": {
      "get": {
        "operationId": "getYoutubeQuotaUsage",
        "summary": "Get YouTube daily allowance usage",
        "description": "Today's usage of the account's daily allowance for YouTube management features. Resets at midnight Pacific Time. Uploads are not counted here. If YouTube management features are temporarily off, `enabled` is false.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Usage per quota bucket.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "buckets": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "used": {
                            "type": "integer"
                          },
                          "limit": {
                            "type": "integer",
                            "nullable": true
                          },
                          "unit": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/youtube/live/broadcasts": {
      "get": {
        "operationId": "listYoutubeLiveBroadcasts",
        "summary": "List YouTube live broadcasts",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveBroadcasts.list. 1 unit.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "all",
                "completed",
                "upcoming"
              ]
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Up to 50 IDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "broadcast_type",
            "in": "query",
            "description": "Type.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "event",
                "persistent"
              ]
            }
          },
          {
            "name": "parts",
            "in": "query",
            "description": "snippet, contentDetails, status, monetizationDetails.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "description": "0-50, default 50.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "Next page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createYoutubeLiveBroadcast",
        "summary": "Create a YouTube live broadcast",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveBroadcasts.insert (1 unit). With create_stream=true also creates and binds a stream (3 units) and returns the ingestion URL and key. The stream key is only returned to the account owner (team members get \"<hidden>\").",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "category_id": {
                    "type": "string"
                  },
                  "scheduled_start_time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "scheduled_end_time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "privacy_status": {
                    "type": "string",
                    "enum": [
                      "private",
                      "public",
                      "unlisted"
                    ]
                  },
                  "enable_monitor_stream": {
                    "type": "boolean"
                  },
                  "broadcast_stream_delay_ms": {
                    "type": "integer"
                  },
                  "enable_auto_start": {
                    "type": "boolean"
                  },
                  "enable_auto_stop": {
                    "type": "boolean"
                  },
                  "enable_dvr": {
                    "type": "boolean"
                  },
                  "enable_embed": {
                    "type": "boolean"
                  },
                  "record_from_start": {
                    "type": "boolean"
                  },
                  "latency_preference": {
                    "type": "string",
                    "enum": [
                      "normal",
                      "low",
                      "ultraLow"
                    ]
                  },
                  "projection": {
                    "type": "string",
                    "enum": [
                      "rectangular",
                      "360"
                    ]
                  },
                  "closed_captions_type": {
                    "type": "string",
                    "enum": [
                      "closedCaptionsDisabled",
                      "closedCaptionsHttpPost",
                      "closedCaptionsEmbedded"
                    ]
                  },
                  "availability": {
                    "type": "object",
                    "description": "excluded_regions, interval {start_time, end_time}, region_intervals [{region_code, start_time, end_time}]."
                  },
                  "made_for_kids": {
                    "type": "boolean"
                  },
                  "create_stream": {
                    "type": "boolean"
                  },
                  "stream_title": {
                    "type": "string"
                  },
                  "stream_ingestion_type": {
                    "type": "string",
                    "enum": [
                      "rtmp",
                      "hls",
                      "dash"
                    ]
                  },
                  "stream_resolution": {
                    "type": "string"
                  },
                  "stream_frame_rate": {
                    "type": "string"
                  },
                  "stream_reusable": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user",
                  "title",
                  "scheduled_start_time",
                  "privacy_status"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/broadcasts/{broadcast_id}": {
      "get": {
        "operationId": "getYoutubeLiveBroadcast",
        "summary": "Get a YouTube live broadcast",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n1 unit.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "Broadcast (video) ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "parts",
            "in": "query",
            "description": "Parts.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "updateYoutubeLiveBroadcast",
        "summary": "Edit a YouTube live broadcast",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nRead + liveBroadcasts.update (2 units). Only sent fields change.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/TooManyRequests",
            "description": "youtube_live_settings_locked, or youtube_channel_busy (another edit of this channel's broadcasts is in progress; nothing was changed or charged)."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "Broadcast (video) ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "category_id": {
                    "type": "string"
                  },
                  "scheduled_start_time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "scheduled_end_time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "privacy_status": {
                    "type": "string",
                    "enum": [
                      "private",
                      "public",
                      "unlisted"
                    ]
                  },
                  "enable_monitor_stream": {
                    "type": "boolean"
                  },
                  "broadcast_stream_delay_ms": {
                    "type": "integer"
                  },
                  "enable_auto_start": {
                    "type": "boolean"
                  },
                  "enable_auto_stop": {
                    "type": "boolean"
                  },
                  "enable_dvr": {
                    "type": "boolean"
                  },
                  "enable_embed": {
                    "type": "boolean"
                  },
                  "record_from_start": {
                    "type": "boolean"
                  },
                  "latency_preference": {
                    "type": "string",
                    "enum": [
                      "normal",
                      "low",
                      "ultraLow"
                    ]
                  },
                  "projection": {
                    "type": "string",
                    "enum": [
                      "rectangular",
                      "360"
                    ]
                  },
                  "closed_captions_type": {
                    "type": "string",
                    "enum": [
                      "closedCaptionsDisabled",
                      "closedCaptionsHttpPost",
                      "closedCaptionsEmbedded"
                    ]
                  },
                  "availability": {
                    "type": "object",
                    "description": "excluded_regions, interval {start_time, end_time}, region_intervals [{region_code, start_time, end_time}]."
                  },
                  "ads_monetization_status": {
                    "type": "string",
                    "enum": [
                      "on",
                      "off"
                    ]
                  },
                  "cuepoint_schedule_enabled": {
                    "type": "boolean"
                  },
                  "pause_ads_until": {
                    "type": "string"
                  },
                  "yt_optimized_cuepoint_config": {
                    "type": "string",
                    "enum": [
                      "LOW",
                      "MEDIUM",
                      "HIGH"
                    ]
                  },
                  "schedule_strategy": {
                    "type": "string",
                    "enum": [
                      "CONCURRENT",
                      "NON_CONCURRENT"
                    ]
                  },
                  "repeat_interval_secs": {
                    "type": "integer"
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteYoutubeLiveBroadcast",
        "summary": "Delete a YouTube live broadcast",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n1 unit. Cannot be undone.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "Broadcast (video) ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Must be true.",
            "schema": {
              "type": "boolean"
            },
            "required": true
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/broadcasts/{broadcast_id}/bind": {
      "post": {
        "operationId": "bindYoutubeLiveBroadcast",
        "summary": "Bind or unbind a stream",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveBroadcasts.bind. 1 unit.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "Broadcast (video) ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "stream_id": {
                    "type": "string"
                  },
                  "unbind": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/broadcasts/{broadcast_id}/transition": {
      "post": {
        "operationId": "transitionYoutubeLiveBroadcast",
        "summary": "Go testing, live or complete",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveBroadcasts.transition. 1 unit. live and complete need confirm=true. Poll GET until the status changes.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "Broadcast (video) ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "testing",
                      "live",
                      "complete"
                    ]
                  },
                  "confirm": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user",
                  "status"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/broadcasts/{broadcast_id}/cuepoint": {
      "post": {
        "operationId": "insertYoutubeLiveCuepoint",
        "summary": "Insert an ad break",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveBroadcasts.cuepoint. 1 unit.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "broadcast_id",
            "in": "path",
            "required": true,
            "description": "Broadcast (video) ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "duration_secs": {
                    "type": "integer"
                  },
                  "insertion_offset_time_ms": {
                    "type": "integer"
                  },
                  "walltime_ms": {
                    "type": "integer"
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/streams": {
      "get": {
        "operationId": "listYoutubeLiveStreams",
        "summary": "List YouTube live streams",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveStreams.list. 1 unit. The stream key is only returned to the account owner (team members get \"<hidden>\").",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Up to 50 IDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parts",
            "in": "query",
            "description": "snippet, cdn, status, contentDetails.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_stream_key",
            "in": "query",
            "description": "Owner only.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "description": "0-50.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "Next page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createYoutubeLiveStream",
        "summary": "Create a YouTube live stream",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveStreams.insert. 1 unit. The stream key is only returned to the account owner (team members get \"<hidden>\").",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 10000
                  },
                  "ingestion_type": {
                    "type": "string",
                    "enum": [
                      "rtmp",
                      "hls",
                      "dash"
                    ]
                  },
                  "resolution": {
                    "type": "string",
                    "enum": [
                      "240p",
                      "360p",
                      "480p",
                      "720p",
                      "1080p",
                      "1440p",
                      "2160p",
                      "variable"
                    ]
                  },
                  "frame_rate": {
                    "type": "string",
                    "enum": [
                      "30fps",
                      "60fps",
                      "variable"
                    ]
                  },
                  "reusable": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user",
                  "title"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/streams/{stream_id}": {
      "get": {
        "operationId": "getYoutubeLiveStream",
        "summary": "Get a YouTube live stream",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n1 unit. Health in status.healthStatus. The stream key is only returned to the account owner (team members get \"<hidden>\").",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "required": true,
            "description": "Stream ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "include_stream_key",
            "in": "query",
            "description": "Owner only.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "updateYoutubeLiveStream",
        "summary": "Edit a YouTube live stream",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nTitle and description only. 2 units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "required": true,
            "description": "Stream ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 10000
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteYoutubeLiveStream",
        "summary": "Delete a YouTube live stream",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n1 unit.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "required": true,
            "description": "Stream ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Must be true.",
            "schema": {
              "type": "boolean"
            },
            "required": true
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/chat": {
      "get": {
        "operationId": "listYoutubeLiveChatMessages",
        "summary": "Read a YouTube live chat page",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveChatMessages.list: one page (5 units). Wait polling_interval_ms (min 5 s) before the next read with next_page_token.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "broadcast_id",
            "in": "query",
            "description": "Broadcast of your channel (one of broadcast_id / live_chat_id).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "live_chat_id",
            "in": "query",
            "description": "Live chat ID (one of broadcast_id / live_chat_id).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "Next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "description": "200-2000.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "profile_image_size",
            "in": "query",
            "description": "16-720.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "hl",
            "in": "query",
            "description": "Language.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "sendYoutubeLiveChatMessage",
        "summary": "Post a message or poll in a YouTube live chat",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveChatMessages.insert (20 units), as the channel.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/TooManyRequests",
            "description": "youtube_live_chat_unavailable, youtube_live_chat_needs_broadcast_id (send broadcast_id instead of live_chat_id) or youtube_duplicate_request (idempotency_key still unconfirmed)."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "broadcast_id": {
                    "type": "string"
                  },
                  "live_chat_id": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "poll": {
                    "type": "object",
                    "properties": {
                      "question": {
                        "type": "string"
                      },
                      "options": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 4,
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Optional. The same key for the same channel within 24 hours posts once: the repeat gets the first answer with idempotent_replay: true, or 409 youtube_duplicate_request while the first result is not confirmed."
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/chat/polls/{message_id}/close": {
      "post": {
        "operationId": "closeYoutubeLiveChatPoll",
        "summary": "Close a live chat poll",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nliveChatMessages.transition status=closed. 20 units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "Poll message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/chat/messages/{message_id}": {
      "delete": {
        "operationId": "deleteYoutubeLiveChatMessage",
        "summary": "Delete a live chat message",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n20 units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "Message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Must be true.",
            "schema": {
              "type": "boolean"
            },
            "required": true
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/moderators": {
      "get": {
        "operationId": "listYoutubeLiveChatModerators",
        "summary": "List live chat moderators",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n50 units per page.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "broadcast_id",
            "in": "query",
            "description": "Broadcast of your channel (one of broadcast_id / live_chat_id).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "live_chat_id",
            "in": "query",
            "description": "Live chat ID (one of broadcast_id / live_chat_id).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "description": "0-50.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "Next page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "addYoutubeLiveChatModerator",
        "summary": "Add a live chat moderator",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n200 units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "broadcast_id": {
                    "type": "string"
                  },
                  "live_chat_id": {
                    "type": "string"
                  },
                  "channel_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "user",
                  "channel_id"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/moderators/{moderator_id}": {
      "delete": {
        "operationId": "removeYoutubeLiveChatModerator",
        "summary": "Remove a live chat moderator",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n200 units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "moderator_id",
            "in": "path",
            "required": true,
            "description": "Moderator ID from the list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Must be true.",
            "schema": {
              "type": "boolean"
            },
            "required": true
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/bans": {
      "post": {
        "operationId": "banYoutubeLiveChatUser",
        "summary": "Ban a user from a live chat",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n200 units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "broadcast_id": {
                    "type": "string"
                  },
                  "live_chat_id": {
                    "type": "string"
                  },
                  "channel_id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "permanent",
                      "temporary"
                    ]
                  },
                  "duration_seconds": {
                    "type": "integer"
                  },
                  "confirm": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user",
                  "channel_id",
                  "type",
                  "confirm"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/bans/{ban_id}": {
      "delete": {
        "operationId": "unbanYoutubeLiveChatUser",
        "summary": "Lift a live chat ban",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\n200 units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "ban_id",
            "in": "path",
            "required": true,
            "description": "Ban ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/live/super-chats": {
      "get": {
        "operationId": "listYoutubeSuperChats",
        "summary": "List Super Chats and Super Stickers",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nsuperChatEvents.list, last 30 days. 2 units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "hl",
            "in": "query",
            "description": "Language.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "description": "1-50.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "Next page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/tiktok/music/trending": {
      "get": {
        "operationId": "getTiktokTrendingMusic",
        "summary": "Get TikTok trending music",
        "description": "Trending tracks from TikTok's Commercial Music Library, to soundtrack a TikTok post. Pass the returned `id` as `tiktok_music_id` on an upload — not `commercial_music_id`, which TikTok rejects on public posts.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TikTokProfile"
          },
          {
            "$ref": "#/components/parameters/TikTokMusicGenre"
          },
          {
            "$ref": "#/components/parameters/TikTokMusicCountry"
          },
          {
            "$ref": "#/components/parameters/TikTokMusicDateRange"
          }
        ],
        "responses": {
          "200": {
            "description": "Trending tracks retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "genre": {
                      "type": "string",
                      "example": "ALL"
                    },
                    "country_code": {
                      "type": "string",
                      "example": "US"
                    },
                    "date_range": {
                      "type": "string",
                      "example": "7DAY"
                    },
                    "cached": {
                      "type": "boolean",
                      "description": "False when this request had to fetch the chart from TikTok."
                    },
                    "tracks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TikTokMusicTrack"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/TikTokReconnectRequired"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/TikTokReauthRequired"
          },
          "502": {
            "$ref": "#/components/responses/TikTokUpstreamError"
          }
        }
      }
    },
    "/uploadposts/tiktok/music/search": {
      "get": {
        "operationId": "searchTiktokMusic",
        "summary": "Search TikTok music",
        "description": "Search the Commercial Music Library by song title or artist. TikTok has **no** music search endpoint, so this searches the trending charts Upload-Post caches per genre/country/period, not TikTok's whole catalogue: a song that is not trending in the chart you query will not be found. Matching is case- and accent-insensitive and every word must match.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TikTokProfile"
          },
          {
            "name": "q",
            "in": "query",
            "description": "Text matched against titles and artists. Omit it to get the chart in trending order.",
            "schema": {
              "type": "string",
              "maxLength": 80
            }
          },
          {
            "$ref": "#/components/parameters/TikTokMusicGenre"
          },
          {
            "$ref": "#/components/parameters/TikTokMusicCountry"
          },
          {
            "$ref": "#/components/parameters/TikTokMusicDateRange"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum tracks to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching tracks, ranked by relevance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "query": {
                      "type": "string",
                      "example": "bad bunny"
                    },
                    "genre": {
                      "type": "string"
                    },
                    "country_code": {
                      "type": "string"
                    },
                    "date_range": {
                      "type": "string"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer",
                      "description": "How many tracks matched before `limit` was applied."
                    },
                    "tracks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TikTokMusicTrack"
                      }
                    },
                    "catalog": {
                      "type": "object",
                      "description": "What the search actually ran against, so you can tell \"no results\" apart from \"the cache is still warming up\".",
                      "properties": {
                        "tracks_indexed": {
                          "type": "integer"
                        },
                        "genres_indexed": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "cached": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/TikTokReconnectRequired"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/TikTokReauthRequired"
          },
          "502": {
            "$ref": "#/components/responses/TikTokUpstreamError"
          }
        }
      }
    },
    "/uploadposts/tiktok/locations": {
      "get": {
        "operationId": "getTiktokLocations",
        "summary": "Search TikTok locations",
        "description": "Search TikTok's place database for the `location_id` needed to tag a location on a post. TikTok requires the id and the name together: send them as `tiktok_location_id` + `tiktok_location_name`. Returns at most 20 matches; an empty array means TikTok found no match, and is a 200 rather than an error.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TikTokProfile"
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Free-text search query (venue, brand or place name).",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching places.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "query": {
                      "type": "string"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TikTokLocation"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/TikTokReconnectRequired"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/TikTokReauthRequired"
          },
          "502": {
            "$ref": "#/components/responses/TikTokUpstreamError"
          }
        }
      }
    },
    "/uploadposts/tiktok/settings": {
      "get": {
        "operationId": "getTiktokPublishingSettings",
        "summary": "Get TikTok publishing settings",
        "description": "What the connected TikTok account is allowed to publish. TikTok narrows the four `privacy_level` values per account — a private account has no `PUBLIC_TO_EVERYONE` — and asking for one the account does not have fails the upload with `error_code: \"tiktok_privacy_unavailable\"`. Read `privacy_level_options` and offer only those. This matters most on photo posts, where TikTok requires a privacy level and Upload-Post defaults to `PUBLIC_TO_EVERYONE`.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TikTokProfile"
          }
        ],
        "responses": {
          "200": {
            "description": "Account publishing settings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "privacy_level_options": {
                      "type": "array",
                      "description": "The privacy levels THIS account may publish with.",
                      "items": {
                        "type": "string",
                        "enum": [
                          "PUBLIC_TO_EVERYONE",
                          "MUTUAL_FOLLOW_FRIENDS",
                          "FOLLOWER_OF_CREATOR",
                          "SELF_ONLY"
                        ]
                      },
                      "example": [
                        "FOLLOWER_OF_CREATOR",
                        "MUTUAL_FOLLOW_FRIENDS",
                        "SELF_ONLY"
                      ]
                    },
                    "max_video_post_duration_sec": {
                      "type": "integer",
                      "description": "Longest video the account can publish, in seconds.",
                      "example": 600
                    },
                    "comment_disabled": {
                      "type": "boolean",
                      "description": "True when the account has comments turned off account-wide."
                    },
                    "duet_disabled": {
                      "type": "boolean"
                    },
                    "stitch_disabled": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/TikTokReconnectRequired"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/TikTokReauthRequired"
          },
          "502": {
            "$ref": "#/components/responses/TikTokUpstreamError"
          }
        }
      }
    },
    "/uploadposts/audience": {
      "get": {
        "operationId": "getAudienceInsights",
        "summary": "Audience insights (any platform)",
        "description": "Who follows a connected account, when they are online, what they tap on the profile and how it compares to its category. One endpoint per QUESTION with a `platform`, exactly like /uploadposts/comments and /uploadposts/post-analytics — never one URL per network. Only `tiktok` answers today; any other value returns 400 with error_code `platform_not_supported` and a message naming the supported ones. `activity_by_hour` (24 entries, followers online per hour, summed over the window) is the field to build a publishing schedule on. The window is trimmed to what the platform accepts — at most 60 days, always ending before today — so read the `range` that comes back, not the one you sent. Requires the `profile_analytics` capability.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "tiktok"
              ]
            },
            "description": "The network to ask. Only tiktok answers today."
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post. `profile` is accepted as an alias."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "First day of the window, ISO YYYY-MM-DD. Defaults to end_date minus 29 days."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Last day of the window, ISO YYYY-MM-DD. Must be earlier than today. Defaults to yesterday."
          },
          {
            "name": "benchmark_category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PERSONAL_BLOG",
                "MACHINERY_AND_EQUIPMENT",
                "HEALTH_AND_WELLNESS",
                "PETS",
                "AUTOMOTIVE_AND_TRANSPORTATION",
                "EDUCATION_AND_TRAINING",
                "FOOD_AND_BEVERAGE",
                "REAL_ESTATE",
                "ELECTRONICS",
                "SHOPPING_AND_RETAIL",
                "PUBLIC_ADMINISTRATION",
                "ART_AND_CRAFTS",
                "BABY",
                "GAMING",
                "RESTAURANTS_AND_BARS",
                "HOME_FURNITURE_AND_APPLIANCES",
                "PROFESSIONAL_SERVICES",
                "SOFTWARE_AND_APPS",
                "MEDIA_AND_ENTERTAINMENT",
                "BEAUTY",
                "SPORTS_FITNESS_AND_OUTDOORS",
                "CLOTHING_AND_ACCESSORIES",
                "TRAVEL_AND_TOURISM",
                "OTHERS",
                "FINANCE_AND_INVESTING"
              ]
            },
            "description": "Adds the `benchmark` block: the averages of that content category. Case-insensitive; the full list also comes back in `benchmark_categories` on every call."
          }
        ],
        "responses": {
          "200": {
            "description": "Audience insights.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "tiktok"
                    },
                    "range": {
                      "type": "object",
                      "description": "The window actually queried, after trimming. Render this one, not your input.",
                      "properties": {
                        "start_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "end_date": {
                          "type": "string",
                          "format": "date"
                        }
                      }
                    },
                    "audience": {
                      "type": "object",
                      "description": "Follower distribution. Every percentage is a fraction of 1.",
                      "properties": {
                        "countries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "country": {
                                "type": "string",
                                "example": "ES"
                              },
                              "percentage": {
                                "type": "number",
                                "description": "Fraction of 1, not a number out of 100."
                              }
                            }
                          }
                        },
                        "cities": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "city": {
                                "type": "string",
                                "example": "Madrid"
                              },
                              "percentage": {
                                "type": "number",
                                "description": "Fraction of 1, not a number out of 100."
                              }
                            }
                          }
                        },
                        "ages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "age": {
                                "type": "string",
                                "example": "25-34"
                              },
                              "percentage": {
                                "type": "number",
                                "description": "Fraction of 1, not a number out of 100."
                              }
                            }
                          }
                        },
                        "genders": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "gender": {
                                "type": "string",
                                "example": "female"
                              },
                              "percentage": {
                                "type": "number",
                                "description": "Fraction of 1, not a number out of 100."
                              }
                            }
                          }
                        }
                      }
                    },
                    "activity_by_hour": {
                      "type": "array",
                      "description": "24 entries, \"0\"-\"23\" in the account's local time, ordered numerically. Followers online in that hour, summed over the window.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hour": {
                            "type": "string",
                            "example": "14"
                          },
                          "followers_online": {
                            "type": "integer",
                            "example": 1494
                          }
                        }
                      }
                    },
                    "followers_daily": {
                      "type": "array",
                      "description": "One row per day, oldest first.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "total": {
                            "type": "integer",
                            "nullable": true
                          },
                          "new": {
                            "type": "integer",
                            "nullable": true
                          },
                          "lost": {
                            "type": "integer",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "profile_actions": {
                      "type": "object",
                      "description": "Totals over the window for the profile's tappable elements. null means the platform reported nothing for this account — which is NOT the same fact as 0.",
                      "properties": {
                        "bio_link_clicks": {
                          "type": "integer",
                          "nullable": true,
                          "example": 318
                        },
                        "address_clicks": {
                          "type": "integer",
                          "nullable": true
                        },
                        "app_download_clicks": {
                          "type": "integer",
                          "nullable": true
                        },
                        "email_clicks": {
                          "type": "integer",
                          "nullable": true
                        },
                        "phone_number_clicks": {
                          "type": "integer",
                          "nullable": true
                        },
                        "lead_submissions": {
                          "type": "integer",
                          "nullable": true
                        }
                      }
                    },
                    "bio_description": {
                      "type": "string",
                      "nullable": true,
                      "description": "The account's current bio text."
                    },
                    "benchmark_categories": {
                      "type": "array",
                      "description": "The 25 values benchmark_category accepts. Always present, so a picker can be built without a second call.",
                      "items": {
                        "type": "string",
                        "enum": [
                          "PERSONAL_BLOG",
                          "MACHINERY_AND_EQUIPMENT",
                          "HEALTH_AND_WELLNESS",
                          "PETS",
                          "AUTOMOTIVE_AND_TRANSPORTATION",
                          "EDUCATION_AND_TRAINING",
                          "FOOD_AND_BEVERAGE",
                          "REAL_ESTATE",
                          "ELECTRONICS",
                          "SHOPPING_AND_RETAIL",
                          "PUBLIC_ADMINISTRATION",
                          "ART_AND_CRAFTS",
                          "BABY",
                          "GAMING",
                          "RESTAURANTS_AND_BARS",
                          "HOME_FURNITURE_AND_APPLIANCES",
                          "PROFESSIONAL_SERVICES",
                          "SOFTWARE_AND_APPS",
                          "MEDIA_AND_ENTERTAINMENT",
                          "BEAUTY",
                          "SPORTS_FITNESS_AND_OUTDOORS",
                          "CLOTHING_AND_ACCESSORIES",
                          "TRAVEL_AND_TOURISM",
                          "OTHERS",
                          "FINANCE_AND_INVESTING"
                        ]
                      }
                    },
                    "benchmark": {
                      "type": "object",
                      "description": "Only when benchmark_category was sent. Only the metrics the platform actually returned are present.",
                      "properties": {
                        "category": {
                          "type": "string",
                          "example": "SOFTWARE_AND_APPS"
                        },
                        "average_comments": {
                          "type": "number"
                        },
                        "average_engagement_rate": {
                          "type": "number",
                          "description": "Fraction of 1.",
                          "example": 0.0144
                        },
                        "average_follower_count": {
                          "type": "number"
                        },
                        "average_follower_growth": {
                          "type": "number"
                        },
                        "average_likes": {
                          "type": "number"
                        },
                        "average_shares": {
                          "type": "number"
                        },
                        "average_video_count": {
                          "type": "number"
                        },
                        "average_video_views": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/PlatformNotSupported"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/TikTokReauthRequired"
          },
          "502": {
            "$ref": "#/components/responses/TikTokUpstreamError"
          }
        }
      }
    },
    "/uploadposts/best-times": {
      "get": {
        "operationId": "getBestTimes",
        "summary": "Best time to post (any platform)",
        "description": "The best hours to publish for a connected account on one network, in the requested timezone. One endpoint per QUESTION with a `platform`. Every answer carries `source` (audience_activity: the network reports followers online per hour, TikTok Business and Instagram 100+ followers; account_posts: the account's recent posts vs its median post, needs 10+ posts; upload_post_history: posts published through Upload-Post whose analytics were read, the only source for X and personal LinkedIn profiles; none: no data yet, best_times empty) and `confidence` (high/medium/low/null). YouTube uses the Data API, not Analytics (no hour dimension). Facebook's page_fans_online was deprecated by Meta, so Facebook is post-based. On networks whose quota is shared with publishing (YouTube, Reddit, LinkedIn, Pinterest) best times have their own daily budget; when it or the network quota runs out, the answer uses only data already stored and says so in `warnings`. Cached 24 h (7 days for YouTube and X), in UTC, so another `timezone` costs no call.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram",
                "facebook",
                "youtube",
                "linkedin",
                "x",
                "threads",
                "pinterest",
                "bluesky",
                "reddit"
              ]
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username. `user` and `profile` are aliases."
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "Europe/Madrid"
            },
            "description": "IANA timezone of the hours returned. Default: the profile's queue timezone, else UTC."
          },
          {
            "name": "top",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 24,
              "default": 5
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Recompute instead of using the cache, only if the cached answer is at least 24 h old (YouTube and X: 7 days)."
          },
          {
            "name": "page_urn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "LinkedIn only: organization ID or urn:li:organization:<id> of a Page this connection administers (any other is a 400). Ignored on other networks."
          },
          {
            "name": "facebook_page_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Facebook only: numeric id of one of the connection's Pages (a Page pinned to the profile wins). Ignored on other networks."
          }
        ],
        "responses": {
          "200": {
            "description": "Best times.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "instagram"
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string",
                      "example": "Europe/Madrid"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "audience_activity",
                        "account_posts",
                        "upload_post_history",
                        "none"
                      ]
                    },
                    "source_detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "confidence": {
                      "type": "string",
                      "nullable": true,
                      "enum": [
                        "high",
                        "medium",
                        "low",
                        null
                      ]
                    },
                    "best_times": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hour": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 23
                          },
                          "score": {
                            "type": "number",
                            "nullable": true,
                            "description": "0-1 relative to the best hour; null when nothing is known about that hour."
                          },
                          "followers_online": {
                            "type": "integer",
                            "description": "audience_activity only."
                          },
                          "relative_engagement": {
                            "type": "number",
                            "nullable": true,
                            "description": "Post-based sources: 1.0 = the account's median post."
                          },
                          "posts": {
                            "type": "integer",
                            "description": "Post-based sources: posts published at that hour."
                          }
                        }
                      },
                      "description": "Best `top` hours, best first."
                    },
                    "by_hour": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hour": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 23
                          },
                          "score": {
                            "type": "number",
                            "nullable": true,
                            "description": "0-1 relative to the best hour; null when nothing is known about that hour."
                          },
                          "followers_online": {
                            "type": "integer",
                            "description": "audience_activity only."
                          },
                          "relative_engagement": {
                            "type": "number",
                            "nullable": true,
                            "description": "Post-based sources: 1.0 = the account's median post."
                          },
                          "posts": {
                            "type": "integer",
                            "description": "Post-based sources: posts published at that hour."
                          }
                        }
                      },
                      "description": "24 entries (empty when source is none)."
                    },
                    "by_day": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day_of_week": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 6
                          },
                          "relative_engagement": {
                            "type": "number",
                            "nullable": true
                          },
                          "posts": {
                            "type": "integer"
                          }
                        }
                      },
                      "description": "Post-based sources only. 0 = Monday."
                    },
                    "by_day_hour": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "nullable": true
                        }
                      },
                      "description": "Post-based sources with 30+ posts: 7x24 relative engagement."
                    },
                    "sample": {
                      "type": "object",
                      "description": "days (audience) or posts/min_posts/window_days (post-based sources)."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      "description": "Sources that could not be used. code: audience_permission_missing, audience_not_available, audience_upstream_error, posts_upstream_error, posts_not_listable, quota_exceeded, network_budget_exhausted, daily_limit_reached, x_disabled, insufficient_history."
                    },
                    "cached": {
                      "type": "boolean"
                    },
                    "computed_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_parameter (also a page_urn / facebook_page_id the connection does not manage), platform_not_supported or account_not_connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "reconnect_required (reauth_required: true): the network rejected the connection (401/403).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded (the network's API quota is used up today and nothing else has data) or daily_limit_reached (too many Page lookups today).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "upstream_error: the network failed or timed out and no other source has data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "feature_disabled: temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/suggestions": {
      "get": {
        "operationId": "getSuggestions",
        "summary": "Hashtag and keyword suggestions (any platform)",
        "description": "What to tag a post with (`type=hashtags`) and what people search around a keyword (`type=keywords`). One endpoint per QUESTION with a `platform`, never one URL per network. Only `tiktok` answers today; any other value returns 400 with error_code `platform_not_supported`. `type=hashtags` needs the `profile_analytics` capability, which any recent connection has; `type=keywords` needs `trend_search`, which is granted only when the account is (re)connected.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "tiktok"
              ]
            },
            "description": "The network to ask. Only tiktok answers today."
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post. `profile` is accepted as an alias."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hashtags",
                "keywords"
              ],
              "default": "hashtags"
            },
            "description": "Which answer you want."
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The seed keyword."
          },
          {
            "name": "country_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO 3166-1 alpha-2 country to rank hashtag suggestions for, e.g. ES."
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Language code for the hashtag suggestions, e.g. es."
          }
        ],
        "responses": {
          "200": {
            "description": "Suggestions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "tiktok"
                    },
                    "type": {
                      "type": "string",
                      "example": "hashtags"
                    },
                    "query": {
                      "type": "string",
                      "example": "instant camera"
                    },
                    "hashtags": {
                      "type": "array",
                      "description": "Only for type=hashtags.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The tag WITHOUT the leading #.",
                            "example": "instantcamera"
                          },
                          "view_count": {
                            "type": "integer",
                            "format": "int64",
                            "description": "Lifetime views of content carrying the tag. Reaches 12 digits — parse as a 64-bit integer.",
                            "example": 128970043215
                          }
                        }
                      }
                    },
                    "keywords": {
                      "type": "array",
                      "description": "Only for type=keywords. Passed through as the platform returns it; treat each object as an open shape.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "keyword": {
                            "type": "string",
                            "example": "instant camera film"
                          },
                          "search_volume": {
                            "type": "integer",
                            "example": 61200
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/PlatformNotSupported"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/TikTokReauthRequired"
          },
          "502": {
            "$ref": "#/components/responses/TikTokUpstreamError"
          }
        }
      }
    },
    "/uploadposts/me": {
      "get": {
        "operationId": "getCurrentUser",
        "summary": "Get current user",
        "description": "Verify the validity of your API key and retrieve basic account information including email and subscription plan.",
        "tags": [
          "Authentication"
        ],
        "responses": {
          "200": {
            "description": "API key is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Token is valid"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "example": "user@example.com"
                    },
                    "plan": {
                      "type": "string",
                      "example": "Professional"
                    },
                    "analyze_shorts": {
                      "type": "object",
                      "description": "AI Shorts analyses (POST /uploadposts/analyze-shorts) for the current 30-day window. Read-only: calling this endpoint never uses one. Same rules as the analysis itself. null only if the account data cannot be read.",
                      "properties": {
                        "limit": {
                          "type": "integer",
                          "description": "Analyses included in the plan per window.",
                          "example": 300
                        },
                        "used": {
                          "type": "integer",
                          "description": "Analyses used in the current window.",
                          "example": 12
                        },
                        "remaining": {
                          "type": "integer",
                          "description": "Analyses left in the current window (never below 0).",
                          "example": 288
                        },
                        "resets_at": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true,
                          "description": "When the counter restarts (UTC). null when no window is running: the next analysis starts a new 30-day window with the full limit.",
                          "example": "2026-12-10T08:15:00Z"
                        }
                      },
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/users": {
      "post": {
        "operationId": "createUserProfile",
        "summary": "Create user profile",
        "description": "Create a new user profile linked to a user on your platform.",
        "tags": [
          "User Management"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username"
                ],
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "A unique identifier for the user on your platform. It is the `user` value of every API call and cannot be changed later."
                  },
                  "display_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Optional label shown in the dashboard instead of the username. Can be changed later with PATCH /uploadposts/users/{username}."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Profile created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "profile": {
                      "$ref": "#/components/schemas/UserProfile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The plan's profile limit is reached, with current_profiles and profile_limit (Business plans go over it with usage-based billing).\nerror_code `PROFILE_LIMIT_REACHED`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "You have reached the limit of 5 profiles for your current plan (Basic)."
                    },
                    "error_code": {
                      "type": "string",
                      "example": "PROFILE_LIMIT_REACHED"
                    },
                    "current_profiles": {
                      "type": "integer",
                      "example": 5
                    },
                    "profile_limit": {
                      "type": "integer",
                      "example": 5
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "A profile with this username already exists (compared without case), also when two requests create it at the same time. The body has no error_code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "message": "Username already in use"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listUserProfiles",
        "summary": "List user profiles",
        "description": "Retrieve a list of all user profiles created under your API key.",
        "tags": [
          "User Management"
        ],
        "responses": {
          "200": {
            "description": "Profiles retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "limit": {
                      "type": "integer",
                      "description": "Maximum profiles allowed by plan."
                    },
                    "plan": {
                      "type": "string",
                      "description": "Subscription plan."
                    },
                    "profiles": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UserProfile"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "operationId": "deleteUserProfile",
        "summary": "Delete user profile",
        "description": "Delete an existing user profile and its associated data (including social connections).",
        "tags": [
          "User Management"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username"
                ],
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "The unique identifier of the profile to delete."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Profile deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Perfil eliminado correctamente"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/users/{username}": {
      "get": {
        "operationId": "getUserProfile",
        "summary": "Get a specific user profile",
        "description": "Retrieve information for a single user profile by username.",
        "tags": [
          "User Management"
        ],
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "description": "The username of the profile to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Profile retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "profile": {
                      "$ref": "#/components/schemas/UserProfile"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "renameUserProfile",
        "summary": "Rename a user profile",
        "description": "Set the profile's display_name, the label shown in the dashboard. The username does not change: it stays the `user` value of every API call, so history, scheduled posts, analytics and existing integrations keep working. An empty string or null removes the display name. display_name is the only editable field; any other field returns 400 FIELD_NOT_EDITABLE.",
        "tags": [
          "User Management"
        ],
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "description": "The username of the profile to rename. It is not changed.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "display_name"
                ],
                "properties": {
                  "display_name": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 100,
                    "description": "New label. Trimmed; no line breaks. Empty string or null clears it."
                  }
                }
              },
              "example": {
                "display_name": "Acme Corp"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Profile renamed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "profile": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string",
                          "example": "your_platform_user_id_123"
                        },
                        "display_name": {
                          "type": "string",
                          "nullable": true,
                          "example": "Acme Corp"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/users/social": {
      "delete": {
        "operationId": "disconnectSocialAccount",
        "summary": "Disconnect a social account from a profile",
        "description": "Unlink one social platform from a user profile. Other platforms connected to the same profile are not touched. The stored credentials are deleted only if no other profile of your account still uses that social account. Fires the `social_account_disconnected` webhook with `reason: \"manual_disconnect\"`. Disconnecting a platform that is already disconnected returns 200.",
        "tags": [
          "User Management"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "profile_username",
                  "social_platform"
                ],
                "properties": {
                  "profile_username": {
                    "type": "string",
                    "description": "The profile to disconnect the account from.",
                    "example": "user_id_123"
                  },
                  "social_platform": {
                    "type": "string",
                    "description": "The platform key as it appears in the profile's `social_accounts` object (e.g. `instagram`, `tiktok`, `facebook`, `youtube`, `linkedin`, `x`).",
                    "example": "instagram"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Platform disconnected (or already disconnected).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Social platform instagram disconnected successfully from profile user_id_123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "A profile JWT was sent for a different profile than `profile_username`."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/users/generate-jwt": {
      "post": {
        "operationId": "generateJwt",
        "summary": "Generate JWT URL",
        "description": "Generate a secure, single-use URL containing a JWT. Users visit this URL to link their social media accounts. The JWT is valid for 48 hours.",
        "tags": [
          "Authentication"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username"
                ],
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "The user profile identifier for which the JWT is generated."
                  },
                  "redirect_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to redirect to after linking social accounts."
                  },
                  "logo_image": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to a logo image for branding the linking page."
                  },
                  "redirect_button_text": {
                    "type": "string",
                    "description": "Text for the redirect button after linking.",
                    "default": "Logout connection"
                  },
                  "connect_title": {
                    "type": "string",
                    "description": "Custom title for the connection page.",
                    "default": "Connect Social Media Accounts"
                  },
                  "connect_description": {
                    "type": "string",
                    "description": "Custom description for the connection page.",
                    "default": "Connect your social media accounts to manage your posts."
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "tiktok",
                        "instagram",
                        "linkedin",
                        "youtube",
                        "facebook",
                        "x",
                        "threads",
                        "pinterest",
                        "reddit",
                        "bluesky",
                        "google_business",
                        "discord",
                        "telegram",
                        "slack",
                        "mastodon",
                        "nostr",
                        "lemmy",
                        "devto",
                        "hashnode",
                        "wordpress",
                        "whop",
                        "listmonk",
                        "twitch"
                      ]
                    },
                    "description": "Platforms to show for connection. Defaults to every publishing platform; `twitch` (read-only: lists the channel's past broadcasts) only appears when named. With `preserve_settings: true` the list is not stored: it belongs to the link."
                  },
                  "show_calendar": {
                    "type": "boolean",
                    "description": "Whether to show the calendar view on the connection page.",
                    "default": true
                  },
                  "readonly_calendar": {
                    "type": "boolean",
                    "description": "Show only a read-only calendar on the connection page (no editing, no account connection)."
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "es",
                      "de",
                      "fr",
                      "pt",
                      "pl",
                      "tr"
                    ],
                    "description": "Forces the connection page language for this profile. When omitted, the page auto-detects the visitor's browser language and falls back to English."
                  },
                  "ui_labels": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "maxProperties": 100,
                    "propertyNames": {
                      "pattern": "^[a-zA-Z0-9_.]+$"
                    },
                    "description": "Flat object of connect-page i18n dot-path keys mapped to replacement strings, for white-label text overrides beyond connect_title/connect_description/redirect_button_text. Max 100 entries; keys must match ^[a-zA-Z0-9_.]+$; values must be strings of at most 300 characters. Omitting the field leaves previously stored labels untouched; sending null or {} clears them. Returned inside the profile object by GET /uploadposts/users/validate-jwt. Keys refer to the connect page's own translation keys, so only override keys you have confirmed exist.",
                    "example": {
                      "connect.connectButton": "Baglan",
                      "connect.notConnected": "Bagli degil"
                    }
                  },
                  "client_approval": {
                    "type": "boolean",
                    "description": "Not generally available yet (post approvals). true lets the end client approve or reject the pending posts of this profile from the connect page (`/uploadposts/approvals/client`). Stored on the profile; generate again with false to turn it off."
                  },
                  "connect_theme": {
                    "type": "string",
                    "enum": [
                      "light",
                      "dark",
                      "auto"
                    ],
                    "description": "Forces the connection page theme; `auto` (or null) follows the visitor's preference."
                  },
                  "preserve_settings": {
                    "type": "boolean",
                    "description": "Mint a link without changing the profile's saved connect-page settings. Without it, every setting this request does not send (redirect_url, logo_image, redirect_button_text, connect_title, connect_description, platforms, language) is cleared. With `true`, nothing is written to the profile and `platforms` applies to this link only: the link shows those networks, whatever list the profile has saved. Cannot be sent together with a setting that is stored (400 `preserve_settings_conflict`)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JWT URL generated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "access_url": {
                      "type": "string",
                      "description": "Secure URL for the user to visit and link accounts."
                    },
                    "duration": {
                      "type": "string",
                      "description": "JWT validity period.",
                      "example": "48h"
                    },
                    "settings_preserved": {
                      "type": "boolean",
                      "description": "Present and `true` when the link was minted with `preserve_settings`: the profile was not changed."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing username, or an invalid connect_theme, ui_labels, client_approval (true or false; checked while post approvals are on) or preserve_settings.\nerror_code `invalid_client_approval` for client_approval; `invalid_preserve_settings` when preserve_settings is not a boolean; `preserve_settings_conflict` when it is sent together with a stored setting; `invalid_platforms` when, with preserve_settings, platforms is not a list of names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "success": false,
                  "message": "client_approval must be true or false",
                  "error_code": "invalid_client_approval"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/users/validate-jwt": {
      "get": {
        "operationId": "validateJwt",
        "summary": "Validate JWT",
        "description": "Validates a profile JWT (Authorization: Bearer <token>) and returns its profile. GET only: POST answers 405.",
        "tags": [
          "Authentication"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Validation result. Returns profile if valid, or isValid=false if invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "example": true
                        },
                        "profile": {
                          "$ref": "#/components/schemas/UserProfile"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "isValid": {
                          "type": "boolean",
                          "example": false
                        },
                        "reason": {
                          "type": "string",
                          "example": "Token expired or invalid signature"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The profile is not available on the current plan. error_code: `PROFILE_BLOCKED`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "PROFILE_BLOCKED",
                  "message": "The profile is not available on the current plan."
                }
              }
            }
          },
          "404": {
            "description": "The user or the profile of the token no longer exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ffmpeg/jobs/upload": {
      "post": {
        "operationId": "createFfmpegJob",
        "summary": "Create FFmpeg job",
        "description": "Submit a media processing job using an FFmpeg command template. Supports single or multiple input files via multipart upload or JSON with URLs. Jobs are asynchronous — poll the status endpoint until finished.",
        "tags": [
          "FFmpeg Editor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "full_command",
                  "output_extension"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Primary media file to process. Referenced as {input} or {input0}."
                  },
                  "file1": {
                    "type": "string",
                    "format": "binary",
                    "description": "Second input file. Referenced as {input1}."
                  },
                  "file2": {
                    "type": "string",
                    "format": "binary",
                    "description": "Third input file. Referenced as {input2}."
                  },
                  "full_command": {
                    "type": "string",
                    "description": "FFmpeg command template using {input}/{input0}, {input1}, etc. and {output} placeholders. Example: 'ffmpeg -y -i {input} -c:v libx264 -crf 23 {output}'. Every -i must be an uploaded input ({input}/{inputN}) or a '-f lavfi' source; {output} is the only output. No protocols or URLs, no movie=/amovie=/sendcmd/zmq, no absolute paths except fonts under /usr/share/fonts/, no '..', no -safe 0. -stream_loop -1, -loop 1 or a lavfi source without a duration need -t, -shortest or -frames; -stream_loop goes from -1 to 100. The job is charged max(input duration, output duration)."
                  },
                  "output_extension": {
                    "type": "string",
                    "description": "Desired output file extension (e.g., 'mp4', 'wav', 'mp3', 'mov', 'webm')."
                  },
                  "publish": {
                    "type": "boolean",
                    "description": "Whether to publish the result."
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "files",
                  "full_command",
                  "output_extension"
                ],
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "Array of input file URLs. Referenced as {input0}, {input1}, etc."
                  },
                  "full_command": {
                    "type": "string",
                    "description": "FFmpeg command template using {input0}, {input1}, etc. and {output} placeholders."
                  },
                  "output_extension": {
                    "type": "string",
                    "description": "Desired output file extension."
                  },
                  "publish": {
                    "type": "boolean",
                    "description": "Whether to publish the result."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "FFmpeg job created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "job_id": {
                      "type": "string",
                      "description": "Unique job identifier for polling status.",
                      "example": "a97bbb5a-139b-46ca-b893-6e8d303d5934"
                    },
                    "status": {
                      "type": "string",
                      "example": "PENDING"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/ffmpeg/jobs/{job_id}": {
      "get": {
        "operationId": "getFfmpegJobStatus",
        "summary": "Get FFmpeg job status",
        "description": "Poll the status of an FFmpeg processing job. Statuses: PENDING, PROCESSING, FINISHED, ERROR.",
        "tags": [
          "FFmpeg Editor"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/JobIdPathParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Job status retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FFmpegJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/ffmpeg/jobs/{job_id}/download": {
      "get": {
        "operationId": "downloadFfmpegResult",
        "summary": "Download FFmpeg result",
        "description": "Download the processed file when job status is FINISHED. Returns binary media with appropriate Content-Type and Content-Disposition headers.",
        "tags": [
          "FFmpeg Editor"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/JobIdPathParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Processed file download.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/ffmpeg/consumption": {
      "get": {
        "operationId": "getFfmpegConsumption",
        "summary": "Get FFmpeg consumption",
        "description": "Check your current FFmpeg usage, remaining quota, and processing history for the current month.",
        "tags": [
          "FFmpeg Editor"
        ],
        "responses": {
          "200": {
            "description": "Consumption data retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FFmpegConsumptionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/users/notifications": {
      "post": {
        "operationId": "configureNotifications",
        "summary": "Configure webhook notifications",
        "description": "Updates the notification settings (only the fields sent change). Accepted fields: channels, webhook_url, webhook_events, telegram_chat_id, slack_webhook_url, whatsapp_to_phone. Team members (X-Act-As-User) cannot change where notifications go (403). The webhook_secret is created with the first webhook_url and is never set by the client.",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channels": {
                    "type": "object",
                    "properties": {
                      "webhook": {
                        "type": "boolean",
                        "description": "Enable/disable webhook notifications."
                      },
                      "telegram": {
                        "type": "boolean",
                        "description": "Enable/disable Telegram notifications."
                      },
                      "slack": {
                        "type": "boolean",
                        "description": "Enable/disable Slack notifications (needs slack_webhook_url)."
                      },
                      "whatsapp": {
                        "type": "boolean",
                        "description": "Enable/disable WhatsApp notifications (needs whatsapp_to_phone)."
                      }
                    }
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to receive webhook POST requests."
                  },
                  "telegram_chat_id": {
                    "type": "string",
                    "description": "Telegram chat ID for notifications."
                  },
                  "webhook_events": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": {
                          "type": "boolean"
                        },
                        "description": "Event name -> enabled."
                      },
                      {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/WebhookEventName"
                        },
                        "description": "Names of the enabled events."
                      }
                    ],
                    "description": "Which events the account webhook receives: an object {event: true|false} or a list of names; both are stored as sent and returned the same way. Omitted or empty = every event except the opt-in ones."
                  },
                  "slack_webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Slack Incoming Webhook URL for notifications (public URL; an empty value clears it)."
                  },
                  "whatsapp_to_phone": {
                    "type": "string",
                    "description": "Phone number that receives WhatsApp notifications."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Settings saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "notifications": {
                      "$ref": "#/components/schemas/NotificationSettings"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "No valid field, or a webhook_url / slack_webhook_url that is not a public URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "403": {
            "description": "Team members cannot change where the owner's notifications are delivered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "callbacks": {
          "uploadCompleted": {
            "{$request.body#/webhook_url}": {
              "post": {
                "summary": "Upload completed webhook",
                "description": "Sent to your webhook URL when an upload completes (success or failure).",
                "requestBody": {
                  "required": true,
                  "content": {
                    "application/json": {
                      "schema": {
                        "$ref": "#/components/schemas/WebhookPayload"
                      }
                    }
                  }
                },
                "responses": {
                  "200": {
                    "description": "Webhook received successfully."
                  }
                }
              }
            }
          },
          "socialAccountStatusChanged": {
            "{$request.body#/webhook_url}": {
              "post": {
                "summary": "Social account connection status changed",
                "description": "Sent when a social account is connected, disconnected, or requires re-authentication.",
                "requestBody": {
                  "required": true,
                  "content": {
                    "application/json": {
                      "schema": {
                        "$ref": "#/components/schemas/ConnectionStatusPayload"
                      }
                    }
                  }
                },
                "responses": {
                  "200": {
                    "description": "Webhook received successfully."
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getNotifications",
        "summary": "Get notification settings",
        "tags": [
          "Webhooks"
        ],
        "description": "Current webhook and Telegram notification settings of the account, including webhook_secret.",
        "responses": {
          "200": {
            "description": "Settings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "notifications": {
                      "$ref": "#/components/schemas/NotificationSettings"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteNotifications",
        "summary": "Remove the account webhook",
        "tags": [
          "Webhooks"
        ],
        "description": "Clears webhook_url, webhook_events and webhook_secret and switches the webhook channel off. Webhook subscriptions are not touched.",
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/media": {
      "get": {
        "operationId": "getUserMedia",
        "summary": "Get media list",
        "description": "Retrieve a list of recent media (posts, reels, videos, pins, tweets, etc.) from a connected social media account. Supports Instagram, TikTok, YouTube, LinkedIn, Facebook, X (Twitter), Threads, Pinterest, Bluesky, and Reddit.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "tiktok",
                "youtube",
                "linkedin",
                "facebook",
                "x",
                "threads",
                "pinterest",
                "bluesky",
                "reddit"
              ]
            },
            "description": "The platform to retrieve media from."
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          },
          {
            "name": "page_urn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "LinkedIn only. Selects which LinkedIn page to fetch posts from. Accepts a numeric organization ID (e.g., 12345), a full URN (e.g., urn:li:organization:12345), or 'me' to force the connected member's personal profile. If omitted, accounts connected as an organization admin auto-resolve to their first administered organization; otherwise the personal profile is used."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 25,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of media items to return. Defaults to 25 and is clamped to 1-100, then capped again by the platform's own maximum page size: Instagram/Facebook/Threads/Bluesky/X/Pinterest/Reddit/LinkedIn 100, YouTube 50, TikTok 20."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque next-page token. Pass back exactly the value returned in pagination.next_cursor by the previous response. Not supported on LinkedIn, Discord and Telegram: sending a cursor for those platforms returns 400 with a message naming the platform."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "posts_with_replies",
                "posts_no_replies",
                "posts_with_media",
                "posts_and_author_threads",
                "posts_with_video"
              ]
            },
            "description": "Bluesky only. Which posts to list (Bluesky's author feed filter)."
          },
          {
            "name": "include_pins",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Bluesky only. true puts the pinned post first, with pinned: true."
          }
        ],
        "responses": {
          "200": {
            "description": "Media list retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "media": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Platform-specific unique identifier for the media item."
                          },
                          "caption": {
                            "type": "string",
                            "nullable": true,
                            "description": "Text content, caption, or title of the post."
                          },
                          "media_type": {
                            "type": "string",
                            "enum": [
                              "IMAGE",
                              "VIDEO",
                              "CAROUSEL_ALBUM",
                              "TEXT"
                            ],
                            "description": "Type of media content."
                          },
                          "media_url": {
                            "type": "string",
                            "nullable": true,
                            "description": "Direct URL to the media file (image or video). Available on most platforms. Returns null for TikTok, YouTube, and when the platform does not provide a direct media URL. URLs are temporary and may expire."
                          },
                          "permalink": {
                            "type": "string",
                            "nullable": true,
                            "description": "Direct URL to the post on the platform."
                          },
                          "timestamp": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "description": "ISO 8601 timestamp of when the post was created."
                          },
                          "thumbnail_url": {
                            "type": "string",
                            "nullable": true,
                            "description": "URL of the thumbnail or preview image."
                          },
                          "post_id": {
                            "type": "string",
                            "description": "Bluesky: the post's at:// URI, always present (id stays the cid)."
                          },
                          "pinned": {
                            "type": "boolean",
                            "description": "Bluesky: always present; true for the pinned post (include_pins=true)."
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "description": "Page metadata. Additive: every pre-existing response key is unchanged.",
                      "properties": {
                        "limit": {
                          "type": "integer",
                          "description": "The effective limit applied after clamping and per-platform capping.",
                          "example": 50
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Token to pass as 'cursor' on the next request. Null on the last page.",
                          "example": "QVFIUkc..."
                        },
                        "has_more": {
                          "type": "boolean",
                          "description": "True when another page is available."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters, platform account not linked, or a cursor was supplied for LinkedIn, Discord or Telegram (which do not support cursors). Bluesky: error_code `bluesky_invalid_parameter` for a wrong filter or include_pins."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/comments": {
      "get": {
        "operationId": "getPostComments",
        "summary": "List post comments (multi-platform)",
        "description": "List comments on one of your posts. Supported platforms: Instagram, Facebook, YouTube (account must be connected with the youtube.force-ssl scope), LinkedIn (organization posts) and TikTok. For YouTube, post_id is the video ID; for LinkedIn, post_id is the post URN (e.g. urn:li:ugcPost:123); for TikTok, post_id is the video id. Instagram comments are returned newest-first per Meta Graph API v3.2+. Pass comment_id to get the replies under one comment instead of the post's top-level comments (TikTok, Threads, YouTube, Instagram, Facebook and LinkedIn company Pages). TikTok requires the `comments` capability — TikTok grants comment permission only at the moment the account is connected, so an account connected earlier must be reconnected from Manage Users or the call answers 400 with error_code `tiktok_reconnect_required`. On TikTok, post_url accepts a tiktok.com/@user/video/<id> URL. Successful responses are cached for 60 seconds per account and query string; any comment write made through Upload-Post by the same account clears that cache. On X the mentions page behind the listing is also kept for 120 seconds per X account. Bluesky: without depth, parent_height or comment_id the listing is unchanged (same fields as before). With any of them it returns the thread view in one call (no pagination, limit caps top-level replies): depth nests replies in `replies`, parent_height returns the posts above in `parents`, comment_id (a reply's at:// URI) returns the replies to that reply; post_id/post_url/comment_id then also accept a bsky.app link, each comment adds parent_id, quote_count and hidden (hidden by the author with thread controls) and the response adds hidden_replies. Both need the Bluesky account connected.",
        "tags": [
          "Instagram Interactions"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "facebook",
                "youtube",
                "linkedin",
                "tiktok",
                "threads",
                "x",
                "bluesky"
              ]
            },
            "description": "Platform to list comments from. Reddit answers 503 reddit_unavailable."
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          },
          {
            "name": "post_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Post identifier. YouTube = the video ID; LinkedIn = the post URN (urn:li:ugcPost:...); Instagram = numeric media ID. Use post_id or post_url (one is required)."
          },
          {
            "name": "post_url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Full post URL. Alternative to post_id."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "description": "Maximum comments to return per page. LinkedIn's top-level listing ignores it (LinkedIn's first page, no pagination); LinkedIn replies apply it."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Pagination cursor returned in `pagination.next_cursor` of the previous response. Pass it back to fetch the next page. Named `after` on this endpoint (`cursor` is ignored here). On LinkedIn replies it is a number."
          },
          {
            "name": "comment_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "TikTok, Threads, YouTube, Instagram, Facebook, LinkedIn and Bluesky (the reply's at:// URI or bsky.app link; turns on the thread view). Returns the replies hanging off this comment instead of the post's top-level comments - the same question narrowed to a parent, not a separate URL, with the same pagination. post_id is still required. On LinkedIn it can be the comment_urn from the listing; a bare id is looked up among the post's first 250 comments (404 `linkedin_comment_not_found` otherwise). LinkedIn replies are readable on company Page posts only: 403 `linkedin_personal_not_supported` for a personal-profile connection, 403 `linkedin_page_access_denied` when LinkedIn refuses a Page connection (admin role lost). A comment_id in the wrong format answers 400 `invalid_comment_id`; one Instagram or Facebook does not know answers 404 `comment_not_found` (a comment without replies is a 200 with an empty list; on LinkedIn an unknown comment_urn is also an empty 200). On Facebook post_id is still required: it picks the Page whose token reads the comment. Other platforms answer 400 `platform_not_supported`. TikTok indexes a newly created comment asynchronously: listing within ~10 seconds of writing one returns a list without it."
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 1
            },
            "description": "Bluesky only, turns on the thread view. Levels of nested replies (each comment's `replies`)."
          },
          {
            "name": "parent_height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100,
              "default": 0
            },
            "description": "Bluesky only, turns on the thread view. Posts above post_id to return in `parents`."
          }
        ],
        "responses": {
          "200": {
            "description": "Comments retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "comments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Comment ID."
                          },
                          "text": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Commenter's IGSID."
                              },
                              "username": {
                                "type": "string"
                              }
                            }
                          },
                          "parent_id": {
                            "type": "string",
                            "nullable": true,
                            "description": "Bluesky thread view: at:// URI of the reply it answers; null when it answers the post."
                          },
                          "quote_count": {
                            "type": "integer",
                            "description": "Bluesky thread view."
                          },
                          "hidden": {
                            "type": "boolean",
                            "description": "Bluesky thread view: hidden by the post's author (thread controls)."
                          },
                          "replies": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Bluesky thread view: nested replies, same fields, down to `depth`."
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "description": "Cursor pagination metadata.",
                      "properties": {
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Opaque cursor to pass as `after` for the next page. Null on the last page."
                        },
                        "has_next": {
                          "type": "boolean",
                          "description": "True if more pages are available."
                        }
                      }
                    },
                    "hidden_replies": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Bluesky thread view: at:// URIs of the replies hidden by the author."
                    },
                    "parents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlueskyPost"
                      },
                      "description": "Bluesky thread view, with parent_height: the posts above post_id, nearest first."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing parameters, invalid post identifier, limit outside 1-50, or an unsupported platform. error_code `invalid_comment_id` (comment_id in the wrong format), `invalid_post_url` (post_id is not a URL or id of a post), `invalid_cursor` (LinkedIn replies: after is not the number from next_cursor), `platform_not_supported` (comment_id on a platform without replies). TikTok: error_code `tiktok_reconnect_required` (reconnect the account) or `invalid_parameter` (TikTok error 40002: the request itself is wrong, e.g. a post_id that is not one of the account's videos; do not retry it)."
          },
          "403": {
            "description": "The connected account lacks the required scope (e.g. YouTube not connected with youtube.force-ssl). LinkedIn replies (comment_id): error_code `linkedin_personal_not_supported` (personal-profile connection) or `linkedin_page_access_denied` (Page connection LinkedIn refused); the top-level LinkedIn listing passes LinkedIn's own 403 through. Bluesky thread view: error_code `bluesky_blocked` (a block between the account and the post's author)."
          },
          "404": {
            "description": "error_code `comment_not_found` (Instagram/Facebook do not know the comment_id) or `linkedin_comment_not_found` (a bare LinkedIn comment_id not among the post's first 250 comments; pass the comment_urn). Bluesky thread view: error_code `bluesky_not_found` (Bluesky cannot find the post or reply)."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/comments/create": {
      "post": {
        "operationId": "createComment",
        "summary": "Create a comment or reply (multi-platform)",
        "description": "Post a comment or reply on Instagram, Facebook, YouTube, LinkedIn or TikTok. Provide exactly one of comment_id (reply to that comment), post_id or post_url (top-level comment). Instagram supports replies only, so comment_id is required. For LinkedIn, post_id is the post URN. On TikTok, post_id (the video id) is always required — adding comment_id on top of it turns the call into a reply — and the connection must report the `comments` capability, i.e. a reconnected account, or the call answers 400 with error_code `tiktok_reconnect_required`. On X, links in message are removed unless the X Links add-on is active (a `warnings` array says so; a message made only of links answers 400 `x_links_not_allowed`), and replies, edits and reposts share a daily cap per X account (20 on the Free plan, 200 on paid plans, per UTC day; 429 `x_daily_write_limit` with a Retry-After header).",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "user",
                  "message"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "instagram",
                      "facebook",
                      "youtube",
                      "linkedin",
                      "tiktok",
                      "x",
                      "threads",
                      "bluesky"
                    ],
                    "description": "Target platform."
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile username as configured in Upload-Post."
                  },
                  "message": {
                    "type": "string",
                    "description": "The comment text. On X, links are removed unless the X Links add-on is active."
                  },
                  "comment_id": {
                    "type": "string",
                    "description": "Reply to this comment. Required for Instagram. Provide exactly one of comment_id, post_id or post_url."
                  },
                  "post_id": {
                    "type": "string",
                    "description": "Top-level comment on this post. LinkedIn = post URN (urn:li:ugcPost:...); YouTube = video ID."
                  },
                  "post_url": {
                    "type": "string",
                    "description": "Top-level comment on this post (by URL). Alternative to post_id."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comment created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string",
                      "description": "ID of the created comment."
                    },
                    "message": {
                      "type": "string"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "X: present when links were removed from the reply."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, more than one target provided, Instagram without comment_id, or an unsupported platform. X: error_code `x_links_not_allowed` when the reply only contained links. TikTok: error_code `tiktok_reconnect_required` or `invalid_parameter` (TikTok error 40002)."
          },
          "403": {
            "description": "The connected account lacks the required scope."
          },
          "429": {
            "description": "X only: the X account reached its daily cap of replies, edits and reposts (20 on the Free plan, 200 on paid plans, per UTC day). Wait Retry-After seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds until 00:00 UTC.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "example": "x_daily_write_limit"
                    },
                    "limit": {
                      "type": "integer",
                      "example": 200
                    },
                    "retry_after": {
                      "type": "integer",
                      "description": "Seconds until 00:00 UTC."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/comments/delete": {
      "delete": {
        "operationId": "deleteComment",
        "summary": "Delete a comment (multi-platform)",
        "description": "Delete a comment on Instagram, Facebook, YouTube, LinkedIn or TikTok. For LinkedIn, post_id (the post URN) is also required; TikTok deletes from comment_id alone, and only comments written by the connected account. TikTok also requires the `comments` capability (a reconnected account), or the call answers 400 with error_code `tiktok_reconnect_required`. Also accepts POST with the same body.",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "user",
                  "comment_id"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "instagram",
                      "facebook",
                      "youtube",
                      "linkedin",
                      "tiktok"
                    ],
                    "description": "Target platform."
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile username as configured in Upload-Post."
                  },
                  "comment_id": {
                    "type": "string",
                    "description": "ID of the comment to delete."
                  },
                  "post_id": {
                    "type": "string",
                    "description": "Required for LinkedIn only — the post URN (urn:li:ugcPost:...) the comment belongs to."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comment deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, LinkedIn without post_id, or an unsupported platform."
          },
          "403": {
            "description": "The connected account lacks the required scope, or you do not own the comment."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      },
      "post": {
        "operationId": "deleteCommentPost",
        "summary": "Delete a comment (POST alias)",
        "description": "POST alias of DELETE /uploadposts/comments/delete, for clients that cannot send a body with DELETE. Same body and behavior.",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "user",
                  "comment_id"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "instagram",
                      "facebook",
                      "youtube",
                      "linkedin",
                      "tiktok"
                    ],
                    "description": "Target platform."
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile username as configured in Upload-Post."
                  },
                  "comment_id": {
                    "type": "string",
                    "description": "ID of the comment to delete."
                  },
                  "post_id": {
                    "type": "string",
                    "description": "Required for LinkedIn only — the post URN (urn:li:ugcPost:...) the comment belongs to."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comment deleted successfully."
          },
          "400": {
            "description": "Missing fields, LinkedIn without post_id, or an unsupported platform."
          },
          "403": {
            "description": "The connected account lacks the required scope, or you do not own the comment."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/comments/action": {
      "post": {
        "operationId": "commentAction",
        "summary": "Hide, like or pin a comment (multi-platform)",
        "description": "Moderate a comment on one of your own posts. One endpoint, because every action is a verb that carries its own inverse: hide/unhide, like/unlike, pin/unpin. You send the verb, never a boolean, so replaying a request can never flip a comment back. Platforms: tiktok, facebook, instagram, youtube, threads and bluesky (hide/unhide replies in the account's own threads, like/unlike); any other answers 400 `platform_not_supported`. TikTok requires the `comments` capability (a reconnected account).",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "user",
                  "comment_id",
                  "action"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "tiktok",
                      "facebook",
                      "instagram",
                      "youtube",
                      "threads",
                      "bluesky"
                    ],
                    "description": "The network to act on."
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile username as configured in Upload-Post."
                  },
                  "comment_id": {
                    "type": "string",
                    "description": "The comment to act on."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "hide",
                      "unhide",
                      "like",
                      "unlike",
                      "pin",
                      "unpin"
                    ],
                    "description": "The verb to apply. Send the inverse verb to undo it."
                  },
                  "post_id": {
                    "type": "string",
                    "description": "The post the comment hangs from. Required for hide, unhide, pin and unpin; do not send it for like/unlike, which resolve from the comment alone."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Action applied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "tiktok"
                    },
                    "action": {
                      "type": "string",
                      "example": "hide"
                    },
                    "comment_id": {
                      "type": "string",
                      "example": "7401234567890999888"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "error_code `platform_not_supported` (only tiktok acts on comments today), `tiktok_reconnect_required` (reconnect the account), or `invalid_parameter` (TikTok error 40002: a comment that was deleted, a post_id that is not one of the account's videos, pin on a reply; retrying fails the same way).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "enum": [
                        "platform_not_supported",
                        "tiktok_reconnect_required",
                        "invalid_parameter"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/TikTokReauthRequired"
          },
          "502": {
            "$ref": "#/components/responses/TikTokUpstreamError"
          }
        }
      }
    },
    "/uploadposts/posts/retry": {
      "post": {
        "operationId": "retryPost",
        "summary": "Retry a failed upload",
        "description": "Re-enqueue an upload that failed on one or more platforms. Only failed platforms are retried; the original media snapshot is reused, so no re-upload is needed. Provide request_id or job_id.",
        "tags": [
          "Upload Management"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "request_id": {
                    "type": "string",
                    "description": "The request_id returned by the original async upload. Provide request_id or job_id."
                  },
                  "job_id": {
                    "type": "string",
                    "description": "The scheduled job ID. Alternative to request_id."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Failed platforms re-enqueued for retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Neither request_id nor job_id provided."
          },
          "404": {
            "description": "No upload found for the given identifier."
          },
          "409": {
            "description": "Nothing to retry (no failed platforms)."
          },
          "429": {
            "$ref": "#/components/responses/ScheduledPostsLimit"
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/posts/unpublish": {
      "post": {
        "operationId": "unpublishPost",
        "summary": "Unpublish (delete) a published post",
        "description": "Delete a post already published to a platform. Supported: facebook, youtube, x, linkedin, threads. Instagram and TikTok do NOT support deletion via API and return a clear error.",
        "tags": [
          "Upload Management"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "user",
                  "post_id"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "facebook",
                      "youtube",
                      "x",
                      "linkedin",
                      "threads",
                      "telegram"
                    ],
                    "description": "Platform to delete from. Instagram and TikTok are not supported."
                  },
                  "delete_all_messages": {
                    "type": "boolean",
                    "description": "Telegram: delete every message of the post (album items, caption rest, first comment, text sent before a location...), not only post_id. Only in the chat the profile is connected to, within 48 hours. Default false. The answer lists requested_message_ids."
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile username as configured in Upload-Post."
                  },
                  "post_id": {
                    "type": "string",
                    "description": "The published post's ID on the target platform."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Post deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields or an unsupported platform (e.g. instagram, tiktok)."
          },
          "403": {
            "description": "Not authorized to delete the post."
          },
          "404": {
            "description": "No post found for the given post_id."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/comments/reply": {
      "post": {
        "operationId": "replyToComment",
        "summary": "Reply to comment (private reply DM)",
        "description": "Send a private reply (DM) to the author of a comment on your Instagram post. The comment must be less than 7 days old.",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "user",
                  "comment_id",
                  "message"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "instagram"
                    ],
                    "description": "Must be 'instagram'."
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile username as configured in Upload-Post."
                  },
                  "comment_id": {
                    "type": "string",
                    "description": "ID of the comment to reply to (from Get Post Comments)."
                  },
                  "message": {
                    "type": "string",
                    "description": "The private reply message text."
                  },
                  "buttons": {
                    "type": "array",
                    "maxItems": 3,
                    "description": "Up to 3 web_url buttons rendered in the Instagram DM.",
                    "items": {
                      "type": "object",
                      "required": [
                        "title",
                        "url"
                      ],
                      "properties": {
                        "title": {
                          "type": "string",
                          "maxLength": 20,
                          "description": "Button label (max 20 chars)."
                        },
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "description": "Destination URL (http/https)."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Private reply sent successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "recipient_id": {
                      "type": "string"
                    },
                    "message_id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields or invalid account."
          },
          "429": {
            "description": "Daily DM limit exceeded."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/dms/conversations": {
      "get": {
        "operationId": "getDmConversations",
        "summary": "Get DM conversations (Instagram, Bluesky, Telegram)",
        "description": "Retrieve the DM conversations of the account connected to the profile, including participants and recent messages. Bluesky (platform=bluesky) needs an app password created with access to direct messages (403 bluesky_dm_scope_missing otherwise), returns at most 25 conversations per page and adds status, unread_count, muted, kind, account and per-message direction, type, attachments, reactions and reply_to. Bluesky also takes kind, lock_status, view (summary: up to 100 per page; requests: experimental) and include (unread_counts, members); group conversations add a group block. Anything Bluesky marks as under development answers with experimental: true (403 bluesky_dm_experimental_disabled while not enabled). Telegram (platform=telegram) lists only the private chats of your own bot, and needs the bot's updates turned on with POST /uploadposts/telegram/updates (409 telegram_updates_not_enabled while they are off for that bot). WhatsApp and Messenger conversations are only open to a limited set of accounts while Meta reviews the permissions, and are not described here yet.",
        "tags": [
          "Instagram Interactions"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "bluesky",
                "telegram"
              ]
            },
            "description": "'instagram', 'bluesky' or 'telegram' (Telegram needs the bot's updates turned on)."
          },
          {
            "name": "business_connection_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Telegram: the inbox of a connected Business account."
          },
          {
            "name": "include_profile_photos",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Telegram: add profile_pic_media_id to each contact."
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            },
            "description": "Conversations per page (Bluesky: at most 25; higher values are lowered)."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pagination.next_cursor from the previous page."
          },
          {
            "name": "participant_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only your conversation with this person (Instagram: IGSID; Bluesky: handle or DID)."
          },
          {
            "name": "conversation_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bluesky: only this conversation."
          },
          {
            "name": "messages_cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bluesky, with conversation_id: older messages of that conversation."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "request",
                "accepted"
              ]
            },
            "description": "Bluesky: message requests only, or accepted conversations only."
          },
          {
            "name": "read_state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unread"
              ]
            },
            "description": "Bluesky: only conversations with unread messages."
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "direct",
                "group"
              ]
            },
            "description": "Bluesky: only direct or group conversations."
          },
          {
            "name": "lock_status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unlocked",
                "locked",
                "locked-permanently"
              ]
            },
            "description": "Bluesky: only conversations with this lock status (groups)."
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "summary",
                "requests"
              ]
            },
            "description": "Bluesky: 'summary' lists up to 100 conversations with only their latest message; 'requests' (experimental) lists incoming message requests and your pending group join requests, up to 100."
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bluesky, comma-separated: 'unread_counts' adds unread_counts {accepted, request}; 'members' (with conversation_id) adds every member of that conversation."
          },
          {
            "name": "members_limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Bluesky, with include=members: members per page (1-100, default 50)."
          },
          {
            "name": "members_cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bluesky, with include=members: paging.next_cursor of the previous members page."
          }
        ],
        "responses": {
          "200": {
            "description": "Conversations retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "conversations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Conversation thread ID."
                          },
                          "participants": {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "description": "Participant IGSID."
                                    },
                                    "username": {
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "messages": {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "created_time": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "from": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "username": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "message": {
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters."
          },
          "403": {
            "description": "Bluesky: error_code bluesky_dm_scope_missing (app password without DM access)."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/dms/send": {
      "post": {
        "operationId": "sendDm",
        "summary": "Send a DM (Instagram, Bluesky, Telegram)",
        "description": "Instagram: send a direct message to a user by IGSID; the recipient must have messaged your account first (24-hour messaging window policy enforced by Meta). Bluesky: recipient_id is a handle, DID or bsky.app profile link (or pass conversation_id); text up to 1000 characters (400 bluesky_message_too_long), up to 10 @handle mentions linked, one shared Bluesky post as attachment, reply_to, and sender_action (mark_seen, react, unreact, delete, accept, mute, unmute, leave). Buttons and templates are refused with 400. 504 bluesky_send_unconfirmed means the DM may have gone out: read the conversation before sending again. Telegram (your own bot): recipient_id is the numeric chat id; text up to 4096 characters, attachments by url or media_id (file_id), inline buttons (url or callback_data), reply_to, location, contact, business_connection_id (send as your Business account), checklist (Business), and sender_action (typing and the other chat actions, react, unreact, delete, mark_read and edit_checklist in Business chats). 403 telegram_recipient_not_started / telegram_recipient_blocked; 504 telegram_send_unconfirmed: it may have been sent. WhatsApp and Messenger DMs are only open to a limited set of accounts while Meta reviews the permissions, and are not described here yet.",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "user"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "instagram",
                      "bluesky",
                      "telegram"
                    ],
                    "description": "'instagram', 'bluesky' or 'telegram'."
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile username as configured in Upload-Post."
                  },
                  "recipient_id": {
                    "type": "string",
                    "description": "Instagram: IGSID of the recipient. Bluesky: handle, DID or bsky.app profile link. Required unless conversation_id is sent (Bluesky). Telegram: numeric chat id of a person (sender.id of dm_received); groups and channels are refused (telegram_private_chats_only)."
                  },
                  "message": {
                    "type": "string",
                    "description": "The text message to send. Required unless a Bluesky post is shared or a sender_action is sent. Bluesky: up to 1000 characters."
                  },
                  "conversation_id": {
                    "type": "string",
                    "description": "Bluesky: send to this conversation (also group conversations)."
                  },
                  "attachments": {
                    "type": "object",
                    "description": "Bluesky: one post to share, {\"type\": \"post\", \"url\": \"https://bsky.app/profile/<handle>/post/<id>\"} or {\"type\": \"post\", \"uri\": \"at://...\"}. Experimental: a group invitation {\"type\": \"join_link\", \"code\": \"...\"}."
                  },
                  "reply_to": {
                    "type": "string",
                    "description": "Bluesky: id of a message in the same conversation to reply to."
                  },
                  "sender_action": {
                    "type": "string",
                    "description": "Bluesky: mark_seen (mark_read), mark_all_read (every conversation; only without recipient_id / conversation_id / message; optional status), react, unreact, delete, accept, mute, unmute or leave. Does not consume the daily DM quota."
                  },
                  "message_id": {
                    "type": "string",
                    "description": "Bluesky: message the sender_action applies to (required for react, unreact, delete)."
                  },
                  "reaction": {
                    "type": "string",
                    "description": "Bluesky: a single emoji for react / unreact (default ❤️)."
                  },
                  "business_connection_id": {
                    "type": "string",
                    "description": "Telegram: send on behalf of the connected Telegram Business account."
                  },
                  "parse_mode": {
                    "type": "string",
                    "enum": [
                      "MarkdownV2",
                      "HTML",
                      "Markdown"
                    ],
                    "description": "Telegram: text formatting."
                  },
                  "checklist": {
                    "type": "object",
                    "description": "Telegram Business: InputChecklist (title and 1-30 tasks)."
                  },
                  "location": {
                    "type": "object",
                    "description": "Telegram: {latitude, longitude[, title, address]} (with title and address it is a venue)."
                  },
                  "contact": {
                    "type": "object",
                    "description": "Telegram: {phone_number, first_name[, last_name, vcard]}."
                  },
                  "message_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Telegram: sender_action delete for up to 100 messages."
                  },
                  "buttons": {
                    "type": "array",
                    "maxItems": 3,
                    "description": "Up to 3 web_url buttons rendered in the Instagram DM.",
                    "items": {
                      "type": "object",
                      "required": [
                        "title",
                        "url"
                      ],
                      "properties": {
                        "title": {
                          "type": "string",
                          "maxLength": 20,
                          "description": "Button label (max 20 chars)."
                        },
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "description": "Destination URL (http/https)."
                        }
                      }
                    }
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "request",
                      "accepted"
                    ],
                    "description": "Bluesky, with sender_action=mark_all_read: only those conversations."
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Bluesky, required with messages: repeating a request with the same key returns the first answer and sends nothing again."
                  },
                  "messages": {
                    "type": "array",
                    "maxItems": 100,
                    "description": "Bluesky (not generally available yet: 403 bluesky_dm_batch_disabled): up to 25 DMs in one request, to existing conversations only (conversation_id). Requires idempotency_key; one batch per minute per profile; a lookup budget as large as the batch (25: one per distinct conversation, one per distinct @mention, 2 per shared post); no identical message twice to the same conversation. Each sent message counts as one DM. The response has sent, unconfirmed, failed and results[] in order; unconfirmed items come in a 200 with retryable: false.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "recipient_id": {
                          "type": "string"
                        },
                        "conversation_id": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "attachments": {
                          "type": "object"
                        },
                        "reply_to": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "DM sent successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "recipient_id": {
                      "type": "string",
                      "description": "Bluesky: the recipient's DID."
                    },
                    "conversation_id": {
                      "type": "string",
                      "description": "Bluesky."
                    },
                    "created_time": {
                      "type": "string",
                      "description": "Bluesky."
                    },
                    "message_id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields or invalid account. Bluesky: bluesky_message_too_long, bluesky_rejected (bluesky_error carries Bluesky's error name), or an unsupported field."
          },
          "401": {
            "description": "Bluesky: bluesky_reauth_required."
          },
          "403": {
            "description": "Bluesky: bluesky_dm_scope_missing, bluesky_recipient_unavailable (with reason), bluesky_dm_experimental_disabled or bluesky_dm_batch_disabled."
          },
          "404": {
            "description": "Bluesky: bluesky_recipient_not_found, bluesky_conversation_not_found or bluesky_post_not_found."
          },
          "429": {
            "description": "Daily DM limit exceeded, dm_rate_limited, or Bluesky: bluesky_rate_limited."
          },
          "502": {
            "description": "Bluesky: bluesky_chat_unavailable (nothing was sent)."
          },
          "503": {
            "description": "Bluesky: bluesky_edge_rate_limited (retry_after)."
          },
          "504": {
            "description": "Bluesky: bluesky_send_unconfirmed (the DM may have gone out; retryable false)."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/uploadposts/webhooks/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List webhook deliveries",
        "tags": [
          "Webhooks"
        ],
        "description": "Deliveries of the account's webhooks (account and per-profile), newest first, kept for 7 days. Each delivery shows its attempts; webhooks are delivered at least once with up to 6 attempts (retries after 1 min, 5 min, 30 min, 2 h and 6 h).",
        "parameters": [
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this event, e.g. upload_completed or dm_received."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivered",
                "failed",
                "cancelled"
              ]
            },
            "description": "Only deliveries in this status."
          },
          {
            "name": "request_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only the deliveries of one upload."
          },
          {
            "name": "job_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only the deliveries of one scheduled/async job."
          },
          {
            "name": "profile_username",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only the deliveries of that profile's webhook."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "Page size (out-of-range values are clamped)."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 1
            },
            "description": "Page number; a page above 50 answers 400."
          },
          {
            "name": "include_payload",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Include each delivery's payload."
          },
          {
            "name": "subscription_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only the deliveries of one webhook subscription (target subscription)."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "retention_days": {
                      "type": "integer",
                      "example": 7
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unknown status, or page above 50.",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "message": "page must be <= 50; narrow the list with status, event or request_id"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          }
        }
      }
    },
    "/uploadposts/webhooks/deliveries/{delivery_id}": {
      "get": {
        "operationId": "getWebhookDelivery",
        "summary": "Get one webhook delivery",
        "tags": [
          "Webhooks"
        ],
        "description": "One logged delivery, always with its payload.",
        "parameters": [
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "delivery": {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Not found, older than 7 days, or another account's.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryError"
                },
                "example": {
                  "success": false,
                  "message": "Delivery not found",
                  "reason": "not_found"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/webhooks/deliveries/{delivery_id}/redeliver": {
      "post": {
        "operationId": "redeliverWebhookDelivery",
        "summary": "Redeliver a webhook",
        "tags": [
          "Webhooks"
        ],
        "description": "Sends a logged delivery again, right away, with the same body, to the webhook URL configured now. It is a new delivery (new X-Upload-Post-Delivery, original id in X-Upload-Post-Redelivery-Of) that follows the retry schedule if it fails in a retryable way. success:true means the redelivery was made; check delivery.status for the outcome.",
        "parameters": [
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The new delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "delivery": {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Delivery not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryError"
                },
                "example": {
                  "success": false,
                  "message": "Delivery not found",
                  "reason": "not_found"
                }
              }
            }
          },
          "409": {
            "description": "Nowhere to send it, or it cannot be sent again (a removed webhook or subscription, a disabled subscription, a blocked URL or a real-time event that is not kept).\nreason `webhook_removed`, `event_unsubscribed`, `blocked_url`, `subscription_removed`, `subscription_disabled` or `not_redeliverable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryError"
                },
                "example": {
                  "success": false,
                  "message": "This webhook is no longer configured, so there is nowhere to redeliver to",
                  "reason": "webhook_removed"
                }
              }
            }
          },
          "503": {
            "description": "Redelivery temporarily disabled, or webhook subscriptions switched off for a delivery of a subscription.\nreason `delivery_log_disabled` or `subscriptions_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryError"
                },
                "example": {
                  "success": false,
                  "message": "Webhook redelivery is temporarily disabled",
                  "reason": "delivery_log_disabled"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/autodms/rules": {
      "post": {
        "operationId": "createAutoDMRule",
        "summary": "Create an account-wide Instagram AutoDM rule",
        "tags": [
          "Instagram Interactions"
        ],
        "description": "Watches the whole Instagram account (every post and reel, story replies, story mentions, keyword DMs) with no expiry; up to 10 rules per Instagram account. Works from Meta webhooks only: creating a rule subscribes the account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "profile_username",
                  "reply_message"
                ],
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "reply_message": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "DM text (max 1000 characters; 640 with buttons)."
                  },
                  "triggers": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "comment",
                            "story_reply",
                            "story_mention",
                            "dm_keyword"
                          ]
                        }
                      },
                      {
                        "type": "string",
                        "description": "Comma-separated triggers."
                      }
                    ],
                    "description": "Default [\"comment\"]."
                  },
                  "trigger_keywords": {
                    "oneOf": [
                      {
                        "type": "array",
                        "maxItems": 20,
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string",
                        "description": "One keyword."
                      }
                    ],
                    "description": "Case- and accent-insensitive; required for dm_keyword; null or [] for no filter. Blank entries are ignored; nothing usable left returns 400."
                  },
                  "buttons": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "required": [
                        "title",
                        "url"
                      ],
                      "properties": {
                        "title": {
                          "type": "string",
                          "maxLength": 20
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    }
                  },
                  "per_user_cooldown_hours": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 720,
                    "default": 24,
                    "description": "Whole hours. For story_reply, story_mention and dm_keyword it is never below 24 (message_cooldown_hours)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Rule created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "rule": {
                      "$ref": "#/components/schemas/AutoDMRule"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid fields, unknown profile, no Instagram account on the profile, or error_code reconnect_required.",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "error": "trigger_keywords contain no usable text"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "error_code PROFILE_BLOCKED: profile not available on your plan."
          },
          "409": {
            "description": "error_code duplicate_rule (with rule_id), rule_limit_reached or rule_creation_in_progress.",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "error_code": "rule_limit_reached",
                  "error": "Limit reached: at most 10 rules per Instagram account."
                }
              }
            }
          },
          "502": {
            "description": "error_code webhook_subscription_failed: Meta refused the webhook subscription; reconnecting Instagram usually fixes it."
          },
          "503": {
            "description": "error_code account_rules_disabled: account-wide rules temporarily switched off."
          }
        }
      },
      "get": {
        "operationId": "listAutoDMRules",
        "summary": "List account-wide AutoDM rules",
        "tags": [
          "Instagram Interactions"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this profile's rules."
          }
        ],
        "responses": {
          "200": {
            "description": "Rules.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "enabled": {
                      "type": "boolean",
                      "description": "false while account-wide rules are switched off on our side."
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AutoDMRule"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          }
        }
      }
    },
    "/uploadposts/autodms/rules/pause": {
      "post": {
        "operationId": "pauseAutoDMRule",
        "summary": "Pause an AutoDM rule",
        "tags": [
          "Instagram Interactions"
        ],
        "description": "A paused rule answers nothing; events already queued for it are dropped.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rule_id"
                ],
                "properties": {
                  "rule_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Rule paused",
                  "rule_id": "rule_4f1c2a9e0b7d4c51a2e3f6b8"
                }
              }
            }
          },
          "400": {
            "description": "Missing rule_id.",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "error": "Missing rule_id"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Rule not found (or not yours).",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "error": "Rule not found"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/autodms/rules/resume": {
      "post": {
        "operationId": "resumeAutoDMRule",
        "summary": "Resume an AutoDM rule",
        "tags": [
          "Instagram Interactions"
        ],
        "description": "Subscribes the account again if needed and brings back a stopped rule once its Instagram account is connected to its profile again.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rule_id"
                ],
                "properties": {
                  "rule_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Rule resumed",
                  "rule_id": "rule_4f1c2a9e0b7d4c51a2e3f6b8"
                }
              }
            }
          },
          "400": {
            "description": "Missing rule_id.",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "error": "Missing rule_id"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Rule not found (or not yours).",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "error": "Rule not found"
                }
              }
            }
          },
          "409": {
            "description": "error_code rule_stopped with stop_reason: the account is not connected to the rule's profile."
          },
          "502": {
            "description": "error_code webhook_subscription_failed."
          },
          "503": {
            "description": "error_code account_rules_disabled."
          }
        }
      }
    },
    "/uploadposts/autodms/rules/delete": {
      "post": {
        "operationId": "deleteAutoDMRule",
        "summary": "Delete an AutoDM rule",
        "tags": [
          "Instagram Interactions"
        ],
        "description": "Also drops its queued events and cooldowns.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rule_id"
                ],
                "properties": {
                  "rule_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Rule deleted",
                  "rule_id": "rule_4f1c2a9e0b7d4c51a2e3f6b8"
                }
              }
            }
          },
          "400": {
            "description": "Missing rule_id.",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "error": "Missing rule_id"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Rule not found (or not yours).",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "error": "Rule not found"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/suggested-posts": {
      "post": {
        "operationId": "telegramSuggestedPost",
        "summary": "Approve or decline a Telegram suggested post",
        "description": "approveSuggestedPost / declineSuggestedPost in the channel's direct messages chat. The bot needs Post Messages (approve) or Manage Direct Messages (decline).",
        "tags": [
          "Platform Integration"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "message_id",
                  "action"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "message_id": {
                    "type": "integer",
                    "description": "Suggested post message id."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "decline"
                    ]
                  },
                  "send_date": {
                    "type": "integer",
                    "description": "Approve: Unix time to publish (max 30 days ahead)."
                  },
                  "comment": {
                    "type": "string",
                    "description": "Decline: note for the author (max 128)."
                  },
                  "chat_id": {
                    "type": "string",
                    "description": "Direct messages chat, if not the connected chat."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Telegram answer (`result` of the Bot API method).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, Telegram not connected or request refused by Telegram (`error_code`: telegram_invalid_parameter, telegram_not_connected, telegram_bad_request)."
          },
          "403": {
            "description": "`telegram_not_enough_rights`."
          },
          "429": {
            "description": "`telegram_rate_limited` (with `retry_after`)."
          }
        }
      }
    },
    "/uploadposts/telegram/users/{user_id}/personal-chat-messages": {
      "get": {
        "operationId": "telegramPersonalChatMessages",
        "summary": "Last messages of a user's personal channel (Telegram)",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "description": "Telegram user id.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Telegram answer (`result` of the Bot API method).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, Telegram not connected or request refused by Telegram (`error_code`: telegram_invalid_parameter, telegram_not_connected, telegram_bad_request)."
          },
          "403": {
            "description": "`telegram_not_enough_rights`."
          },
          "429": {
            "description": "`telegram_rate_limited` (with `retry_after`)."
          }
        }
      }
    },
    "/uploadposts/telegram/users/{user_id}/profile-audios": {
      "get": {
        "operationId": "telegramProfileAudios",
        "summary": "Profile audios of a Telegram user",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "description": "Telegram user id.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Telegram answer (`result` of the Bot API method).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, Telegram not connected or request refused by Telegram (`error_code`: telegram_invalid_parameter, telegram_not_connected, telegram_bad_request)."
          },
          "403": {
            "description": "`telegram_not_enough_rights`."
          },
          "429": {
            "description": "`telegram_rate_limited` (with `retry_after`)."
          }
        }
      }
    },
    "/uploadposts/telegram/share-theme-backdrops": {
      "get": {
        "operationId": "telegramShareThemeBackdrops",
        "summary": "Backdrops for the Telegram share screen theme",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with Telegram connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Telegram answer (`result` of the Bot API method).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter, Telegram not connected or request refused by Telegram (`error_code`: telegram_invalid_parameter, telegram_not_connected, telegram_bad_request)."
          },
          "403": {
            "description": "`telegram_not_enough_rights`."
          },
          "429": {
            "description": "`telegram_rate_limited` (with `retry_after`)."
          }
        }
      }
    },
    "/uploadposts/telegram/invite-links": {
      "post": {
        "operationId": "telegramCreateInviteLink",
        "summary": "Create an invite link",
        "description": "createChatInviteLink, or createChatSubscriptionInviteLink with subscription_price. Needs can_invite_users.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "name": {
                    "type": "string"
                  },
                  "expire_date": {
                    "type": "integer"
                  },
                  "member_limit": {
                    "type": "integer"
                  },
                  "creates_join_request": {
                    "type": "boolean"
                  },
                  "subscription_price": {
                    "type": "integer",
                    "description": "1-10000 Stars (channels)."
                  },
                  "subscription_period": {
                    "type": "integer",
                    "description": "2592000 only."
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "telegramEditInviteLink",
        "summary": "Edit an invite link",
        "description": "editChatInviteLink / editChatSubscriptionInviteLink (subscription=true).",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "invite_link"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "invite_link": {
                    "type": "string"
                  },
                  "subscription": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "expire_date": {
                    "type": "integer"
                  },
                  "member_limit": {
                    "type": "integer"
                  },
                  "creates_join_request": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "telegramRevokeInviteLink",
        "summary": "Revoke an invite link",
        "description": "revokeChatInviteLink. Needs confirm.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "invite_link",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "invite_link": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/invite-links/primary": {
      "post": {
        "operationId": "telegramExportPrimaryLink",
        "summary": "New primary invite link",
        "description": "exportChatInviteLink; revokes the previous primary link. Needs confirm.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/join-requests": {
      "post": {
        "operationId": "telegramAnswerJoinRequest",
        "summary": "Approve or decline a join request",
        "description": "approveChatJoinRequest / declineChatJoinRequest.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "user_id",
                  "action"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "user_id": {
                    "type": "integer"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "decline"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/members": {
      "get": {
        "operationId": "telegramGetMembers",
        "summary": "Read a member or list administrators",
        "description": "getChatMember (user_id) or getChatAdministrators.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Member to read."
          },
          {
            "name": "return_bots",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Include other bots in the admin list."
          }
        ]
      },
      "post": {
        "operationId": "telegramMemberAction",
        "summary": "Moderate a member",
        "description": "banChatMember, unbanChatMember, restrictChatMember, promoteChatMember, setChatAdministratorCustomTitle, setChatMemberTag, banChatSenderChat, unbanChatSenderChat, deleteAllMessageReactions.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "action"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "ban",
                      "unban",
                      "restrict",
                      "promote",
                      "demote",
                      "set_title",
                      "set_tag",
                      "ban_sender_chat",
                      "unban_sender_chat",
                      "delete_all_reactions"
                    ]
                  },
                  "user_id": {
                    "type": "integer"
                  },
                  "sender_chat_id": {
                    "type": "integer"
                  },
                  "actor_chat_id": {
                    "type": "integer"
                  },
                  "until_date": {
                    "type": "integer"
                  },
                  "revoke_messages": {
                    "type": "boolean"
                  },
                  "only_if_banned": {
                    "type": "boolean",
                    "description": "Defaults to true."
                  },
                  "permissions": {
                    "type": "object"
                  },
                  "use_independent_chat_permissions": {
                    "type": "boolean"
                  },
                  "rights": {
                    "type": "object",
                    "description": "promoteChatMember booleans."
                  },
                  "custom_title": {
                    "type": "string"
                  },
                  "tag": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/topics/icons": {
      "get": {
        "operationId": "telegramTopicIcons",
        "summary": "List forum topic icons",
        "description": "getForumTopicIconStickers.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/uploadposts/telegram/topics": {
      "post": {
        "operationId": "telegramCreateTopic",
        "summary": "Create a forum topic",
        "description": "createForumTopic. Needs can_manage_topics.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "name"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "name": {
                    "type": "string"
                  },
                  "icon_color": {
                    "type": "integer"
                  },
                  "icon_custom_emoji_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "telegramUpdateTopic",
        "summary": "Edit, close, reopen, hide, unhide or unpin a topic",
        "description": "editForumTopic, closeForumTopic, reopenForumTopic, unpinAllForumTopicMessages and the General topic variants (general=true).",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "message_thread_id": {
                    "type": "integer"
                  },
                  "general": {
                    "type": "boolean"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "edit",
                      "close",
                      "reopen",
                      "hide",
                      "unhide",
                      "unpin_all"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "icon_custom_emoji_id": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "telegramDeleteTopic",
        "summary": "Delete a forum topic",
        "description": "deleteForumTopic (with all its messages). Needs confirm.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "message_thread_id",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "message_thread_id": {
                    "type": "integer"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/unpin-all": {
      "post": {
        "operationId": "telegramUnpinAll",
        "summary": "Unpin every message",
        "description": "unpinAllChatMessages. Needs confirm.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/leave": {
      "post": {
        "operationId": "telegramLeaveChat",
        "summary": "Make the bot leave the chat",
        "description": "leaveChat. Needs confirm.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/bot-profile": {
      "get": {
        "operationId": "telegramGetBotProfile",
        "summary": "Read the bot profile",
        "description": "getMe, getMyName, getMyDescription, getMyShortDescription, getChatMenuButton, getMyDefaultAdministratorRights.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Two-letter language code."
          }
        ]
      },
      "patch": {
        "operationId": "telegramUpdateBotProfile",
        "summary": "Update the bot profile",
        "description": "setMyName, setMyDescription, setMyShortDescription, setMyProfilePhoto, removeMyProfilePhoto, setChatMenuButton, setMyDefaultAdministratorRights.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "short_description": {
                    "type": "string"
                  },
                  "language_code": {
                    "type": "string"
                  },
                  "photo": {
                    "type": "string",
                    "format": "binary"
                  },
                  "animation": {
                    "type": "string",
                    "format": "binary"
                  },
                  "main_frame_timestamp": {
                    "type": "number"
                  },
                  "remove_photo": {
                    "type": "boolean"
                  },
                  "menu_button": {
                    "type": "object"
                  },
                  "menu_chat_id": {
                    "type": "integer"
                  },
                  "default_administrator_rights": {
                    "type": "object"
                  },
                  "for_channels": {
                    "type": "boolean"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "short_description": {
                    "type": "string"
                  },
                  "language_code": {
                    "type": "string"
                  },
                  "photo": {
                    "type": "string",
                    "format": "binary"
                  },
                  "animation": {
                    "type": "string",
                    "format": "binary"
                  },
                  "main_frame_timestamp": {
                    "type": "number"
                  },
                  "remove_photo": {
                    "type": "boolean"
                  },
                  "menu_button": {
                    "type": "object"
                  },
                  "menu_chat_id": {
                    "type": "integer"
                  },
                  "default_administrator_rights": {
                    "type": "object"
                  },
                  "for_channels": {
                    "type": "boolean"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/bot-commands": {
      "get": {
        "operationId": "telegramGetBotCommands",
        "summary": "Read the bot commands",
        "description": "getMyCommands.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "BotCommandScope as JSON."
          }
        ]
      },
      "post": {
        "operationId": "telegramSetBotCommands",
        "summary": "Set the bot commands",
        "description": "setMyCommands.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "commands"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "commands": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "scope": {
                    "type": "object"
                  },
                  "language_code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "telegramDeleteBotCommands",
        "summary": "Delete the bot commands",
        "description": "deleteMyCommands. Needs confirm.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "scope": {
                    "type": "object"
                  },
                  "language_code": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/sticker-sets": {
      "get": {
        "operationId": "telegramGetStickerSet",
        "summary": "Read a sticker set or custom emoji",
        "description": "getStickerSet (name) / getCustomEmojiStickers (custom_emoji_ids).",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "custom_emoji_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated, up to 200."
          }
        ]
      },
      "post": {
        "operationId": "telegramCreateStickerSet",
        "summary": "Create a sticker set",
        "description": "createNewStickerSet. name must end in _by_<bot_username>.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "owner_user_id",
                  "name",
                  "title",
                  "stickers"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "owner_user_id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "stickers": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "sticker_type": {
                    "type": "string",
                    "enum": [
                      "regular",
                      "mask",
                      "custom_emoji"
                    ]
                  },
                  "needs_repainting": {
                    "type": "boolean"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "owner_user_id",
                  "name",
                  "title",
                  "stickers"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "owner_user_id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "stickers": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "sticker_type": {
                    "type": "string",
                    "enum": [
                      "regular",
                      "mask",
                      "custom_emoji"
                    ]
                  },
                  "needs_repainting": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "telegramUpdateStickerSet",
        "summary": "Edit a sticker set",
        "description": "addStickerToSet, replaceStickerInSet, deleteStickerFromSet, setStickerPositionInSet, setStickerEmojiList, setStickerKeywords, setStickerMaskPosition, setStickerSetTitle, setStickerSetThumbnail, setCustomEmojiStickerSetThumbnail.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "action"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "add_sticker",
                      "replace_sticker",
                      "delete_sticker",
                      "set_position",
                      "set_emoji_list",
                      "set_keywords",
                      "set_mask_position",
                      "set_title",
                      "set_thumbnail",
                      "set_custom_emoji_thumbnail"
                    ]
                  },
                  "owner_user_id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "sticker": {
                    "type": "string",
                    "description": "file_id, or an InputSticker object for add/replace."
                  },
                  "old_sticker": {
                    "type": "string"
                  },
                  "position": {
                    "type": "integer"
                  },
                  "emoji_list": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "mask_position": {
                    "type": "object"
                  },
                  "title": {
                    "type": "string"
                  },
                  "format": {
                    "type": "string"
                  },
                  "thumbnail": {
                    "type": "string"
                  },
                  "custom_emoji_id": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "action"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "add_sticker",
                      "replace_sticker",
                      "delete_sticker",
                      "set_position",
                      "set_emoji_list",
                      "set_keywords",
                      "set_mask_position",
                      "set_title",
                      "set_thumbnail",
                      "set_custom_emoji_thumbnail"
                    ]
                  },
                  "owner_user_id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "sticker": {
                    "type": "string",
                    "description": "file_id, or an InputSticker object for add/replace."
                  },
                  "old_sticker": {
                    "type": "string"
                  },
                  "position": {
                    "type": "integer"
                  },
                  "emoji_list": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "mask_position": {
                    "type": "object"
                  },
                  "title": {
                    "type": "string"
                  },
                  "format": {
                    "type": "string"
                  },
                  "thumbnail": {
                    "type": "string"
                  },
                  "custom_emoji_id": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "telegramDeleteStickerSet",
        "summary": "Delete a sticker set",
        "description": "deleteStickerSet. Needs confirm.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "name",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "name": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (true) for destructive actions."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/sticker-sets/upload": {
      "post": {
        "operationId": "telegramUploadStickerFile",
        "summary": "Upload a sticker file",
        "description": "uploadStickerFile; returns file_id.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code telegram_invalid_parameter), missing confirm (telegram_confirmation_required) or Telegram rejected the request."
          },
          "401": {
            "description": "telegram_reconnect_required: the bot token was revoked."
          },
          "403": {
            "description": "telegram_bot_not_admin / telegram_not_enough_rights (see required_right) or telegram_chat_unreachable."
          },
          "404": {
            "description": "telegram_not_connected, profile_not_found or telegram_user_not_found."
          },
          "429": {
            "description": "telegram_rate_limited (retry_after seconds)."
          },
          "502": {
            "description": "Telegram did not answer or failed."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "owner_user_id",
                  "sticker_format"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "owner_user_id": {
                    "type": "integer"
                  },
                  "sticker_format": {
                    "type": "string",
                    "enum": [
                      "static",
                      "animated",
                      "video"
                    ]
                  },
                  "sticker": {
                    "type": "string",
                    "format": "binary"
                  },
                  "sticker_url": {
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "owner_user_id",
                  "sticker_format"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Telegram connected."
                  },
                  "owner_user_id": {
                    "type": "integer"
                  },
                  "sticker_format": {
                    "type": "string",
                    "enum": [
                      "static",
                      "animated",
                      "video"
                    ]
                  },
                  "sticker": {
                    "type": "string",
                    "format": "binary"
                  },
                  "sticker_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/updates": {
      "get": {
        "operationId": "getTelegramUpdates",
        "summary": "Telegram updates status",
        "description": "Whether the profile's bot sends its updates to Upload-Post, and the webhook health Telegram reports.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          }
        ]
      },
      "post": {
        "operationId": "setTelegramUpdates",
        "summary": "Turn Telegram updates on or off",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_updates_unavailable` until the feature is available.\n\nOpt-in per bot. A webhook that is not Upload-Post's is never replaced without replace_existing_webhook=true (409 telegram_webhook_in_use otherwise). With no webhook, the answer warns that a getUpdates integration stops receiving.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "enabled"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "true to receive, false to stop."
                  },
                  "replace_existing_webhook": {
                    "type": "boolean",
                    "description": "Replace a webhook that is not Upload-Post's."
                  },
                  "forward_url": {
                    "type": "string",
                    "description": "https URL that also gets every raw update, signed with your webhook secret (required), one attempt."
                  },
                  "business_chats": {
                    "type": "boolean",
                    "description": "Also receive and keep the chats of the connected Telegram Business account (default false)."
                  },
                  "auto_answer_callbacks": {
                    "type": "boolean",
                    "description": "Empty answerCallbackQuery if you did not answer a button press in ~8 s."
                  },
                  "extra_updates": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "channel_post",
                        "edited_channel_post",
                        "chat_member",
                        "chat_boost",
                        "removed_chat_boost",
                        "managed_bot",
                        "stopped_message_generation"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/answer": {
      "post": {
        "operationId": "answerTelegramQuery",
        "summary": "Answer a Telegram query",
        "description": "Answer a callback_query, inline_query, join request, guest/widget query, shipping or pre-checkout query received as a telegram_update event. 410 telegram_query_expired when Telegram's time is up.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "type"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "callback",
                      "inline",
                      "join_request",
                      "join_request_web_app",
                      "guest",
                      "widget",
                      "shipping",
                      "pre_checkout"
                    ]
                  },
                  "query_id": {
                    "type": "string",
                    "description": "The query id (or the official field: callback_query_id, inline_query_id...)."
                  },
                  "text": {
                    "type": "string",
                    "description": "callback: 0-200 characters."
                  },
                  "show_alert": {
                    "type": "boolean",
                    "description": "callback."
                  },
                  "url": {
                    "type": "string",
                    "description": "callback."
                  },
                  "cache_time": {
                    "type": "integer",
                    "description": "callback / inline."
                  },
                  "results": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "inline: up to 50 InlineQueryResult."
                  },
                  "is_personal": {
                    "type": "boolean",
                    "description": "inline."
                  },
                  "next_offset": {
                    "type": "string",
                    "description": "inline."
                  },
                  "button": {
                    "type": "object",
                    "description": "inline: InlineQueryResultsButton."
                  },
                  "result": {
                    "description": "join_request: approve|decline|queue. guest: InlineQueryResult."
                  },
                  "web_app_url": {
                    "type": "string",
                    "description": "join_request_web_app: https URL."
                  },
                  "data": {
                    "type": "string",
                    "description": "widget: up to 1024 bytes."
                  },
                  "ok": {
                    "type": "boolean",
                    "description": "shipping / pre_checkout."
                  },
                  "shipping_options": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "error_message": {
                    "type": "string",
                    "description": "shipping / pre_checkout when ok is false."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/telegram/business-connections": {
      "get": {
        "operationId": "getTelegramBusinessConnections",
        "summary": "Telegram Business connections",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\nConnections of the bot with Telegram Business accounts (rights, enabled).",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "business_connection_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional when the bot has one active Business connection."
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/business-profile": {
      "get": {
        "operationId": "getTelegramBusinessProfile",
        "summary": "Telegram Business account",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\nThe connected account.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "business_connection_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional when the bot has one active Business connection."
          }
        ],
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "updateTelegramBusinessProfile",
        "summary": "Update the Telegram Business profile",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\nfirst_name/last_name, username, bio, photo (multipart or media_url, is_public), remove_photo, gift_settings.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "business_connection_id": {
                    "type": "string",
                    "description": ""
                  },
                  "first_name": {
                    "type": "string",
                    "description": "1-64."
                  },
                  "last_name": {
                    "type": "string",
                    "description": "0-64."
                  },
                  "username": {
                    "type": "string",
                    "description": "0-32."
                  },
                  "bio": {
                    "type": "string",
                    "description": "0-140."
                  },
                  "media_url": {
                    "type": "string",
                    "description": "Public URL of the new photo (JPG) or animation (MP4)."
                  },
                  "is_public": {
                    "type": "boolean",
                    "description": ""
                  },
                  "remove_photo": {
                    "type": "boolean",
                    "description": ""
                  },
                  "gift_settings": {
                    "type": "object",
                    "description": "{show_gift_button, accepted_gift_types}."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/business-stories": {
      "post": {
        "operationId": "postTelegramStory",
        "summary": "Post a Telegram story",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\npostStory on behalf of the Business account. Photos 1080x1920 up to 10 MB; videos 720x1280 H.265 up to 30 MB, 60 s.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "business_connection_id": {
                    "type": "string",
                    "description": ""
                  },
                  "media_url": {
                    "type": "string",
                    "description": "Or a multipart 'file'."
                  },
                  "active_period": {
                    "type": "integer",
                    "description": "6, 12, 24 or 48 (hours) or the seconds."
                  },
                  "caption": {
                    "type": "string",
                    "description": "0-2048."
                  },
                  "parse_mode": {
                    "type": "string",
                    "description": ""
                  },
                  "caption_entities": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "areas": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "post_to_chat_page": {
                    "type": "boolean",
                    "description": ""
                  },
                  "protect_content": {
                    "type": "boolean",
                    "description": ""
                  },
                  "story_id": {
                    "type": "integer",
                    "description": "PATCH / DELETE."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "editTelegramStory",
        "summary": "Edit a Telegram story",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\neditStory.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "business_connection_id": {
                    "type": "string",
                    "description": ""
                  },
                  "media_url": {
                    "type": "string",
                    "description": "Or a multipart 'file'."
                  },
                  "active_period": {
                    "type": "integer",
                    "description": "6, 12, 24 or 48 (hours) or the seconds."
                  },
                  "caption": {
                    "type": "string",
                    "description": "0-2048."
                  },
                  "parse_mode": {
                    "type": "string",
                    "description": ""
                  },
                  "caption_entities": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "areas": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "post_to_chat_page": {
                    "type": "boolean",
                    "description": ""
                  },
                  "protect_content": {
                    "type": "boolean",
                    "description": ""
                  },
                  "story_id": {
                    "type": "integer",
                    "description": "PATCH / DELETE."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteTelegramStory",
        "summary": "Delete a Telegram story",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\ndeleteStory.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "story_id"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "business_connection_id": {
                    "type": "string",
                    "description": ""
                  },
                  "media_url": {
                    "type": "string",
                    "description": "Or a multipart 'file'."
                  },
                  "active_period": {
                    "type": "integer",
                    "description": "6, 12, 24 or 48 (hours) or the seconds."
                  },
                  "caption": {
                    "type": "string",
                    "description": "0-2048."
                  },
                  "parse_mode": {
                    "type": "string",
                    "description": ""
                  },
                  "caption_entities": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "areas": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "post_to_chat_page": {
                    "type": "boolean",
                    "description": ""
                  },
                  "protect_content": {
                    "type": "boolean",
                    "description": ""
                  },
                  "story_id": {
                    "type": "integer",
                    "description": "PATCH / DELETE."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/business-stories/repost": {
      "post": {
        "operationId": "repostTelegramStory",
        "summary": "Repost a Telegram story",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\nrepostStory from another Business account of the same bot.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "from_chat_id",
                  "from_story_id",
                  "active_period"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "business_connection_id": {
                    "type": "string",
                    "description": ""
                  },
                  "from_chat_id": {
                    "type": "integer",
                    "description": ""
                  },
                  "from_story_id": {
                    "type": "integer",
                    "description": ""
                  },
                  "active_period": {
                    "type": "integer",
                    "description": ""
                  },
                  "post_to_chat_page": {
                    "type": "boolean",
                    "description": ""
                  },
                  "protect_content": {
                    "type": "boolean",
                    "description": ""
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/business-gifts": {
      "get": {
        "operationId": "getTelegramBusinessGifts",
        "summary": "Telegram Business gifts",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\ngetBusinessAccountGifts with Telegram's filters.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "business_connection_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional when the bot has one active Business connection."
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "manageTelegramBusinessGift",
        "summary": "Convert, upgrade, transfer or delete a gift",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\nIrreversible: requires confirm=true and an idempotency_key (a repeat with the same key returns the first answer).",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "action",
                  "owned_gift_id",
                  "confirm",
                  "idempotency_key"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "business_connection_id": {
                    "type": "string",
                    "description": ""
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "convert",
                      "upgrade",
                      "transfer",
                      "delete"
                    ]
                  },
                  "owned_gift_id": {
                    "type": "string",
                    "description": ""
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true."
                  },
                  "keep_original_details": {
                    "type": "boolean",
                    "description": "upgrade."
                  },
                  "star_count": {
                    "type": "integer",
                    "description": "upgrade / transfer."
                  },
                  "idempotency_key": {
                    "type": "string",
                    "description": "Required. Unique string (max 128): a repeat with the same key returns the first answer."
                  },
                  "new_owner_chat_id": {
                    "type": "integer",
                    "description": "transfer."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/business-stars": {
      "get": {
        "operationId": "getTelegramBusinessStars",
        "summary": "Telegram Business Stars balance",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\ngetBusinessAccountStarBalance.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "business_connection_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional when the bot has one active Business connection."
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/telegram/business-stars/transfer": {
      "post": {
        "operationId": "transferTelegramBusinessStars",
        "summary": "Move Stars to the bot",
        "description": "**Not generally available yet.** Off by default: answers `503` with `telegram_business_unavailable` until the feature is available.\n\ntransferBusinessAccountStars (1-10000). Requires confirm=true and an idempotency_key.",
        "tags": [
          "Telegram"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error (error_code)."
          },
          "401": {
            "description": "Invalid API key, or telegram_reauth_required."
          },
          "403": {
            "description": "telegram_business_right_missing or a Telegram refusal."
          },
          "409": {
            "description": "telegram_webhook_in_use / telegram_updates_not_enabled / telegram_business_not_connected."
          },
          "429": {
            "description": "Rate limited (retry_after)."
          },
          "503": {
            "description": "Temporarily unavailable."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "star_count",
                  "confirm",
                  "idempotency_key"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "business_connection_id": {
                    "type": "string",
                    "description": ""
                  },
                  "star_count": {
                    "type": "integer",
                    "description": "1-10000."
                  },
                  "idempotency_key": {
                    "type": "string",
                    "description": "Required. Unique string (max 128): a repeat with the same key returns the first answer."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/xrpc/{nsid}": {
      "get": {
        "operationId": "blueskyXrpc",
        "summary": "Bluesky read-only XRPC gateway",
        "description": "Forwards one allow-listed, read-only Bluesky method and returns Bluesky's JSON untouched in `data`. `data` is Bluesky's raw shape: if Bluesky changes its lexicon, it changes. Pass the method's own query parameters with Bluesky's names (camelCase, e.g. includePins, parentHeight); arrays by repeating the parameter or comma-separated. A parameter the method does not have answers 400 bluesky_invalid_parameter (unknown_parameters); a method outside the list answers 400 bluesky_method_not_allowed (allowed_methods). Public methods need no `user` and do not use the account's session: app.bsky.actor.getProfile, app.bsky.actor.getProfiles, app.bsky.actor.searchActors, app.bsky.actor.searchActorsTypeahead, app.bsky.feed.getActorFeeds, app.bsky.feed.getAuthorFeed, app.bsky.feed.getFeed, app.bsky.feed.getFeedGenerator, app.bsky.feed.getFeedGenerators, app.bsky.feed.getLikes, app.bsky.feed.getListFeed, app.bsky.feed.getPostThread, app.bsky.feed.getPosts, app.bsky.feed.getQuotes, app.bsky.feed.getRepostedBy, app.bsky.graph.getActorStarterPacks, app.bsky.graph.getFollowers, app.bsky.graph.getFollows, app.bsky.graph.getList, app.bsky.graph.getLists, app.bsky.graph.getRelationships, app.bsky.graph.getStarterPack, app.bsky.graph.getStarterPacks, app.bsky.graph.getSuggestedFollowsByActor, app.bsky.graph.searchStarterPacks, app.bsky.graph.searchStarterPacksV2, app.bsky.labeler.getServices. Account methods need `user`: app.bsky.embed.getEmbedExternalView, app.bsky.feed.searchPosts, app.bsky.feed.searchPostsV2, app.bsky.graph.getListsWithMembership, app.bsky.graph.getStarterPacksWithMembership. 15 methods read the account's private data and are not enabled on the gateway (403 bluesky_private_read_disabled): app.bsky.actor.getPreferences, app.bsky.actor.getSuggestions, app.bsky.bookmark.getBookmarks, app.bsky.feed.getActorLikes, app.bsky.feed.getTimeline, app.bsky.feed.getSuggestedFeeds, app.bsky.graph.getBlocks, app.bsky.graph.getMutes, app.bsky.graph.getListBlocks, app.bsky.graph.getListMutes, app.bsky.graph.getKnownFollowers, app.bsky.notification.getPreferences, app.bsky.notification.getUnreadCount, app.bsky.notification.listActivitySubscriptions, app.bsky.notification.listNotifications; notifications have their own /uploadposts/bluesky/notifications* endpoints and known followers /uploadposts/bluesky/followers?known=true. 47 methods in total. The birth date is never returned. With `user` and no `actor`, getProfile, getAuthorFeed, getActorFeeds, getActorStarterPacks, getFollowers, getFollows, getLists, getRelationships and getSuggestedFollowsByActor read the profile's own account. Post URIs (uri, uris) accept at:// or a bsky.app post link. limit 1-100 where Bluesky accepts it. Not available on purpose: writes, app.bsky.unspecced.*, getGroupedNotifications, chat.bsky.* (use /uploadposts/dms/*), com.atproto.*, tools.ozone.*. Successful answers are cached 60 s (notifications 30 s) on the validated parameters; public reads are shared, account reads cached per account.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "nsid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "app.bsky.feed.getAuthorFeed"
            },
            "description": "Bluesky method id (see the description for the allowed list)."
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected. Optional on public reads (they do not use the account's session); required on account reads."
          }
        ],
        "responses": {
          "200": {
            "description": "Bluesky's answer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "method": {
                      "type": "string",
                      "example": "app.bsky.feed.getAuthorFeed"
                    },
                    "authenticated": {
                      "type": "boolean",
                      "description": "true when Bluesky answered as the connected account."
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Bluesky's JSON for the method, as is (raw lexicon shape)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/post-engagement": {
      "get": {
        "operationId": "getPostEngagement",
        "summary": "Who liked, reposted or quoted a post (Bluesky)",
        "description": "Lists the accounts that liked or reposted a Bluesky post, or the posts that quote it. Public read: `user` is optional. likes items are accounts plus liked_at; reposts items are accounts; quotes items are posts. Cached 60 s on the validated parameters.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "bluesky"
              ],
              "default": "bluesky"
            },
            "description": "Only bluesky (anything else: 400 unsupported_platform)."
          },
          {
            "name": "post_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "at:// URI or bsky.app link of the post."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "likes",
                "reposts",
                "quotes"
              ],
              "default": "likes"
            },
            "description": "What to list."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pagination.next_cursor of the previous page."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "top"
              ]
            },
            "description": "Only with type=quotes."
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected. Optional on public reads (they do not use the account's session); required on account reads."
          }
        ],
        "responses": {
          "200": {
            "description": "Engagement list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "post_id": {
                      "type": "string",
                      "example": "at://did:plc:abc/app.bsky.feed.post/3lb2xyz"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "likes",
                        "reposts",
                        "quotes"
                      ]
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Accounts (likes adds liked_at; reposts) or posts (quotes)."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/BlueskyPagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/profile": {
      "get": {
        "operationId": "getBlueskyProfile",
        "summary": "Bluesky profiles",
        "description": "One or several Bluesky profiles (up to 25). Without actor, the profile's own account (needs user). One actor answers `profile`, several answer `profiles`.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Handle or DID, or several comma-separated (max 25)."
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected. Optional on public reads (they do not use the account's session); required on account reads."
          }
        ],
        "responses": {
          "200": {
            "description": "Profile(s).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "profile": {
                      "$ref": "#/components/schemas/BlueskyAccount"
                    },
                    "profiles": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlueskyAccount"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/search/posts": {
      "get": {
        "operationId": "searchBlueskyPosts",
        "summary": "Search Bluesky posts",
        "description": "Post search. Bluesky does not answer it without a signed-in account, so `user` is required.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected."
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search text."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "top"
              ]
            },
            "description": "Order."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD or ISO-8601 datetime with time zone."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD or ISO-8601 datetime with time zone."
          },
          {
            "name": "author",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Handle or DID."
          },
          {
            "name": "mentions",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Handle or DID."
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Language code."
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Linked domain."
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Linked URL."
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Hashtag without #, up to 10 (repeat or comma-separated)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pagination.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Posts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlueskyPost"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/BlueskyPagination"
                    },
                    "hits_total": {
                      "type": "integer",
                      "description": "Only when Bluesky reports it."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/search/actors": {
      "get": {
        "operationId": "searchBlueskyActors",
        "summary": "Search Bluesky accounts",
        "description": "Account search. Public read: no user needed. typeahead=true uses Bluesky's fast prefix search.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search text."
          },
          {
            "name": "typeahead",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Prefix (autocomplete) search."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pagination.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "actors": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlueskyAccount"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/BlueskyPagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/followers": {
      "get": {
        "operationId": "getBlueskyFollowers",
        "summary": "Bluesky followers",
        "description": "Followers of an account. Without actor, the profile's own account (needs user). known=true returns only the followers the connected account also follows (needs user).",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Handle or DID."
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected. Optional on public reads (they do not use the account's session); required on account reads."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "top"
              ]
            },
            "description": "Order."
          },
          {
            "name": "known",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Only followers the connected account also follows."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pagination.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "subject": {
                      "$ref": "#/components/schemas/BlueskyAccount"
                    },
                    "actors": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlueskyAccount"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/BlueskyPagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/follows": {
      "get": {
        "operationId": "getBlueskyFollows",
        "summary": "Bluesky follows",
        "description": "Accounts an account follows. Without actor, the profile's own account (needs user).",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Handle or DID."
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected. Optional on public reads (they do not use the account's session); required on account reads."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "top"
              ]
            },
            "description": "Order."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pagination.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "subject": {
                      "$ref": "#/components/schemas/BlueskyAccount"
                    },
                    "actors": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlueskyAccount"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/BlueskyPagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/notifications": {
      "get": {
        "operationId": "listBlueskyNotifications",
        "summary": "List Bluesky notifications",
        "description": "The connected account's notifications. Reading them does NOT mark them as seen. Cached 30 s per account on the validated parameters.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected."
          },
          {
            "name": "reasons",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "like",
                  "repost",
                  "follow",
                  "mention",
                  "reply",
                  "quote",
                  "starterpack-joined",
                  "verified",
                  "unverified",
                  "like-via-repost",
                  "repost-via-repost",
                  "subscribed-post",
                  "contact-match"
                ]
              }
            },
            "description": "Only these kinds, comma-separated or repeated."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pagination.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Notifications.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "notifications": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "at:// URI of the record that caused it."
                          },
                          "cid": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string",
                            "enum": [
                              "like",
                              "repost",
                              "follow",
                              "mention",
                              "reply",
                              "quote",
                              "starterpack-joined",
                              "verified",
                              "unverified",
                              "like-via-repost",
                              "repost-via-repost",
                              "subscribed-post",
                              "contact-match"
                            ]
                          },
                          "reason_subject": {
                            "type": "string",
                            "nullable": true
                          },
                          "author": {
                            "$ref": "#/components/schemas/BlueskyAccount"
                          },
                          "is_read": {
                            "type": "boolean"
                          },
                          "indexed_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "text": {
                            "type": "string",
                            "description": "Posts only (reply, mention, quote)."
                          },
                          "url": {
                            "type": "string",
                            "description": "Posts only."
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Posts only."
                          },
                          "reply_to": {
                            "type": "string",
                            "nullable": true,
                            "description": "Posts only."
                          },
                          "thread_root": {
                            "type": "string",
                            "nullable": true,
                            "description": "Posts only."
                          }
                        }
                      }
                    },
                    "seen_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/BlueskyPagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/notifications/unread-count": {
      "get": {
        "operationId": "getBlueskyUnreadCount",
        "summary": "Bluesky unread notification count",
        "description": "Cached 30 s per account on the validated parameters.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected."
          }
        ],
        "responses": {
          "200": {
            "description": "Count.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "count": {
                      "type": "integer",
                      "example": 7
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/notifications/seen": {
      "post": {
        "operationId": "markBlueskyNotificationsSeen",
        "summary": "Mark Bluesky notifications as seen",
        "description": "Marks the notifications as seen, like opening the notifications tab in the Bluesky app. Bluesky puts the unread count to 0 whatever seen_at says, and it cannot be undone: confirm=true is required (400 confirmation_required otherwise).",
        "tags": [
          "Bluesky"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true."
                  },
                  "seen_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 with time zone. Default now; not in the future."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Seen mark.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "seen_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "unread_count": {
                      "type": "integer",
                      "example": 0
                    },
                    "warning": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "confirmation_required (send confirm=true), bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_notification_writes_disabled (changing notification settings is temporarily disabled), bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/notification-preferences": {
      "get": {
        "operationId": "getBlueskyNotificationPreferences",
        "summary": "Get Bluesky notification preferences",
        "description": "Bluesky's own preferences object, as is. Cached 30 s per account.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected."
          }
        ],
        "responses": {
          "200": {
            "description": "Preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "preferences": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "updateBlueskyNotificationPreferences",
        "summary": "Update Bluesky notification preferences",
        "description": "Merged with the current preferences: send only what changes.",
        "tags": [
          "Bluesky"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "preferences"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "preferences": {
                    "type": "object",
                    "properties": {
                      "follow": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "string",
                            "enum": [
                              "all",
                              "follows"
                            ]
                          },
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "like": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "string",
                            "enum": [
                              "all",
                              "follows"
                            ]
                          },
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "likeViaRepost": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "string",
                            "enum": [
                              "all",
                              "follows"
                            ]
                          },
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "mention": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "string",
                            "enum": [
                              "all",
                              "follows"
                            ]
                          },
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "quote": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "string",
                            "enum": [
                              "all",
                              "follows"
                            ]
                          },
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "reply": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "string",
                            "enum": [
                              "all",
                              "follows"
                            ]
                          },
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "repost": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "string",
                            "enum": [
                              "all",
                              "follows"
                            ]
                          },
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "repostViaRepost": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "string",
                            "enum": [
                              "all",
                              "follows"
                            ]
                          },
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "starterpackJoined": {
                        "type": "object",
                        "properties": {
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "subscribedPost": {
                        "type": "object",
                        "properties": {
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "unverified": {
                        "type": "object",
                        "properties": {
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      },
                      "verified": {
                        "type": "object",
                        "properties": {
                          "list": {
                            "type": "boolean"
                          },
                          "push": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "description": "Only the keys you want to change: merged with the current preferences. Chat preferences are not here (DM settings)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preferences after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "preferences": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_notification_writes_disabled (changing notification settings is temporarily disabled), bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/activity-subscriptions": {
      "get": {
        "operationId": "listBlueskyActivitySubscriptions",
        "summary": "List Bluesky activity subscriptions",
        "description": "Accounts whose posts (and replies) notify the connected account. Cached 30 s per account.",
        "tags": [
          "Bluesky"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Upload-Post profile username with Bluesky connected."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pagination.next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Subscriptions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "subscriptions": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/BlueskyAccount"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "activity_subscription": {
                                "type": "object",
                                "properties": {
                                  "post": {
                                    "type": "boolean"
                                  },
                                  "reply": {
                                    "type": "boolean"
                                  }
                                }
                              }
                            }
                          }
                        ]
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/BlueskyPagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "updateBlueskyActivitySubscription",
        "summary": "Subscribe to (or stop) an account's activity on Bluesky",
        "description": "post and reply both false = stop the notifications from that account.",
        "tags": [
          "Bluesky"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "subject"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string",
                    "description": "Handle or DID."
                  },
                  "post": {
                    "type": "boolean",
                    "default": false
                  },
                  "reply": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "bluesky"
                    },
                    "subject": {
                      "type": "string",
                      "description": "DID."
                    },
                    "activity_subscription": {
                      "type": "object",
                      "properties": {
                        "post": {
                          "type": "boolean"
                        },
                        "reply": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bluesky_invalid_parameter, bluesky_missing_parameter, bluesky_user_required, bluesky_not_connected, bluesky_rejected (Bluesky's message in error).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "401": {
            "description": "bluesky_reauth_required: only when Bluesky refuses the account's app password (revoked or changed); reconnect Bluesky.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_auth_required (pass user), bluesky_blocked (a block between the accounts) or bluesky_private_read_disabled (gateway: private-data method not enabled).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_rate_limited (Bluesky's limit) or bluesky_read_rate_limited (60 Bluesky reads per minute per Upload-Post account; account reads also 60 per 5 minutes and public reads 150 per 5 minutes per account). retry_after + Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "502": {
            "description": "bluesky_unavailable (Bluesky did not answer), bluesky_login_failed (temporary sign-in failure; retry in a few minutes, sign-ins for the account pause 5 minutes) or bluesky_session_unavailable (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_notification_writes_disabled (changing notification settings is temporarily disabled), bluesky_edge_rate_limited (retry_after 300), bluesky_read_capacity (shared ceiling reached) or bluesky_reads_disabled. Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/posts/action": {
      "post": {
        "operationId": "postAction",
        "summary": "Act on a published post (LinkedIn, Bluesky)",
        "description": "LinkedIn: repost, edit. Bluesky: like, unlike, repost, unrepost, bookmark, unbookmark, pin, unpin, reply_settings, quote_settings, detach_quote, reattach_quote. Bluesky like and repost are not generally available yet (`503` `bluesky_feature_disabled`); once on, they count toward the Bluesky daily limit of 200 likes, reposts and follows per account. Bluesky like and repost are off by default: 503 `bluesky_feature_disabled` (the other actions are available).",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "linkedin",
                      "bluesky"
                    ]
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "repost",
                      "edit",
                      "like",
                      "unlike",
                      "unrepost",
                      "bookmark",
                      "unbookmark",
                      "pin",
                      "unpin",
                      "reply_settings",
                      "quote_settings",
                      "detach_quote",
                      "reattach_quote"
                    ]
                  },
                  "post_id": {
                    "type": "string",
                    "description": "LinkedIn post URN; Bluesky at:// URI or bsky.app link. Not needed for Bluesky unpin."
                  },
                  "reply_settings": {
                    "type": "string",
                    "description": "Bluesky reply_settings: everyone, nobody, or comma-separated mention, following, followers, list:<at://uri>."
                  },
                  "quote_settings": {
                    "type": "string",
                    "enum": [
                      "disable_quotes",
                      "everyone"
                    ]
                  },
                  "quote_uri": {
                    "type": "string",
                    "description": "Bluesky detach_quote / reattach_quote: the post that quotes yours."
                  },
                  "commentary": {
                    "type": "string",
                    "description": "LinkedIn repost/edit text."
                  }
                },
                "required": [
                  "user",
                  "platform",
                  "action"
                ]
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/profile/self": {
      "get": {
        "operationId": "getBlueskyOwnProfile",
        "summary": "Read the Bluesky profile",
        "description": "Display name, bio, pronouns, website, avatar and banner URLs, self-labels, pinned post, links and counts.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "updateBlueskyProfile",
        "summary": "Update the Bluesky profile",
        "description": "Merges what you send into the profile. Fields not sent, and empty values, are kept as they are; remove a field with null, remove_<field>: true or clear_fields.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "413": {
            "description": "bluesky_image_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "Up to 64 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 256 characters."
                  },
                  "pronouns": {
                    "type": "string",
                    "description": "Up to 20 characters."
                  },
                  "website": {
                    "type": "string",
                    "description": "http(s) URL."
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "banner": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "avatar_url": {
                    "type": "string",
                    "description": "Public link to a PNG/JPEG."
                  },
                  "banner_url": {
                    "type": "string",
                    "description": "Public link to a PNG/JPEG."
                  },
                  "remove_avatar": {
                    "type": "boolean"
                  },
                  "remove_banner": {
                    "type": "boolean"
                  },
                  "labels": {
                    "type": "array",
                    "description": "!no-unauthenticated, porn, sexual, nudity, graphic-media.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "pinned_post": {
                    "type": "string",
                    "description": "Own post to pin (at:// or bsky.app link); empty string unpins."
                  },
                  "links": {
                    "type": "array",
                    "description": "Up to 10 https links in display order; replaces the current list.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "user"
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "Up to 64 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 256 characters."
                  },
                  "pronouns": {
                    "type": "string",
                    "description": "Up to 20 characters."
                  },
                  "website": {
                    "type": "string",
                    "description": "http(s) URL."
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "banner": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "avatar_url": {
                    "type": "string",
                    "description": "Public link to a PNG/JPEG."
                  },
                  "banner_url": {
                    "type": "string",
                    "description": "Public link to a PNG/JPEG."
                  },
                  "remove_avatar": {
                    "type": "boolean"
                  },
                  "remove_banner": {
                    "type": "boolean"
                  },
                  "labels": {
                    "type": "array",
                    "description": "!no-unauthenticated, porn, sexual, nudity, graphic-media.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "pinned_post": {
                    "type": "string",
                    "description": "Own post to pin (at:// or bsky.app link); empty string unpins."
                  },
                  "links": {
                    "type": "array",
                    "description": "Up to 10 https links in display order; replaces the current list.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/status": {
      "get": {
        "operationId": "getBlueskyStatus",
        "summary": "Read the live status",
        "description": "The account's live status, or null.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "setBlueskyStatus",
        "summary": "Set the live status",
        "description": "Shows the live badge on the account.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "live"
                    ]
                  },
                  "url": {
                    "type": "string",
                    "description": "Your stream URL."
                  },
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "duration_minutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10080
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "clearBlueskyStatus",
        "summary": "Clear the live status",
        "description": "Removes the live badge.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/uploadposts/bluesky/settings": {
      "get": {
        "operationId": "getBlueskySettings",
        "summary": "Read chat and discovery settings",
        "description": "chat_allow_incoming, chat_allow_group_invites, allow_subscriptions, hide_from_algorithmic_recommendations.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "updateBlueskySettings",
        "summary": "Change chat and discovery settings",
        "description": "Send any of the four settings.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "chat_allow_incoming": {
                    "type": "string",
                    "enum": [
                      "all",
                      "following",
                      "none"
                    ]
                  },
                  "chat_allow_group_invites": {
                    "type": "string",
                    "enum": [
                      "all",
                      "following",
                      "none"
                    ]
                  },
                  "allow_subscriptions": {
                    "type": "string",
                    "enum": [
                      "followers",
                      "mutuals",
                      "none"
                    ]
                  },
                  "hide_from_algorithmic_recommendations": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/preferences": {
      "get": {
        "operationId": "getBlueskyPreferences",
        "summary": "Read Bluesky app preferences",
        "description": "The list Bluesky returns (objects with $type), without the account's birth date, which is never returned.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "put": {
        "operationId": "updateBlueskyPreferences",
        "summary": "Replace some Bluesky app preferences",
        "description": "Adds or replaces only the preferences sent (contentLabelPref matched by label+labelerDid, feedViewPref by feed, others by $type); all others are kept. List preferences (muted words, saved feeds, labelers...) replace the whole list and need confirm=true; so do remove and remove_types.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "preferences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "remove_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "remove": {
                    "type": "array",
                    "description": "Objects that identify preferences to delete (e.g. a contentLabelPref by $type, label and labelerDid). Needs confirm=true.",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: this cannot be undone."
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/labels": {
      "get": {
        "operationId": "getBlueskyLabels",
        "summary": "Moderation labels on the account and its posts",
        "description": "Labels on the account and on up to 25 posts (post_ids). Bluesky moderation by default; sources = labeler DIDs.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "post_ids",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated post URIs (≤25)."
          },
          {
            "name": "sources",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated labeler DIDs."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/uploadposts/bluesky/graph": {
      "post": {
        "operationId": "blueskyGraphAction",
        "summary": "Follow, block or mute (one target per call)",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nfollow/unfollow (daily limit), block/unblock, mute/unmute (only_reposts, only_quoteposts), mute_list/unmute_list, block_list/unblock_list (moderation lists), mute_thread/unmute_thread.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "follow",
                      "unfollow",
                      "block",
                      "unblock",
                      "mute",
                      "unmute",
                      "mute_list",
                      "unmute_list",
                      "block_list",
                      "unblock_list",
                      "mute_thread",
                      "unmute_thread"
                    ]
                  },
                  "actor": {
                    "type": "string",
                    "description": "Handle, DID or bsky.app profile link."
                  },
                  "list": {
                    "type": "string",
                    "description": "List at:// URI, bsky.app link or own list id."
                  },
                  "post_id": {
                    "type": "string",
                    "description": "First post of the thread."
                  },
                  "only_reposts": {
                    "type": "boolean"
                  },
                  "only_quoteposts": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user",
                  "action"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/lists": {
      "get": {
        "operationId": "listBlueskyLists",
        "summary": "The account's lists",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\ngetLists for the account.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "purposes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createBlueskyList",
        "summary": "Create a list",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nCurated, moderation or reference list.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "name": {
                    "type": "string",
                    "description": "Up to 64 bytes."
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "curatelist",
                      "modlist",
                      "referencelist"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 300 characters."
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "avatar_url": {
                    "type": "string"
                  },
                  "remove_avatar": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user",
                  "name",
                  "purpose"
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "name": {
                    "type": "string",
                    "description": "Up to 64 bytes."
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "curatelist",
                      "modlist",
                      "referencelist"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 300 characters."
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "avatar_url": {
                    "type": "string"
                  },
                  "remove_avatar": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user",
                  "name",
                  "purpose"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/lists/{list_id}": {
      "get": {
        "operationId": "getBlueskyList",
        "summary": "A list and its members",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\ngetList.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "list_id",
            "in": "path",
            "required": true,
            "description": "The list's record key.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "updateBlueskyList",
        "summary": "Update a list",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nMerges the fields sent.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "name": {
                    "type": "string",
                    "description": "Up to 64 bytes."
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "curatelist",
                      "modlist",
                      "referencelist"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 300 characters."
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "avatar_url": {
                    "type": "string"
                  },
                  "remove_avatar": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user"
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "name": {
                    "type": "string",
                    "description": "Up to 64 bytes."
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "curatelist",
                      "modlist",
                      "referencelist"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 300 characters."
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "avatar_url": {
                    "type": "string"
                  },
                  "remove_avatar": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "list_id",
            "in": "path",
            "required": true,
            "description": "The list's record key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteBlueskyList",
        "summary": "Delete a list and its members",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nNeeds confirm=true.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: this cannot be undone."
                  }
                },
                "required": [
                  "user",
                  "confirm"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "list_id",
            "in": "path",
            "required": true,
            "description": "The list's record key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/lists/{list_id}/members": {
      "get": {
        "operationId": "listBlueskyListMembers",
        "summary": "List members",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\ngetList items.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "list_id",
            "in": "path",
            "required": true,
            "description": "The list's record key.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "addBlueskyListMember",
        "summary": "Add a member",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nOne account per call.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "actor": {
                    "type": "string"
                  }
                },
                "required": [
                  "user",
                  "actor"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "list_id",
            "in": "path",
            "required": true,
            "description": "The list's record key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "removeBlueskyListMember",
        "summary": "Remove a member",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nOne account per call.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "actor": {
                    "type": "string"
                  }
                },
                "required": [
                  "user",
                  "actor"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "list_id",
            "in": "path",
            "required": true,
            "description": "The list's record key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/lists/opt-out": {
      "post": {
        "operationId": "optOutBlueskyList",
        "summary": "Ask not to appear in a reference list",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nreferencelistoptout.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "list": {
                    "type": "string"
                  }
                },
                "required": [
                  "user",
                  "list"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "removeOptOutBlueskyList",
        "summary": "Withdraw the opt-out",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "list": {
                    "type": "string"
                  }
                },
                "required": [
                  "user",
                  "list"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/starter-packs": {
      "get": {
        "operationId": "listBlueskyStarterPacks",
        "summary": "The account's starter packs",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createBlueskyStarterPack",
        "summary": "Create a starter pack",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "name": {
                    "type": "string",
                    "description": "Up to 50 characters."
                  },
                  "description": {
                    "type": "string"
                  },
                  "feeds": {
                    "type": "array",
                    "description": "Up to 3 feed at:// URIs.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "list": {
                    "type": "string",
                    "description": "Own list to use."
                  },
                  "members": {
                    "type": "array",
                    "description": "Up to 25 accounts per request (a new list is created; add more through /lists/{list_id}/members).",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "user",
                  "name"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/starter-packs/{pack_id}": {
      "get": {
        "operationId": "getBlueskyStarterPack",
        "summary": "A starter pack",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "pack_id",
            "in": "path",
            "required": true,
            "description": "The starter pack's record key.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "updateBlueskyStarterPack",
        "summary": "Update a starter pack",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nname, description, feeds.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "name": {
                    "type": "string",
                    "description": "Up to 50 characters."
                  },
                  "description": {
                    "type": "string"
                  },
                  "feeds": {
                    "type": "array",
                    "description": "Up to 3 feed at:// URIs.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "list": {
                    "type": "string",
                    "description": "Own list to use."
                  },
                  "members": {
                    "type": "array",
                    "description": "Up to 25 accounts per request (a new list is created; add more through /lists/{list_id}/members).",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "pack_id",
            "in": "path",
            "required": true,
            "description": "The starter pack's record key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteBlueskyStarterPack",
        "summary": "Delete a starter pack",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nNeeds confirm=true; delete_list=true also deletes its list.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: this cannot be undone."
                  },
                  "delete_list": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user",
                  "confirm"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "pack_id",
            "in": "path",
            "required": true,
            "description": "The starter pack's record key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/feeds": {
      "get": {
        "operationId": "listBlueskyFeeds",
        "summary": "Feeds declared by the account",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createBlueskyFeed",
        "summary": "Declare a custom feed",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nPoints to a feed generator service run by someone else.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "rkey": {
                    "type": "string",
                    "description": "1-15 letters, digits or dashes (create only)."
                  },
                  "did": {
                    "type": "string",
                    "description": "Feed generator service DID."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "Up to 24 characters."
                  },
                  "description": {
                    "type": "string"
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "accepts_interactions": {
                    "type": "boolean"
                  },
                  "content_mode": {
                    "type": "string",
                    "enum": [
                      "unspecified",
                      "video"
                    ]
                  }
                },
                "required": [
                  "user",
                  "rkey",
                  "did",
                  "display_name"
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "rkey": {
                    "type": "string",
                    "description": "1-15 letters, digits or dashes (create only)."
                  },
                  "did": {
                    "type": "string",
                    "description": "Feed generator service DID."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "Up to 24 characters."
                  },
                  "description": {
                    "type": "string"
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "accepts_interactions": {
                    "type": "boolean"
                  },
                  "content_mode": {
                    "type": "string",
                    "enum": [
                      "unspecified",
                      "video"
                    ]
                  }
                },
                "required": [
                  "user",
                  "rkey",
                  "did",
                  "display_name"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/feeds/{rkey}": {
      "patch": {
        "operationId": "updateBlueskyFeed",
        "summary": "Update a feed declaration",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "rkey": {
                    "type": "string",
                    "description": "1-15 letters, digits or dashes (create only)."
                  },
                  "did": {
                    "type": "string",
                    "description": "Feed generator service DID."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "Up to 24 characters."
                  },
                  "description": {
                    "type": "string"
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "accepts_interactions": {
                    "type": "boolean"
                  },
                  "content_mode": {
                    "type": "string",
                    "enum": [
                      "unspecified",
                      "video"
                    ]
                  }
                },
                "required": [
                  "user"
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "rkey": {
                    "type": "string",
                    "description": "1-15 letters, digits or dashes (create only)."
                  },
                  "did": {
                    "type": "string",
                    "description": "Feed generator service DID."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "Up to 24 characters."
                  },
                  "description": {
                    "type": "string"
                  },
                  "avatar": {
                    "type": "string",
                    "description": "PNG or JPEG file, up to 1,000,000 bytes (multipart).",
                    "format": "binary"
                  },
                  "accepts_interactions": {
                    "type": "boolean"
                  },
                  "content_mode": {
                    "type": "string",
                    "enum": [
                      "unspecified",
                      "video"
                    ]
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rkey",
            "in": "path",
            "required": true,
            "description": "The feed's record key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteBlueskyFeed",
        "summary": "Delete a feed declaration",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nNeeds confirm=true.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: this cannot be undone."
                  }
                },
                "required": [
                  "user",
                  "confirm"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rkey",
            "in": "path",
            "required": true,
            "description": "The feed's record key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/report": {
      "post": {
        "operationId": "reportOnBluesky",
        "summary": "Report a post or account to Bluesky moderation",
        "description": "**Not generally available yet: answers `503` `bluesky_feature_disabled` until it is turned on.**\n\nNeeds confirm=true. Up to 20 reports per account per UTC day.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "post_id": {
                    "type": "string"
                  },
                  "actor": {
                    "type": "string"
                  },
                  "reason_type": {
                    "type": "string",
                    "description": "spam, violation, misleading, sexual, rude, other, appeal, or tools.ozone.report.defs#reason... values."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Up to 2,000 characters."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: this cannot be undone."
                  }
                },
                "required": [
                  "user",
                  "reason_type",
                  "confirm"
                ]
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/bluesky/drafts": {
      "get": {
        "operationId": "listBlueskyDrafts",
        "summary": "List drafts",
        "description": "",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createBlueskyDraft",
        "summary": "Create a draft",
        "description": "Text, links and quotes only: Bluesky keeps draft media on the device.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "posts": {
                    "type": "array",
                    "description": "1-100 posts.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string"
                        },
                        "link_url": {
                          "type": "string"
                        },
                        "quote_uri": {
                          "type": "string"
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "text": {
                    "type": "string",
                    "description": "Shortcut for a one-post draft."
                  },
                  "langs": {
                    "type": "string",
                    "description": "Up to 3 codes."
                  },
                  "reply_settings": {
                    "type": "string"
                  },
                  "quote_settings": {
                    "type": "string",
                    "enum": [
                      "disable_quotes",
                      "everyone"
                    ]
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/uploadposts/bluesky/drafts/{draft_id}": {
      "patch": {
        "operationId": "updateBlueskyDraft",
        "summary": "Replace a draft",
        "description": "",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "posts": {
                    "type": "array",
                    "description": "1-100 posts.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string"
                        },
                        "link_url": {
                          "type": "string"
                        },
                        "quote_uri": {
                          "type": "string"
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "text": {
                    "type": "string",
                    "description": "Shortcut for a one-post draft."
                  },
                  "langs": {
                    "type": "string",
                    "description": "Up to 3 codes."
                  },
                  "reply_settings": {
                    "type": "string"
                  },
                  "quote_settings": {
                    "type": "string",
                    "enum": [
                      "disable_quotes",
                      "everyone"
                    ]
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "description": "The draft id.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "delete": {
        "operationId": "deleteBlueskyDraft",
        "summary": "Delete a draft",
        "description": "Needs confirm=true. A draft_id that does not exist (or was already deleted) answers 404 bluesky_not_found.",
        "tags": [
          "Bluesky"
        ],
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (error_code says which), confirmation_required, or bluesky_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key, or bluesky_reauth_required (reconnect the Bluesky account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "403": {
            "description": "bluesky_not_owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "404": {
            "description": "bluesky_not_found / bluesky_post_not_found / bluesky_actor_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "409": {
            "description": "bluesky_record_changed: the record changed in the Bluesky app meanwhile; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "429": {
            "description": "bluesky_daily_interaction_limit / bluesky_daily_report_limit (with limit, retry_after, resets_at), bluesky_rate_limited or bluesky_read_rate_limited (too many Bluesky requests for this account right now). Retry-After header set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "503": {
            "description": "bluesky_edge_rate_limited (retry in a few minutes), bluesky_feature_disabled, bluesky_read_capacity (busy, retry after retry_after) or bluesky_login_unavailable (temporary sign-in failure: retry, no reconnect needed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueskyActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: this cannot be undone."
                  }
                },
                "required": [
                  "user",
                  "confirm"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "description": "The draft id.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/uploadposts/dms/bluesky/status": {
      "get": {
        "operationId": "getBlueskyChatStatus",
        "summary": "Bluesky chat status",
        "description": "chat_disabled, can_create_groups and group_member_limit of the connected Bluesky account.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          }
        ]
      }
    },
    "/uploadposts/dms/bluesky/preferences": {
      "get": {
        "operationId": "getBlueskyChatPreferences",
        "summary": "Bluesky chat notification settings",
        "description": "Notification settings for chats and message requests.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          }
        ]
      },
      "post": {
        "operationId": "setBlueskyChatPreferences",
        "summary": "Change Bluesky chat notification settings",
        "description": "Fields left out keep their current value.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "chat": {
                    "type": "object",
                    "properties": {
                      "include": {
                        "type": "string",
                        "enum": [
                          "all",
                          "follows"
                        ]
                      },
                      "push": {
                        "type": "boolean"
                      }
                    }
                  },
                  "chat_request": {
                    "type": "object",
                    "properties": {
                      "include": {
                        "type": "string",
                        "enum": [
                          "all",
                          "follows"
                        ]
                      },
                      "push": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/dms/bluesky/export": {
      "get": {
        "operationId": "exportBlueskyChat",
        "summary": "Export Bluesky chat history",
        "description": "Every conversation and message of the account as JSON Lines (application/jsonl), streamed as a file. Account owner only (403 bluesky_owner_only with X-Act-As-User); one export at a time per account (409), 10 minutes between two (429), cut after 4 minutes: a cut file ends with the line {\"truncated\": true, \"reason\": \"deadline\" | \"upstream_error\"}.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          }
        ]
      }
    },
    "/uploadposts/dms/bluesky/account/delete": {
      "post": {
        "operationId": "deleteBlueskyChatAccount",
        "summary": "Delete the Bluesky chat account",
        "description": "**Not generally available yet: answers `403` `bluesky_chat_delete_disabled`.**\n\nDeletes every conversation and message of the account's Bluesky chat account (not the Bluesky account). Needs confirm: true and confirm_handle; not enabled yet (403 bluesky_chat_delete_disabled). Account owner only; every attempt is recorded.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm",
                  "confirm_handle"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "confirm": {
                    "type": "boolean"
                  },
                  "confirm_handle": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/dms/bluesky/groups": {
      "post": {
        "operationId": "createBlueskyGroup",
        "summary": "Create a Bluesky group chat",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nMembers get a request to accept. Every invited member counts as one DM (all or nothing); at most 10 members by handle per request. Idempotent for 10 minutes per idempotency_key (or name + members). Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "name",
                  "members"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "members": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "string"
                    }
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "get": {
        "operationId": "listBlueskyMutualGroups",
        "summary": "Bluesky groups shared with someone",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nExperimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          },
          {
            "name": "subject",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/dms/bluesky/groups/{conversation_id}": {
      "patch": {
        "operationId": "editBlueskyGroup",
        "summary": "Rename, lock or unlock a Bluesky group",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nOwner only. Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "name": {
                    "type": "string"
                  },
                  "locked": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/dms/bluesky/groups/{conversation_id}/members": {
      "get": {
        "operationId": "listBlueskyGroupMembers",
        "summary": "Bluesky group members",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nExperimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "addBlueskyGroupMembers",
        "summary": "Add members to a Bluesky group",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nOwner only. One DM of quota per added member. Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "members"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "members": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "removeBlueskyGroupMembers",
        "summary": "Remove members from a Bluesky group",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nOwner only. Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "members"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "members": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/dms/bluesky/groups/{conversation_id}/join-link": {
      "post": {
        "operationId": "manageBlueskyJoinLink",
        "summary": "Manage a Bluesky group join link",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\naction: create, edit, enable or disable. Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "action"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "create",
                      "edit",
                      "enable",
                      "disable"
                    ]
                  },
                  "require_approval": {
                    "type": "boolean"
                  },
                  "join_rule": {
                    "type": "string",
                    "enum": [
                      "anyone",
                      "followed_by_owner"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/dms/bluesky/groups/{conversation_id}/join-requests": {
      "get": {
        "operationId": "listBlueskyJoinRequests",
        "summary": "Pending requests to join a Bluesky group",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nOwner only. Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "answerBlueskyJoinRequest",
        "summary": "Answer or withdraw a Bluesky join request",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\naction: approve / reject (with member), mark_read, or withdraw (your own request). Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "action"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "reject",
                      "mark_read",
                      "withdraw"
                    ]
                  },
                  "member": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/dms/bluesky/join-links": {
      "get": {
        "operationId": "previewBlueskyJoinLinks",
        "summary": "Preview Bluesky join links",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nUp to 50 codes; status active, disabled or invalid. Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username as configured in Upload-Post."
          },
          {
            "name": "codes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated join link codes."
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "joinBlueskyGroup",
        "summary": "Ask to join a Bluesky group",
        "description": "**Not generally available yet: group chats answer `403` `bluesky_dm_experimental_disabled` until they are turned on.**\n\nstatus is joined or pending. Experimental on Bluesky: answers carry experimental: true; 403 bluesky_dm_experimental_disabled while not enabled.",
        "tags": [
          "Instagram Interactions"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Missing or invalid API key, or Bluesky needs reconnecting (bluesky_reauth_required)."
          },
          "403": {
            "description": "bluesky_dm_scope_missing or the feature is not enabled."
          },
          "429": {
            "description": "Rate limited."
          },
          "502": {
            "description": "Bluesky did not answer."
          },
          "503": {
            "description": "bluesky_edge_rate_limited."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "code"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/comments": {
      "get": {
        "operationId": "listYoutubeCommentThreads",
        "summary": "List YouTube comment threads",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncommentThreads.list of one video (video_id), of the whole channel (scope=channel) or by id (ids). Filter held-for-review or likely-spam comments of your channel. 1 quota unit per page; a page is reused for up to a minute.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "video_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "channel"
              ]
            }
          },
          {
            "name": "ids",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Up to 50 thread IDs, comma separated."
          },
          {
            "name": "moderation_status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "published",
                "heldForReview",
                "likelySpam"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "time",
                "relevance"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only threads containing this text (max 200 characters)."
          },
          {
            "name": "text_format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "plainText"
              ]
            }
          },
          {
            "name": "include_replies",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "next_page_token of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createYoutubeComment",
        "summary": "Reply to or post a YouTube comment",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nReply to a top-level comment (parent_id) or post a new top-level comment on a video (video_id). 50 quota units.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "youtube_duplicate_request: a request with this idempotency_key was already sent and its result is not confirmed yet.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "text"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "parent_id": {
                    "type": "string"
                  },
                  "video_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 10000
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Optional. The same key for the same channel within 24 hours posts once: the repeat gets the first answer with idempotent_replay: true, or 409 youtube_duplicate_request while the first result is not confirmed."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/comments/replies": {
      "get": {
        "operationId": "listYoutubeCommentReplies",
        "summary": "List YouTube comment replies",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncomments.list: replies of a top-level comment (parent_id) or comments by id (ids, up to 50). 1 quota unit.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "parent_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "text_format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "plainText"
              ]
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "next_page_token of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/comments/moderate": {
      "post": {
        "operationId": "moderateYoutubeComments",
        "summary": "Moderate YouTube comments",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncomments.setModerationStatus for up to 50 comments of your channel in one call (50 quota units). status=rejected (and ban_author) need confirm=true; a rejected comment can never be published again and its replies are hidden too.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "comment_ids",
                  "status"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "comment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 50
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "published",
                      "heldForReview",
                      "rejected"
                    ]
                  },
                  "ban_author": {
                    "type": "boolean"
                  },
                  "confirm": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/comments/{comment_id}": {
      "patch": {
        "operationId": "editYoutubeComment",
        "summary": "Edit your YouTube comment",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncomments.update of the text of a comment written by the connected channel. 50 quota units.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "comment_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "text"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 10000
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteYoutubeComment",
        "summary": "Delete your YouTube comment",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncomments.delete (only the author can delete; to remove someone else's comment, moderate it with status=rejected). Needs confirm=true. 50 quota units.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "comment_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/categories": {
      "get": {
        "operationId": "listYoutubeCategories",
        "summary": "List YouTube video categories",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nvideoCategories.list of a region (cached for several days).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Two-letter region from /youtube/regions. Default US."
          },
          {
            "name": "hl",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assignable_only",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/languages": {
      "get": {
        "operationId": "listYoutubeLanguages",
        "summary": "List YouTube languages",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ni18nLanguages.list (cached for several days).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "hl",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/regions": {
      "get": {
        "operationId": "listYoutubeRegions",
        "summary": "List YouTube regions",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ni18nRegions.list (cached for several days).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "hl",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/abuse-reasons": {
      "get": {
        "operationId": "listYoutubeAbuseReasons",
        "summary": "List YouTube abuse report reasons",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nvideoAbuseReportReasons.list (cached for several days).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "hl",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/search": {
      "get": {
        "operationId": "searchYoutube",
        "summary": "Search YouTube",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nsearch.list, one page per request. Searches have a much smaller daily allowance than other features (see /youtube/quota, bucket search); an identical search within an hour answers from cache and does not use one. forDeveloper and content-owner parameters are not available.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Search text (max 500 characters)."
          },
          {
            "name": "for_mine",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "channel_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "channel, playlist, video (comma separated)."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "date",
                "rating",
                "relevance",
                "title",
                "videoCount",
                "viewCount"
              ]
            }
          },
          {
            "name": "published_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "RFC 3339."
          },
          {
            "name": "published_before",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "RFC 3339."
          },
          {
            "name": "region_code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "relevance_language",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "safe_search",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "moderate",
                "none",
                "strict"
              ]
            }
          },
          {
            "name": "channel_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "show"
              ]
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "completed",
                "live",
                "upcoming"
              ]
            }
          },
          {
            "name": "location",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "latitude,longitude"
          },
          {
            "name": "location_radius",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "e.g. 10km (max 1000 km)."
          },
          {
            "name": "topic_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "video_category_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "video_caption",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "closedCaption",
                "none"
              ]
            }
          },
          {
            "name": "video_definition",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "high",
                "standard"
              ]
            }
          },
          {
            "name": "video_dimension",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "2d",
                "3d",
                "any"
              ]
            }
          },
          {
            "name": "video_duration",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "long",
                "medium",
                "short"
              ]
            }
          },
          {
            "name": "video_embeddable",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "true"
              ]
            }
          },
          {
            "name": "video_license",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "creativeCommon",
                "youtube"
              ]
            }
          },
          {
            "name": "video_paid_product_placement",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "true"
              ]
            }
          },
          {
            "name": "video_syndicated",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "true"
              ]
            }
          },
          {
            "name": "video_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "episode",
                "movie"
              ]
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 50
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "next_page_token of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/subscriptions": {
      "get": {
        "operationId": "listYoutubeSubscriptions",
        "summary": "List YouTube subscriptions or subscribers",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nsubscriptions.list: exactly one of filter (mine, my_subscribers, my_recent_subscribers), channel_id or ids. 1 quota unit.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "mine",
                "my_subscribers",
                "my_recent_subscribers"
              ]
            }
          },
          {
            "name": "channel_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "for_channel_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Up to 50 channel IDs."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "alphabetical",
                "relevance",
                "unread"
              ]
            }
          },
          {
            "name": "parts",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "snippet, contentDetails, subscriberSnippet."
          },
          {
            "name": "max_results",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 50
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "next_page_token of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "subscribeYoutube",
        "summary": "Subscribe to a YouTube channel",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nsubscriptions.insert on behalf of the connected channel. 50 quota units; limited per channel and day.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "channel_id"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "channel_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/subscriptions/{subscription_id}": {
      "delete": {
        "operationId": "unsubscribeYoutube",
        "summary": "Unsubscribe from a YouTube channel",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nsubscriptions.delete. 50 quota units; limited per channel and day.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/videos/rating": {
      "get": {
        "operationId": "getYoutubeRatings",
        "summary": "Get the channel's rating of videos",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nvideos.getRating for up to 50 video IDs. 1 quota unit.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "ids",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/videos/{video_id}/rate": {
      "post": {
        "operationId": "rateYoutubeVideo",
        "summary": "Like, dislike or clear the rating of a YouTube video",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nvideos.rate on behalf of the connected channel. 50 quota units; limited per channel and day.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "video_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "rating"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "rating": {
                    "type": "string",
                    "enum": [
                      "like",
                      "dislike",
                      "none"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/videos/{video_id}/report-abuse": {
      "post": {
        "operationId": "reportYoutubeVideo",
        "summary": "Report a YouTube video",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nvideos.reportAbuse on behalf of the connected channel. reason_id from /youtube/abuse-reasons; needs confirm=true (cannot be withdrawn). 50 quota units; limited per channel and day.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "video_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "reason_id",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "reason_id": {
                    "type": "string"
                  },
                  "secondary_reason_id": {
                    "type": "string"
                  },
                  "comments": {
                    "type": "string",
                    "maxLength": 3000
                  },
                  "language": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/activities": {
      "get": {
        "operationId": "listYoutubeActivities",
        "summary": "List YouTube channel activity",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nactivities.list of the connected channel (or channel_id). 1 quota unit.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "channel_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "published_after",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "published_before",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region_code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parts",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "snippet, contentDetails."
          },
          {
            "name": "max_results",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 50
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "next_page_token of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "page_info": {
                      "type": "object"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or YouTube rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Reconnect the YouTube channel (youtube_reauth_required).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (youtube_forbidden, youtube_insufficient_scope, youtube_comments_disabled...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found on YouTube.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Daily allowance, channel action limit or YouTube quota used up (retry_after, resets_at).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "YouTube did not answer (youtube_unreachable) or did not confirm a write (youtube_write_outcome_unknown: check before retrying).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "youtube_feature_disabled or youtube_token_refresh_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "youtube_status": {
                      "type": "integer"
                    },
                    "youtube_reason": {
                      "type": "string"
                    },
                    "retry_after": {
                      "type": "integer"
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/analytics/query": {
      "get": {
        "operationId": "queryYoutubeAnalytics",
        "summary": "Run a YouTube Analytics channel report",
        "description": "Not generally available yet: answers 503 youtube_analytics_disabled until it is enabled. reports.query for the profile's channel with any dimensions, metrics, filters and sort of YouTube's channel reports. Validated against the official report tables before it reaches YouTube (invalid combinations: 400 youtube_analytics_unsupported_query with hints, nothing spent). Revenue and ad metrics are not available. Answers are cached (12 h; 7 days for ranges that ended more than 5 days ago). Each uncached call counts 1 request of the account's daily Analytics allowance. Data has a 48-72 h delay.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "YYYY-MM-DD"
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "YYYY-MM-DD"
          },
          {
            "name": "metrics",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Comma-separated metrics."
          },
          {
            "name": "dimensions",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated dimensions."
          },
          {
            "name": "filters",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "dimension==value joined with ';' (video/playlist accept up to 500 comma-separated IDs)."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated; '-' for descending."
          },
          {
            "name": "max_results",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "start_index",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "report",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Optional report ID from GET /uploadposts/youtube/analytics/reports."
          }
        ],
        "responses": {
          "200": {
            "description": "report, report_name, query, column_headers, rows, cached, cached_at, expires_at, data_note",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "report": {
                      "type": "string"
                    },
                    "report_name": {
                      "type": "string"
                    },
                    "query": {
                      "type": "object"
                    },
                    "column_headers": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {}
                      }
                    },
                    "cached": {
                      "type": "boolean"
                    },
                    "cached_at": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "data_note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          },
          "409": {
            "description": "youtube_analytics_query_in_progress"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/analytics/reports": {
      "get": {
        "operationId": "listYoutubeAnalyticsReports",
        "summary": "YouTube Analytics report catalog",
        "description": "Not generally available yet: answers 503 youtube_analytics_disabled until it is enabled. The 47 YouTube channel reports with their dimensions, metrics, filters, sort options and row limits. Does not call YouTube.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "reports"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/analytics/groups": {
      "get": {
        "operationId": "listYoutubeAnalyticsGroups",
        "summary": "List YouTube Analytics groups",
        "description": "Not generally available yet: answers 503 youtube_analytics_disabled until it is enabled. groups.list of the channel (mine=true, or ids). Cached 30 minutes; 1 request of the Analytics allowance per uncached call.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Up to 50 group IDs, comma separated."
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "items, next_page_token"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/analytics/groups/{group_id}/items": {
      "get": {
        "operationId": "listYoutubeAnalyticsGroupItems",
        "summary": "List the items of a YouTube Analytics group",
        "description": "Not generally available yet: answers 503 youtube_analytics_disabled until it is enabled. groupItems.list. Cached 30 minutes.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "description": "Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "items"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/analytics/usage": {
      "get": {
        "operationId": "getYoutubeAnalyticsUsage",
        "summary": "Daily allowance of YouTube Analytics and bulk reports",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nThe caller's own usage today of the Analytics and bulk reports allowances. While Analytics and bulk reports are not generally available yet, each service shows enabled: false.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "services.analytics, services.reporting, plan, resets_at"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/reporting/report-types": {
      "get": {
        "operationId": "listYoutubeReportTypes",
        "summary": "List YouTube bulk report types",
        "description": "Not generally available yet: answers 503 youtube_reporting_disabled until it is enabled. reportTypes.list for the channel (one page, cached 24 h). can_create_job marks the channel/playlist types that can be scheduled.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "items, next_page_token"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/reporting/jobs": {
      "get": {
        "operationId": "listYoutubeReportingJobs",
        "summary": "List YouTube reporting jobs",
        "description": "Not generally available yet: answers 503 youtube_reporting_disabled until it is enabled. jobs.list of the channel (one page). used_by_upload_post marks the job behind Upload-Post's thumbnail impressions.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "items, next_page_token, max_jobs_per_channel"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          }
        },
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createYoutubeReportingJob",
        "summary": "Create a YouTube reporting job",
        "description": "Not generally available yet: answers 503 youtube_reporting_disabled until it is enabled. jobs.create: YouTube then generates one CSV per day (first ones within ~48 h, covering the previous 30 days). One job per report type and up to 20 per channel.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "job, note"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          },
          "409": {
            "description": "youtube_reporting_job_exists or youtube_reporting_job_limit"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "report_type_id"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "report_type_id": {
                    "type": "string",
                    "example": "channel_reach_combined_a1"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/reporting/jobs/{job_id}": {
      "get": {
        "operationId": "getYoutubeReportingJob",
        "summary": "Get a YouTube reporting job",
        "description": "Not generally available yet: answers 503 youtube_reporting_disabled until it is enabled. jobs.get.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Job ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "job"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          },
          "404": {
            "description": "Not found"
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteYoutubeReportingJob",
        "summary": "Delete a YouTube reporting job",
        "description": "Not generally available yet: answers 503 youtube_reporting_disabled until it is enabled. jobs.delete: stops the daily reports. Requires confirm: true. A channel_reach_basic_a1 job (used by Upload-Post for thumbnail impressions) cannot be deleted (409 youtube_reporting_job_in_use). 502 youtube_write_outcome_unknown: list the jobs to check.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Job ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "deleted"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          },
          "409": {
            "description": "youtube_reporting_job_in_use"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/reporting/jobs/{job_id}/reports": {
      "get": {
        "operationId": "listYoutubeReports",
        "summary": "List the reports of a YouTube reporting job",
        "description": "Not generally available yet: answers 503 youtube_reporting_disabled until it is enabled. jobs.reports.list (one page). Each item has download_path.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Job ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "RFC 3339"
          },
          {
            "name": "start_time_at_or_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "RFC 3339"
          },
          {
            "name": "start_time_before",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "RFC 3339"
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "items, next_page_token"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/reporting/jobs/{job_id}/reports/{report_id}": {
      "get": {
        "operationId": "getYoutubeReport",
        "summary": "Get a YouTube report",
        "description": "Not generally available yet: answers 503 youtube_reporting_disabled until it is enabled. jobs.reports.get (metadata).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Job ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "description": "Report ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "report"
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/reporting/jobs/{job_id}/reports/{report_id}/download": {
      "get": {
        "operationId": "downloadYoutubeReport",
        "summary": "Download a YouTube report (CSV)",
        "description": "Not generally available yet: answers 503 youtube_reporting_disabled until it is enabled. The report's CSV file, streamed. Up to 100 MB; up to 2 downloads at a time per account. Counts 2 requests of the bulk reports allowance.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Job ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "description": "Report ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (stable error_code)."
          },
          "401": {
            "description": "youtube_reauth_required"
          },
          "403": {
            "description": "youtube_insufficient_scope or youtube_forbidden"
          },
          "429": {
            "description": "Daily allowance or YouTube quota used up (retry_after, resets_at, Retry-After)."
          },
          "502": {
            "description": "YouTube did not answer."
          },
          "503": {
            "description": "Feature not enabled right now."
          },
          "413": {
            "description": "youtube_reporting_report_too_large"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/channel": {
      "get": {
        "operationId": "getYoutubeChannel",
        "summary": "Get the connected YouTube channel",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nchannels.list of the profile's channel with snippet, brandingSettings, status, statistics, localizations, topicDetails and contentDetails. 1 YouTube unit, cached 5 minutes.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username with a YouTube channel connected."
          }
        ],
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "updateYoutubeChannel",
        "summary": "Update YouTube channel settings",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nChanges only the fields sent (the rest is read and resent). Empty string = no change, null = clear. Settings and localizations go in separate calls. 51 YouTube units. Text fields must be strings (400 invalid_field). Translation codes accept - or _ and match the channel's real codes (fr matches fr_FR); the answer lists localizations_removed. Untouched settings missing from YouTube's answer, or a default language YouTube kept, come back in warnings. A concurrent change of the same channel answers 409 youtube_channel_busy.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 1000 characters, no < or >."
                  },
                  "keywords": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Up to 500 characters in total."
                  },
                  "country": {
                    "type": "string",
                    "description": "ISO 3166-1 alpha-2."
                  },
                  "default_language": {
                    "type": "string",
                    "description": "BCP-47."
                  },
                  "unsubscribed_trailer": {
                    "type": "string",
                    "description": "Video ID of the channel."
                  },
                  "tracking_analytics_account_id": {
                    "type": "string",
                    "description": "Google Analytics ID."
                  },
                  "localizations": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "nullable": true,
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "localizations_remove": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/channel/lookup": {
      "get": {
        "operationId": "lookupYoutubeChannels",
        "summary": "Look up YouTube channels",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nPublic data of channels by ids (up to 50), for_handle or for_username (exactly one). 1 YouTube unit, cached 1 hour.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username with a YouTube channel connected."
          },
          {
            "name": "ids",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "for_handle",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "for_username",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/channel/banner": {
      "post": {
        "operationId": "setYoutubeChannelBanner",
        "summary": "Upload the YouTube channel banner",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nPNG/JPEG, up to 6 MB, 16:9, at least 2048x1152, as file `image` or `image_url`; or `banner_url` to apply a banner already uploaded. 101 YouTube units. If YouTube does not answer the second step: 502 youtube_write_outcome_unknown with banner_url (check before re-applying).",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "image_url": {
                    "type": "string",
                    "description": "Public image URL."
                  },
                  "banner_url": {
                    "type": "string",
                    "description": "url returned by a previous upload (retry)."
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "image_url": {
                    "type": "string",
                    "description": "Public image URL."
                  },
                  "banner_url": {
                    "type": "string",
                    "description": "url returned by a previous upload (retry)."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/channel/sections": {
      "get": {
        "operationId": "listYoutubeChannelSections",
        "summary": "List YouTube channel sections",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nchannelSections.list (up to 10). 1 YouTube unit.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username with a YouTube channel connected."
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createYoutubeChannelSection",
        "summary": "Create a YouTube channel section",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nchannelSections.insert. 50 YouTube units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "type"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "allPlaylists",
                      "completedEvents",
                      "liveEvents",
                      "multipleChannels",
                      "multiplePlaylists",
                      "popularUploads",
                      "recentUploads",
                      "singlePlaylist",
                      "subscriptions",
                      "upcomingEvents"
                    ]
                  },
                  "title": {
                    "type": "string",
                    "description": "Required for multiplePlaylists and multipleChannels; up to 100 characters."
                  },
                  "playlists": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/channel/sections/{section_id}": {
      "patch": {
        "operationId": "updateYoutubeChannelSection",
        "summary": "Edit or move a YouTube channel section",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nOnly what is sent changes. 51 YouTube units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "section_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "allPlaylists",
                      "completedEvents",
                      "liveEvents",
                      "multipleChannels",
                      "multiplePlaylists",
                      "popularUploads",
                      "recentUploads",
                      "singlePlaylist",
                      "subscriptions",
                      "upcomingEvents"
                    ]
                  },
                  "title": {
                    "type": "string",
                    "description": "Required for multiplePlaylists and multipleChannels; up to 100 characters."
                  },
                  "playlists": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteYoutubeChannelSection",
        "summary": "Delete a YouTube channel section",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nNeeds confirm=true. 51 YouTube units (a 1-unit read first: a section of another channel is 404 without the delete).",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "section_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "confirm": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/channel/watermark": {
      "post": {
        "operationId": "setYoutubeChannelWatermark",
        "summary": "Set the YouTube channel watermark",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nPNG/JPEG up to 10 MB. Needs confirm=true (it replaces the current watermark). 50 YouTube units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "image_url": {
                    "type": "string",
                    "description": ""
                  },
                  "timing_type": {
                    "type": "string",
                    "enum": [
                      "offsetFromStart",
                      "offsetFromEnd"
                    ]
                  },
                  "offset_ms": {
                    "type": "integer"
                  },
                  "duration_ms": {
                    "type": "integer"
                  },
                  "target_channel_id": {
                    "type": "string",
                    "description": ""
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: the new watermark replaces the current one."
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "image_url": {
                    "type": "string",
                    "description": ""
                  },
                  "timing_type": {
                    "type": "string",
                    "enum": [
                      "offsetFromStart",
                      "offsetFromEnd"
                    ]
                  },
                  "offset_ms": {
                    "type": "integer"
                  },
                  "duration_ms": {
                    "type": "integer"
                  },
                  "target_channel_id": {
                    "type": "string",
                    "description": ""
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: the new watermark replaces the current one."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "unsetYoutubeChannelWatermark",
        "summary": "Remove the YouTube channel watermark",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nNeeds confirm=true. 50 YouTube units.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "confirm"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": ""
                  },
                  "confirm": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/push": {
      "get": {
        "operationId": "getYoutubePush",
        "summary": "YouTube new video notifications status",
        "description": "Not generally available yet: answers 503 youtube_feature_disabled until it is enabled. State of the push subscription of the profile's channel (null when off). No YouTube quota.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username with a YouTube channel connected."
          }
        ],
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "enableYoutubePush",
        "summary": "Turn on YouTube new video notifications",
        "description": "Not generally available yet: answers 503 youtube_feature_disabled until it is enabled. Requires a webhook listing youtube_video_published and/or youtube_video_updated. No YouTube quota.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "202": {
            "description": "Requested; Google confirms within minutes."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "disableYoutubePush",
        "summary": "Turn off YouTube new video notifications",
        "description": "Not generally available yet: answers 503 youtube_feature_disabled until it is enabled. No YouTube quota.",
        "tags": [
          "Platform Integration"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (refused before calling YouTube)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily YouTube allowance used up (see retry_after)."
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  }
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/playlists": {
      "get": {
        "operationId": "listYoutubePlaylists",
        "summary": "List YouTube playlists",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylists.list, one page per call: the connected channel's own playlists, or `ids`, or another channel's public playlists. 1 YouTube quota unit of the daily allowance for YouTube management features.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Up to 50 playlist IDs, comma separated.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel_id",
            "in": "query",
            "description": "Public playlists of this channel (UC...). Not with ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parts",
            "in": "query",
            "description": "Subset of snippet, status, contentDetails, localizations, player.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hl",
            "in": "query",
            "description": "Language for snippet.localized.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "description": "1-50. Not with ids.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "next_page_token of the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Playlists: success, items, next_page_token, page_info (and not_found with ids).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "createYoutubePlaylist",
        "summary": "Create a YouTube playlist",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylists.insert (50 units). podcast_status can only be set when editing.",
        "tags": [
          "Platform Integration"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "title": {
                    "type": "string",
                    "description": "Up to 150 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 5,000 characters."
                  },
                  "privacy_status": {
                    "type": "string",
                    "description": "Playlist privacy.",
                    "enum": [
                      "public",
                      "unlisted",
                      "private"
                    ]
                  },
                  "default_language": {
                    "type": "string",
                    "description": "BCP-47 language of the title and description."
                  },
                  "localizations": {
                    "type": "object",
                    "description": "Translations: {\"es\": {\"title\": \"...\", \"description\": \"...\"}}. Requires default_language.",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "user",
                  "title"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "success and the created playlist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/playlists/{playlist_id}": {
      "patch": {
        "operationId": "updateYoutubePlaylist",
        "summary": "Edit a YouTube playlist",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nRead + playlists.update (51 units). Only the fields sent change; translations are merged. An empty string means no change; description: null clears the description (title cannot be null). Language codes match the playlist's real translations (fr matches fr_FR): an ambiguous code is 400 youtube_localization_ambiguous, a removal that matches nothing is 404 youtube_localization_not_found.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "title": {
                    "type": "string",
                    "description": "Up to 150 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 5,000 characters."
                  },
                  "privacy_status": {
                    "type": "string",
                    "description": "Playlist privacy.",
                    "enum": [
                      "public",
                      "unlisted",
                      "private"
                    ]
                  },
                  "default_language": {
                    "type": "string",
                    "description": "BCP-47 language of the title and description."
                  },
                  "localizations": {
                    "type": "object",
                    "description": "Translations: {\"es\": {\"title\": \"...\", \"description\": \"...\"}}. Requires default_language.",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "podcast_status": {
                    "type": "string",
                    "description": "enabled needs a playlist image.",
                    "enum": [
                      "enabled",
                      "disabled"
                    ]
                  },
                  "localizations_remove": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Languages to remove."
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success and the updated playlist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteYoutubePlaylist",
        "summary": "Delete a YouTube playlist",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylists.delete (51 units). Irreversible: confirm=true. The videos are kept.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Must be true: the action cannot be undone.",
            "schema": {
              "type": "boolean"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "success, deleted, playlist_id.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/playlists/{playlist_id}/items": {
      "get": {
        "operationId": "listYoutubePlaylistItems",
        "summary": "List the videos of a YouTube playlist",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylistItems.list, one page per call (1 unit).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "video_id",
            "in": "query",
            "description": "Only items of this video.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parts",
            "in": "query",
            "description": "Subset of snippet, contentDetails, status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_results",
            "in": "query",
            "description": "1-50.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "next_page_token of the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "success, items, next_page_token, page_info.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "addYoutubePlaylistItem",
        "summary": "Add a video to a YouTube playlist",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylistItems.insert (52 units). position only on manually sorted playlists.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "video_id": {
                    "type": "string",
                    "description": "Video already on YouTube."
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Zero-based place (0 = first)."
                  },
                  "note": {
                    "type": "string",
                    "description": "Up to 280 characters."
                  }
                },
                "required": [
                  "user",
                  "video_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "success and the playlist item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/playlists/{playlist_id}/items/{item_id}": {
      "patch": {
        "operationId": "updateYoutubePlaylistItem",
        "summary": "Reorder a video or change its note",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylistItems.update (52 units). Send position and/or note; the other is kept.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "description": "Playlist item ID (the `id` of an item from the items list).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "New zero-based place."
                  },
                  "note": {
                    "type": "string",
                    "description": "Up to 280 characters; empty clears it."
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success and the playlist item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "removeYoutubePlaylistItem",
        "summary": "Remove a video from a YouTube playlist",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylistItems.delete (52 units). The video itself is kept. confirm=true.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "description": "Playlist item ID (the `id` of an item from the items list).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Must be true: the action cannot be undone.",
            "schema": {
              "type": "boolean"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "success, deleted, item_id, playlist_id.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/playlists/{playlist_id}/image": {
      "get": {
        "operationId": "getYoutubePlaylistImage",
        "summary": "Get the YouTube playlist image",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylistImages.list (1 unit).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "success, image (or null), items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "addYoutubePlaylistImage",
        "summary": "Add the YouTube playlist image",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylistImages.insert (51 units). JPEG/PNG, square, up to 50 MB.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "description": "JPEG or PNG, square (1:1), up to 50 MB."
                  },
                  "image_url": {
                    "type": "string",
                    "description": "Public URL of the image instead of a file."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "success and the image.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "put": {
        "operationId": "replaceYoutubePlaylistImage",
        "summary": "Replace the YouTube playlist image",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylistImages.update (52 units).",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "description": "JPEG or PNG, square (1:1), up to 50 MB."
                  },
                  "image_url": {
                    "type": "string",
                    "description": "Public URL of the image instead of a file."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true: the current image is overwritten."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success and the image.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteYoutubePlaylistImage",
        "summary": "Delete the YouTube playlist image",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\nplaylistImages.delete (52 units). confirm=true.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "description": "YouTube playlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Must be true: the action cannot be undone.",
            "schema": {
              "type": "boolean"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "success, deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/captions": {
      "get": {
        "operationId": "listYoutubeCaptions",
        "summary": "List the caption tracks of a YouTube video",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncaptions.list (50 units, +1 the first time for a video). Video of the connected channel.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "video_id",
            "in": "query",
            "description": "Video of the connected channel.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Only these caption IDs, comma separated.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "success, video_id, items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "uploadYoutubeCaption",
        "summary": "Add a caption track to a published YouTube video",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncaptions.insert (400 units). Validated before spending: format, UTF-8, time codes, language, name, allowance, owner.",
        "tags": [
          "Platform Integration"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "video_id",
                  "language"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "video_id": {
                    "type": "string",
                    "description": "Video of the connected channel."
                  },
                  "language": {
                    "type": "string",
                    "description": "BCP-47 language."
                  },
                  "name": {
                    "type": "string",
                    "description": "Up to 150 characters. Not sent: the language code; empty: the default track."
                  },
                  "is_draft": {
                    "type": "boolean"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Caption file, up to 10 MB (srt, sbv, sub, mpsub, lrc, smi, sami, rt, vtt, ttml, dfxp, scc, asc, cap, stl, tds, cin). Text files: UTF-8 with time codes."
                  },
                  "file_url": {
                    "type": "string",
                    "description": "Public URL of the caption file instead of a file."
                  },
                  "format": {
                    "type": "string",
                    "description": "File format when the name has no extension, e.g. srt."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "success and the caption resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "youtube_caption_exists or youtube_caption_upload_in_progress."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/captions/{caption_id}": {
      "put": {
        "operationId": "updateYoutubeCaption",
        "summary": "Replace a caption track or publish a draft",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncaptions.update (450 units). New file and/or is_draft. For a track not seen through Upload-Post, send video_id too.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "caption_id",
            "in": "path",
            "required": true,
            "description": "Caption track ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username."
                  },
                  "is_draft": {
                    "type": "boolean"
                  },
                  "video_id": {
                    "type": "string",
                    "description": "Video of the track, if not seen before."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Caption file, up to 10 MB (srt, sbv, sub, mpsub, lrc, smi, sami, rt, vtt, ttml, dfxp, scc, asc, cap, stl, tds, cin). Text files: UTF-8 with time codes."
                  },
                  "file_url": {
                    "type": "string",
                    "description": "Public URL of the caption file instead of a file."
                  },
                  "format": {
                    "type": "string",
                    "description": "File format when the name has no extension, e.g. srt."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be true when a new file (file or file_url) is sent: the current captions are overwritten. Not needed to publish a draft with is_draft alone."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success and the caption resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteYoutubeCaption",
        "summary": "Delete a caption track",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncaptions.delete (50 units). confirm=true.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "caption_id",
            "in": "path",
            "required": true,
            "description": "Caption track ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Must be true: the action cannot be undone.",
            "schema": {
              "type": "boolean"
            },
            "required": true
          },
          {
            "name": "video_id",
            "in": "query",
            "description": "Video of the track, if not seen before.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "success, deleted, caption_id, video_id.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/youtube/captions/{caption_id}/download": {
      "get": {
        "operationId": "downloadYoutubeCaption",
        "summary": "Download a caption track",
        "description": "**Not generally available yet.** Off by default: answers `503` with `youtube_feature_disabled` until the feature is available.\n\ncaptions.download (200 units; the same download within 10 minutes is free). Own videos only.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "caption_id",
            "in": "path",
            "required": true,
            "description": "Caption track ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with a YouTube channel connected.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "tfmt",
            "in": "query",
            "description": "Convert to this format.",
            "schema": {
              "type": "string",
              "enum": [
                "srt",
                "vtt",
                "sbv",
                "scc",
                "ttml"
              ]
            }
          },
          {
            "name": "tlang",
            "in": "query",
            "description": "Machine translation into this ISO 639-1 language.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "video_id",
            "in": "query",
            "description": "Video of the track, if not seen before.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The caption file.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not generally available yet. error_code: `youtube_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "youtube_feature_disabled",
                  "message": "Not generally available yet."
                }
              }
            }
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/webhooks/subscriptions": {
      "post": {
        "operationId": "createWebhookSubscription",
        "summary": "Create a webhook subscription",
        "tags": [
          "Webhooks"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While webhook subscriptions are switched off for your account every route of this group answers `503` with `reason: webhook_subscriptions_disabled`.\n\nAdds a destination that receives the listed events, besides the account webhook. Idempotent: the same url + events + profile_username returns the existing subscription (200, `created: false`) and reactivates it if it was disabled (`reactivated: true`); `name` and `source` are updated when sent. At most 10 active subscriptions per account. Team members (X-Act-As-User) cannot create them.\n\nDeliveries carry the same body as the account webhook for that event and the same signature headers (`X-Upload-Post-Signature: sha256=HMAC(webhook_secret, \"{timestamp}.{raw_body}\")`, `X-Upload-Post-Timestamp`, `X-Upload-Post-Event`, `X-Upload-Post-Delivery`, `X-Upload-Post-Attempt`) plus `X-Upload-Post-Subscription: <id>`. The secret is the account webhook secret (`GET /uploadposts/users/notifications` → `notifications.webhook_secret`; created on the first subscription if missing). The first delivery can take up to about a minute; failed deliveries follow the retry schedule and appear in `GET /uploadposts/webhooks/deliveries?subscription_id=`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048,
                    "description": "Public https URL."
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "$ref": "#/components/schemas/WebhookEventName"
                    },
                    "description": "Event names. youtube_video_* only while YouTube push is on and post_approval_* only while post approvals are on; otherwise 400 invalid_events with allowed_events."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Only events of this profile."
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 40,
                    "example": "n8n"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              },
              "example": {
                "url": "https://example.app.n8n.cloud/webhook/0b1f",
                "events": [
                  "upload_completed"
                ],
                "source": "n8n",
                "name": "My workflow"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "created": {
                      "type": "boolean",
                      "example": true
                    },
                    "reactivated": {
                      "type": "boolean",
                      "example": false
                    },
                    "subscription": {
                      "$ref": "#/components/schemas/WebhookSubscription"
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "It already existed (created: false); reactivated: true if it was disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "created": {
                      "type": "boolean",
                      "example": false
                    },
                    "reactivated": {
                      "type": "boolean"
                    },
                    "subscription": {
                      "$ref": "#/components/schemas/WebhookSubscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request. reason: `invalid_body`, `invalid_url`, `invalid_events`, `invalid_profile_username`, `invalid_source`, `invalid_name`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "invalid_body",
                  "message": "Invalid request."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Team members cannot change where the owner's notifications go. reason: `team_member_forbidden`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "team_member_forbidden",
                  "message": "Team members cannot change where the owner's notifications go."
                }
              }
            }
          },
          "404": {
            "description": "Account or profile not found. reason: `account_not_found`, `profile_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "account_not_found",
                  "message": "Account or profile not found."
                }
              }
            }
          },
          "409": {
            "description": "Too many active subscriptions (limit in `limit`). reason: `subscription_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "subscription_limit_reached",
                  "message": "Too many active subscriptions (limit in `limit`)."
                }
              }
            }
          },
          "503": {
            "description": "Webhook subscriptions are switched off. reason: `webhook_subscriptions_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "webhook_subscriptions_disabled",
                  "message": "Webhook subscriptions are switched off."
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listWebhookSubscriptions",
        "summary": "List webhook subscriptions",
        "tags": [
          "Webhooks"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While webhook subscriptions are switched off for your account every route of this group answers `503` with `reason: webhook_subscriptions_disabled`.\n\nNewest first, active and disabled. An n8n trigger checks whether its subscription exists with `?url=<its url>&status=active`.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "disabled"
              ]
            },
            "description": "Only active or disabled ones."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this source label (e.g. n8n)."
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this exact URL."
          }
        ],
        "responses": {
          "200": {
            "description": "Subscriptions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "subscriptions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookSubscription"
                      }
                    },
                    "limit": {
                      "type": "integer",
                      "example": 10,
                      "description": "Maximum active subscriptions per account."
                    },
                    "active_count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid status. reason: `invalid_status`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "invalid_status",
                  "message": "Invalid status."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "503": {
            "description": "Webhook subscriptions are switched off. reason: `webhook_subscriptions_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "webhook_subscriptions_disabled",
                  "message": "Webhook subscriptions are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/webhooks/subscriptions/{subscription_id}": {
      "get": {
        "operationId": "getWebhookSubscription",
        "summary": "Get a webhook subscription",
        "tags": [
          "Webhooks"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While webhook subscriptions are switched off for your account every route of this group answers `503` with `reason: webhook_subscriptions_disabled`.",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subscription id (whsub_...)."
          }
        ],
        "responses": {
          "200": {
            "description": "The subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "subscription": {
                      "$ref": "#/components/schemas/WebhookSubscription"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found. reason: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "503": {
            "description": "Webhook subscriptions are switched off. reason: `webhook_subscriptions_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "webhook_subscriptions_disabled",
                  "message": "Webhook subscriptions are switched off."
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhookSubscription",
        "summary": "Delete a webhook subscription",
        "tags": [
          "Webhooks"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While webhook subscriptions are switched off for your account every route of this group answers `503` with `reason: webhook_subscriptions_disabled`.\n\nStops sending to it right away. A second DELETE answers 404 (an integration can treat 404 as already deleted).",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subscription id (whsub_...)."
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "deleted": {
                      "type": "boolean",
                      "example": true
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found. reason: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "503": {
            "description": "Webhook subscriptions are switched off. reason: `webhook_subscriptions_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "webhook_subscriptions_disabled",
                  "message": "Webhook subscriptions are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/webhooks/subscriptions/{subscription_id}/test": {
      "post": {
        "operationId": "testWebhookSubscription",
        "summary": "Send a test event to a subscription",
        "tags": [
          "Webhooks"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While webhook subscriptions are switched off for your account every route of this group answers `503` with `reason: webhook_subscriptions_disabled`.\n\nSends one signed sample now, with the keys of the real event and `test: true`. Logged as a test delivery: never retried and never counted towards disabling the subscription. `ok` tells whether the destination answered 2xx. For the post approval events the sample has the shape of the real event ({event, user_email, profile_username, approval: {...}, created_at}).",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subscription id (whsub_...)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "description": "One of the subscription's events; default its first event."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "delivery": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/WebhookDelivery"
                        }
                      ],
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "event is not one of the subscription's events (allowed_events). reason: `invalid_event`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "invalid_event",
                  "message": "event is not one of the subscription's events (allowed_events)."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found. reason: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "409": {
            "description": "The subscription is disabled, or its URL is not an allowed destination. reason: `subscription_disabled`, `blocked_url`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "subscription_disabled",
                  "message": "The subscription is disabled, or its URL is not an allowed destination."
                }
              }
            }
          },
          "503": {
            "description": "Webhook subscriptions are switched off. reason: `webhook_subscriptions_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionError"
                },
                "example": {
                  "success": false,
                  "reason": "webhook_subscriptions_disabled",
                  "message": "Webhook subscriptions are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/approvals": {
      "get": {
        "operationId": "listPostApprovals",
        "summary": "List posts awaiting approval",
        "tags": [
          "Teams and Approvals"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nOpen items by default (pending_approval and draft). Editors and Contributors only see their own; members limited to some profiles only see those. Page with `before` = the previous `next_before`.",
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the account owner, when a team member acts on the owner's account."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated statuses (default the open ones)."
          },
          {
            "name": "profile_username",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this profile."
          },
          {
            "name": "author",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this author email."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Page size."
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "created_at of the last item of the previous page (next_before)."
          },
          {
            "name": "count_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "true (or 1): answer only how many items there are per status, with the same filters (status, profile_username, author; limit and before are ignored). Nothing is listed or signed."
          }
        ],
        "responses": {
          "200": {
            "description": "Items, newest first; or, with count_only, the counts.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "title": "list",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "example": true
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PostApproval"
                          }
                        },
                        "next_before": {
                          "type": "string",
                          "nullable": true
                        }
                      }
                    },
                    {
                      "type": "object",
                      "title": "count_only",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "example": true
                        },
                        "counts": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "integer"
                          },
                          "description": "One key per requested status (default pending_approval and draft).",
                          "example": {
                            "pending_approval": 3,
                            "draft": 1
                          }
                        },
                        "total": {
                          "type": "integer",
                          "example": 4
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter. error_code: `invalid_status`, `invalid_limit`, `invalid_before`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "invalid_status",
                  "message": "Invalid filter."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed for this member. error_code: `team_role_forbidden`, `team_profile_forbidden`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamAccessError"
                },
                "example": {
                  "success": false,
                  "error_code": "team_role_forbidden",
                  "message": "Not allowed for this member."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/approvals/{approval_id}": {
      "get": {
        "operationId": "getPostApproval",
        "summary": "Get a post awaiting approval",
        "tags": [
          "Teams and Approvals"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nThe author or a reviewer (owner or Admin). Adds fields, preview_url, thumbnail_url and destinations_effective.",
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the account owner, when a team member acts on the owner's account."
          },
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Approval id."
          }
        ],
        "responses": {
          "200": {
            "description": "The item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "item": {
                      "$ref": "#/components/schemas/PostApproval"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed for this member. error_code: `team_role_forbidden`, `team_profile_forbidden`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamAccessError"
                },
                "example": {
                  "success": false,
                  "error_code": "team_role_forbidden",
                  "message": "Not allowed for this member."
                }
              }
            }
          },
          "404": {
            "description": "Not found. error_code: `approval_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "editPostApproval",
        "summary": "Edit a post awaiting approval",
        "tags": [
          "Teams and Approvals"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nThe author or a reviewer, while it is open. Same body and validations as `PATCH /uploadposts/schedule/{job_id}`. Every edit raises `version` by one.",
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the account owner, when a team member acts on the owner's account."
          },
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Approval id."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "caption": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string",
                    "description": "Alias of caption."
                  },
                  "platform_content": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object"
                    }
                  },
                  "fields": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "cover_image_base64": {
                    "type": "string"
                  },
                  "remove_cover": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "item": {
                      "$ref": "#/components/schemas/PostApproval"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or field (same codes as editing a scheduled post). error_code: `invalid_body`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "invalid_body",
                  "message": "Invalid body or field (same codes as editing a scheduled post)."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed for this member. error_code: `team_role_forbidden`, `team_profile_forbidden`, `team_page_forbidden`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamAccessError"
                },
                "example": {
                  "success": false,
                  "error_code": "team_role_forbidden",
                  "message": "Not allowed for this member."
                }
              }
            }
          },
          "404": {
            "description": "Not found. error_code: `approval_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "409": {
            "description": "Already decided, or changed meanwhile. error_code: `approval_closed`, `approval_state_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_closed",
                  "message": "Already decided, or changed meanwhile."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "withdrawPostApproval",
        "summary": "Withdraw or discard a post awaiting approval",
        "tags": [
          "Teams and Approvals"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nThe author withdraws it or a reviewer discards it: status withdrawn; its media is deleted.",
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the account owner, when a team member acts on the owner's account."
          },
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Approval id."
          }
        ],
        "responses": {
          "200": {
            "description": "Withdrawn.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "item": {
                      "$ref": "#/components/schemas/PostApproval"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found. error_code: `approval_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "409": {
            "description": "Already closed. error_code: `approval_closed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_closed",
                  "message": "Already closed."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/approvals/{approval_id}/approve": {
      "post": {
        "operationId": "approvePostApproval",
        "summary": "Approve a post",
        "tags": [
          "Teams and Approvals"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nReviewer only (owner or Admin). `version` is required: the `item.version` you reviewed. Date used: the one in the body; else now (immediate posts or `publish_now`); else the next free queue slot (posts sent with add_to_queue); else the post's own date if it is more than 60 s away. Monthly credits are reserved now; if creating the job fails the item reopens and the credits come back (500 approval_failed).",
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the account owner, when a team member acts on the owner's account."
          },
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Approval id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer"
                  },
                  "comment": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "publish_now": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "version"
                ]
              },
              "example": {
                "version": 1,
                "comment": "Looks good"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Approved: the scheduled job was created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "item": {
                      "$ref": "#/components/schemas/PostApproval"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "scheduled_date": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body. error_code: `invalid_body`, `version_required`, `invalid_comment`, `invalid_scheduled_date`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "invalid_body",
                  "message": "Invalid body."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "Renewal payment failed: same body as an upload in that state."
          },
          "403": {
            "description": "Only the owner and Admin members approve. error_code: `team_role_forbidden`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamAccessError"
                },
                "example": {
                  "success": false,
                  "error_code": "team_role_forbidden",
                  "message": "Only the owner and Admin members approve."
                }
              }
            }
          },
          "404": {
            "description": "Not found. error_code: `approval_not_found`, `owner_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "409": {
            "description": "Already closed; reviewed version is outdated (current_version and item included); an Editor's post whose date already passed (it becomes expired); a draft proposing a past date; changed meanwhile; or no free queue slot. error_code: `approval_closed`, `approval_version_changed`, `approval_expired`, `scheduled_date_in_past`, `approval_state_changed`, `NO_QUEUE_SLOTS`, `QUEUE_BUSY`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_closed",
                  "message": "Already closed; reviewed version is outdated (current_version and item included); an Editor's post whose date already passed (it becomes expired); a draft proposing a past date; changed meanwhile; or no free queue slot."
                }
              }
            }
          },
          "429": {
            "description": "Monthly upload limit (same body as an upload) or error_code SCHEDULED_POSTS_LIMIT."
          },
          "500": {
            "description": "The job could not be created; the item is open again. error_code: `approval_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_failed",
                  "message": "The job could not be created; the item is open again."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/approvals/{approval_id}/reject": {
      "post": {
        "operationId": "rejectPostApproval",
        "summary": "Reject a post",
        "tags": [
          "Teams and Approvals"
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nReviewer only. `comment` is required (max 2000 characters) and is shown to the author.",
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the account owner, when a team member acts on the owner's account."
          },
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Approval id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "comment"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "item": {
                      "$ref": "#/components/schemas/PostApproval"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid comment. error_code: `comment_required`, `invalid_comment`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "comment_required",
                  "message": "Missing or invalid comment."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the owner and Admin members reject. error_code: `team_role_forbidden`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamAccessError"
                },
                "example": {
                  "success": false,
                  "error_code": "team_role_forbidden",
                  "message": "Only the owner and Admin members reject."
                }
              }
            }
          },
          "404": {
            "description": "Not found. error_code: `approval_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "409": {
            "description": "Already closed. error_code: `approval_closed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_closed",
                  "message": "Already closed."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/approvals/client": {
      "get": {
        "operationId": "listClientPostApprovals",
        "summary": "End client: list posts to approve",
        "tags": [
          "Teams and Approvals"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nCalled with the **profile JWT** of the white-label connect page (`Authorization: Bearer <access_url token>`), generated with `client_approval: true` (`POST /uploadposts/users/generate-jwt`). Only the `pending_approval` posts of that profile; the end client cannot change the date. The account owner turns it off by generating the JWT again with `client_approval: false`. Items come without author or internal ids.",
        "responses": {
          "200": {
            "description": "Items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ClientPostApproval"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid profile JWT. error_code: `unauthorized`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "unauthorized",
                  "message": "Missing or invalid profile JWT."
                }
              }
            }
          },
          "403": {
            "description": "The token or the profile does not allow client approval, or the account is unavailable. error_code: `client_approval_not_allowed`, `account_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "client_approval_not_allowed",
                  "message": "The token or the profile does not allow client approval, or the account is unavailable."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/approvals/client/{approval_id}/approve": {
      "post": {
        "operationId": "approveClientPostApproval",
        "summary": "End client: approve a post",
        "tags": [
          "Teams and Approvals"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nCalled with the **profile JWT** of the white-label connect page (`Authorization: Bearer <access_url token>`), generated with `client_approval: true` (`POST /uploadposts/users/generate-jwt`). Only the `pending_approval` posts of that profile; the end client cannot change the date. The account owner turns it off by generating the JWT again with `client_approval: false`. `version` is required, as for reviewers. Recorded as decided_by `client:<profile>`, decided_by_role `client`.",
        "parameters": [
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Approval id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer"
                  },
                  "comment": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "version"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Approved: the scheduled job was created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "item": {
                      "$ref": "#/components/schemas/ClientPostApproval"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "scheduled_date": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body. error_code: `version_required`, `invalid_comment`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "version_required",
                  "message": "Invalid body."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid profile JWT. error_code: `unauthorized`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "unauthorized",
                  "message": "Missing or invalid profile JWT."
                }
              }
            }
          },
          "403": {
            "description": "The token or the profile does not allow client approval, or the account is unavailable. error_code: `client_approval_not_allowed`, `account_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "client_approval_not_allowed",
                  "message": "The token or the profile does not allow client approval, or the account is unavailable."
                }
              }
            }
          },
          "404": {
            "description": "Not found. error_code: `approval_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "409": {
            "description": "Already closed; reviewed version is outdated (current_version and item included); an Editor's post whose date already passed (it becomes expired); a draft proposing a past date; changed meanwhile; or no free queue slot. error_code: `approval_closed`, `approval_version_changed`, `approval_expired`, `scheduled_date_in_past`, `approval_state_changed`, `NO_QUEUE_SLOTS`, `QUEUE_BUSY`. With approval_version_changed the body also carries current_version and the current item (ClientPostApproval).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_closed",
                  "message": "Already closed; reviewed version is outdated (current_version and item included); an Editor's post whose date already passed (it becomes expired); a draft proposing a past date; changed meanwhile; or no free queue slot."
                }
              }
            }
          },
          "429": {
            "description": "Monthly upload limit or SCHEDULED_POSTS_LIMIT."
          },
          "500": {
            "description": "The job could not be created. error_code: `approval_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_failed",
                  "message": "The job could not be created."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/approvals/client/{approval_id}/reject": {
      "post": {
        "operationId": "rejectClientPostApproval",
        "summary": "End client: reject a post",
        "tags": [
          "Teams and Approvals"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-availability": "not_generally_available",
        "description": "**Not generally available yet.** While post approvals are switched off every route of this group answers `503` with `error_code: post_approvals_disabled`.\n\nCalled with the **profile JWT** of the white-label connect page (`Authorization: Bearer <access_url token>`), generated with `client_approval: true` (`POST /uploadposts/users/generate-jwt`). Only the `pending_approval` posts of that profile; the end client cannot change the date. The account owner turns it off by generating the JWT again with `client_approval: false`. `comment` is required.",
        "parameters": [
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Approval id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "comment"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "item": {
                      "$ref": "#/components/schemas/ClientPostApproval"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid comment. error_code: `comment_required`, `invalid_comment`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "comment_required",
                  "message": "Missing or invalid comment."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid profile JWT. error_code: `unauthorized`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "unauthorized",
                  "message": "Missing or invalid profile JWT."
                }
              }
            }
          },
          "403": {
            "description": "The token or the profile does not allow client approval, or the account is unavailable. error_code: `client_approval_not_allowed`, `account_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "client_approval_not_allowed",
                  "message": "The token or the profile does not allow client approval, or the account is unavailable."
                }
              }
            }
          },
          "404": {
            "description": "Not found. error_code: `approval_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_not_found",
                  "message": "Not found."
                }
              }
            }
          },
          "409": {
            "description": "Already closed. error_code: `approval_closed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "approval_closed",
                  "message": "Already closed."
                }
              }
            }
          },
          "503": {
            "description": "Post approvals are switched off. error_code: `post_approvals_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "post_approvals_disabled",
                  "message": "Post approvals are switched off."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/teams/roles": {
      "get": {
        "operationId": "getTeamRoles",
        "summary": "Team roles and your role",
        "tags": [
          "Teams and Approvals"
        ],
        "description": "The role matrix and the caller's role. `enabled: false` while team roles are not available: then every member is treated as Admin with every profile. Roles and profile lists are changed by the account owner from the dashboard.",
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the account owner, when a team member acts on the owner's account."
          }
        ],
        "responses": {
          "200": {
            "description": "Roles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "approvals_enabled": {
                      "type": "boolean"
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "owner",
                          "admin",
                          "editor",
                          "contributor",
                          "viewer"
                        ]
                      }
                    },
                    "permissions": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "account",
                            "read",
                            "compose",
                            "approvals_own",
                            "approvals_review",
                            "audit",
                            "manage"
                          ]
                        }
                      }
                    },
                    "approval_roles": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "editor",
                        "contributor"
                      ]
                    },
                    "your_email": {
                      "type": "string"
                    },
                    "your_role": {
                      "type": "string",
                      "enum": [
                        "owner",
                        "admin",
                        "editor",
                        "contributor",
                        "viewer"
                      ]
                    },
                    "your_profiles": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "nullable": true,
                      "description": "null = every profile."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/teams/members": {
      "get": {
        "operationId": "listTeamMembers",
        "summary": "List team members",
        "tags": [
          "Teams and Approvals"
        ],
        "description": "The account owner's team. Not available to members (X-Act-As-User answers 403). With team roles on, each member adds `role` and `profiles` (null = every profile).",
        "responses": {
          "200": {
            "description": "Members.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "team_members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "example": "active"
                          },
                          "invited_at": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "admin",
                              "editor",
                              "contributor",
                              "viewer"
                            ]
                          },
                          "profiles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "nullable": true
                          },
                          "suspended": {
                            "type": "boolean",
                            "description": "No seat on the owner's current plan."
                          },
                          "suspended_reason": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "plan": {
                      "type": "string"
                    },
                    "seat_limit": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/teams/shared-with-me": {
      "get": {
        "operationId": "listSharedAccounts",
        "summary": "Accounts shared with me",
        "tags": [
          "Teams and Approvals"
        ],
        "description": "Accounts whose team you belong to; use the owner_email as X-Act-As-User. With team roles on, each one adds your `role` and `profiles` there.",
        "responses": {
          "200": {
            "description": "Accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "owner_email": {
                            "type": "string"
                          },
                          "owner_name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "suspended": {
                            "type": "boolean"
                          },
                          "suspended_reason": {
                            "type": "string",
                            "nullable": true
                          },
                          "role": {
                            "type": "string"
                          },
                          "profiles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/teams/audit": {
      "get": {
        "operationId": "listTeamAudit",
        "summary": "Team activity log",
        "tags": [
          "Teams and Approvals"
        ],
        "description": "What team members did on the account (posts created, published, edited or cancelled, approvals and decisions, access changes), newest first. Owner and Admin members only. Rows are kept `retention_days` days.",
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the account owner, when a team member acts on the owner's account."
          },
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this member email."
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "post_created",
                "published",
                "scheduled_edited",
                "scheduled_cancelled",
                "approval_requested",
                "draft_created",
                "approval_edited",
                "approved",
                "rejected",
                "approval_withdrawn",
                "approval_expired",
                "member_access_changed"
              ]
            },
            "description": "Only this action."
          },
          {
            "name": "profile_username",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this profile."
          },
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this approval or job id."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO 8601, inclusive."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO 8601, exclusive."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "next_cursor of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Rows.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "action": {
                            "type": "string",
                            "enum": [
                              "post_created",
                              "published",
                              "scheduled_edited",
                              "scheduled_cancelled",
                              "approval_requested",
                              "draft_created",
                              "approval_edited",
                              "approved",
                              "rejected",
                              "approval_withdrawn",
                              "approval_expired",
                              "member_access_changed"
                            ]
                          },
                          "actor_email": {
                            "type": "string"
                          },
                          "actor_role": {
                            "type": "string"
                          },
                          "target_type": {
                            "type": "string"
                          },
                          "target_id": {
                            "type": "string"
                          },
                          "profile_username": {
                            "type": "string",
                            "nullable": true
                          },
                          "details": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    },
                    "retention_days": {
                      "type": "integer",
                      "example": 400
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter. error_code: `invalid_limit`, `invalid_cursor`, `invalid_date`, `invalid_actor`, `invalid_action`, `invalid_profile_username`, `invalid_target_id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                },
                "example": {
                  "success": false,
                  "error_code": "invalid_limit",
                  "message": "Invalid filter."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the owner and Admin members. error_code: `team_role_forbidden`, `team_profile_forbidden`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamAccessError"
                },
                "example": {
                  "success": false,
                  "error_code": "team_role_forbidden",
                  "message": "Only the owner and Admin members."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/autodms/start": {
      "post": {
        "operationId": "startAutoDMMonitor",
        "summary": "Start a comment monitor on one post",
        "tags": [
          "Instagram Interactions"
        ],
        "description": "Watches the comments of ONE post and answers each matching comment: a private DM on Instagram (Private Replies), a public reply on TikTok, YouTube, Facebook, Threads and Bluesky. For the whole Instagram account use the account-wide rules (`/uploadposts/autodms/rules`).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "instagram",
                      "tiktok",
                      "youtube",
                      "facebook",
                      "threads",
                      "bluesky"
                    ],
                    "default": "instagram"
                  },
                  "post_url": {
                    "type": "string",
                    "description": "Post URL. Required on Instagram; TikTok and YouTube URLs are accepted too."
                  },
                  "post_id": {
                    "type": "string",
                    "description": "Other platforms (or post_url): TikTok/YouTube video id, Facebook {pageId}_{postId}, Threads post id, Bluesky at:// URI."
                  },
                  "reply_message": {
                    "type": "string"
                  },
                  "reply_messages": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "string"
                    },
                    "description": "Public replies only: alternative texts, rotated."
                  },
                  "profile_username": {
                    "type": "string"
                  },
                  "buttons": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string",
                          "maxLength": 20
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    },
                    "description": "Instagram only."
                  },
                  "monitoring_interval": {
                    "type": "integer",
                    "minimum": 15,
                    "default": 15,
                    "description": "Minutes between comment checks (platforms without webhooks)."
                  },
                  "trigger_keywords": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Case- and accent-insensitive; omitted = answer every comment."
                  }
                },
                "required": [
                  "reply_message",
                  "profile_username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Monitor started.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "monitor_id": {
                      "type": "string"
                    },
                    "config": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, no account connected, an active monitor already exists for this post, or the comments cannot be read (reconnect). error_code: `tiktok_reconnect_required`, `threads_read_replies_required`, `invalid_post_url`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "tiktok_reconnect_required",
                  "message": "Missing fields, no account connected, an active monitor already exists for this post, or the comments cannot be read (reconnect)."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Daily limit of new monitors per profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/autodms/status": {
      "get": {
        "operationId": "getAutoDMMonitors",
        "summary": "List comment monitors",
        "tags": [
          "Instagram Interactions"
        ],
        "parameters": [
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Include stopped and expired monitors."
          }
        ],
        "responses": {
          "200": {
            "description": "Monitors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "monitors": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AutoDMMonitor"
                      }
                    },
                    "total_active": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/autodms/logs": {
      "get": {
        "operationId": "getAutoDMMonitorLogs",
        "summary": "Logs of a comment monitor",
        "tags": [
          "Instagram Interactions"
        ],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Monitor id."
          }
        ],
        "responses": {
          "200": {
            "description": "Log lines.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "logs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "monitor_info": {
                      "type": "object",
                      "properties": {
                        "post_url": {
                          "type": "string"
                        },
                        "profile_username": {
                          "type": "string"
                        },
                        "is_active": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Monitor not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/autodms/pause": {
      "post": {
        "operationId": "pauseAutoDMMonitor",
        "summary": "Pause a comment monitor",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "monitor_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "monitor_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Monitor paused successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "monitor_id missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Monitor not found or not owned by this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/autodms/resume": {
      "post": {
        "operationId": "resumeAutoDMMonitor",
        "summary": "Resume a comment monitor",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "monitor_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "monitor_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Monitor resumed successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "monitor_id missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Monitor not found or not owned by this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/autodms/stop": {
      "post": {
        "operationId": "stopAutoDMMonitor",
        "summary": "Stop a comment monitor",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "monitor_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "monitor_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Monitor stopped successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "monitor_id missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Monitor not found or not owned by this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/autodms/delete": {
      "post": {
        "operationId": "deleteAutoDMMonitor",
        "summary": "Delete a comment monitor",
        "tags": [
          "Instagram Interactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "monitor_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "monitor_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Monitor deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "monitor_id missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Monitor not found or not owned by this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/posts/edit": {
      "post": {
        "operationId": "editPost",
        "summary": "Edit a published post",
        "tags": [
          "Upload Management"
        ],
        "description": "Edits a post already published on Facebook, LinkedIn, X, YouTube, Google Business, Telegram and the credential channels that support it (Discord, Mastodon, Hashnode, Whop...). Each platform reads its own fields; Instagram and TikTok cannot edit posts. `PATCH` is accepted as an alias. Telegram media replacement is sent as multipart.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "user",
                  "post_id"
                ],
                "additionalProperties": true,
                "properties": {
                  "platform": {
                    "type": "string",
                    "example": "facebook"
                  },
                  "user": {
                    "type": "string"
                  },
                  "post_id": {
                    "type": "string",
                    "description": "Platform post id (YouTube: video_id is accepted; Telegram: message id)."
                  },
                  "message": {
                    "type": "string",
                    "description": "Facebook text."
                  },
                  "text": {
                    "type": "string",
                    "description": "X / Telegram text."
                  },
                  "commentary": {
                    "type": "string",
                    "description": "LinkedIn text."
                  },
                  "caption": {
                    "type": "string",
                    "description": "Telegram caption."
                  },
                  "is_pinned": {
                    "type": "boolean"
                  },
                  "scheduled_publish_time": {
                    "type": "string",
                    "description": "Facebook, Unix seconds."
                  },
                  "facebook_page_id": {
                    "type": "string"
                  },
                  "linkedin_visibility": {
                    "type": "string"
                  },
                  "linkedin_disable_reshare": {
                    "type": "boolean"
                  },
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "privacyStatus": {
                    "type": "string"
                  },
                  "categoryId": {
                    "type": "string"
                  },
                  "publishAt": {
                    "type": "string"
                  },
                  "hasPaidProductPlacement": {
                    "type": "boolean",
                    "description": "YouTube (alias paid_partnership)."
                  },
                  "defaultLanguage": {
                    "type": "string"
                  },
                  "license": {
                    "type": "string",
                    "enum": [
                      "youtube",
                      "creativeCommon"
                    ]
                  },
                  "embeddable": {
                    "type": "boolean"
                  },
                  "publicStatsViewable": {
                    "type": "boolean"
                  },
                  "selfDeclaredMadeForKids": {
                    "type": "boolean"
                  },
                  "containsSyntheticMedia": {
                    "type": "boolean"
                  },
                  "recordingDate": {
                    "type": "string"
                  },
                  "localizations": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "localizations_remove": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "brand_partner": {
                    "type": "string",
                    "description": "YouTube channel id UC… (24 characters)."
                  },
                  "summary": {
                    "type": "string",
                    "description": "Google Business."
                  },
                  "cta_type": {
                    "type": "string"
                  },
                  "cta_url": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "pin",
                      "unpin",
                      "stop_poll",
                      "edit_live_location",
                      "stop_live_location"
                    ],
                    "description": "Telegram."
                  },
                  "telegram_media": {
                    "type": "string",
                    "description": "Telegram: public URL or file_id (multipart for a file)."
                  },
                  "telegram_media_type": {
                    "type": "string",
                    "enum": [
                      "photo",
                      "video",
                      "animation",
                      "audio",
                      "document",
                      "live_photo"
                    ]
                  },
                  "telegram_remove_caption": {
                    "type": "boolean"
                  },
                  "telegram_parse_mode": {
                    "type": "string"
                  },
                  "telegram_reply_markup": {
                    "type": "object"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "platform": {
                    "type": "string"
                  },
                  "user": {
                    "type": "string"
                  },
                  "post_id": {
                    "type": "string"
                  },
                  "telegram_media": {
                    "type": "string",
                    "format": "binary"
                  },
                  "telegram_thumbnail": {
                    "type": "string",
                    "format": "binary"
                  },
                  "telegram_cover": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Edited. Keys vary by platform (updated, updated_fields, url, previous_post_id, warnings...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string"
                    },
                    "post_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, nothing to update, unsupported platform or invalid value. error_code: `invalid_json`, `commercial_disclosure_invalid_value`, `x_links_not_allowed`, `invalid_field`, `youtube_default_language_required`, `telegram_invalid_parameter`, `youtube_invalid_publish_at`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "invalid_json",
                  "message": "Missing fields, nothing to update, unsupported platform or invalid value."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The connected account cannot edit this post. error_code: `telegram_forbidden`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "telegram_forbidden",
                  "message": "The connected account cannot edit this post."
                }
              }
            }
          },
          "404": {
            "description": "Post not found. error_code: `telegram_message_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "telegram_message_not_found",
                  "message": "Post not found."
                }
              }
            }
          },
          "429": {
            "description": "Daily write limit or YouTube budget reached (retry_after). error_code: `x_daily_write_limit`, `telegram_rate_limited`, `youtube_daily_budget_exhausted`, `youtube_shared_budget_exhausted`, `youtube_quota_exhausted`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "x_daily_write_limit",
                  "message": "Daily write limit or YouTube budget reached (retry_after)."
                }
              }
            }
          },
          "502": {
            "description": "The platform failed. error_code: `telegram_api_error`, `telegram_reconnect_required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "telegram_api_error",
                  "message": "The platform failed."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/posts/repost": {
      "post": {
        "operationId": "repostPost",
        "summary": "Repost, forward or copy a published post",
        "tags": [
          "Upload Management"
        ],
        "description": "LinkedIn reshare (optionally with commentary or as a Page), X repost, Threads repost, Bluesky repost (not generally available yet: 503 bluesky_feature_disabled) and Telegram forward/copy to another chat.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "linkedin",
                      "x",
                      "threads",
                      "telegram",
                      "bluesky"
                    ]
                  },
                  "user": {
                    "type": "string"
                  },
                  "post_id": {
                    "type": "string"
                  },
                  "commentary": {
                    "type": "string"
                  },
                  "target_linkedin_page_id": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "forward",
                      "copy"
                    ],
                    "default": "forward",
                    "description": "Telegram."
                  },
                  "target_chat_id": {
                    "type": "string"
                  },
                  "target_user": {
                    "type": "string",
                    "description": "Telegram: another profile whose chat receives it."
                  },
                  "post_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "string"
                    }
                  },
                  "all_messages": {
                    "type": "boolean",
                    "default": false
                  },
                  "telegram_message_thread_id": {
                    "type": "integer"
                  },
                  "telegram_disable_notification": {
                    "type": "boolean"
                  },
                  "telegram_protect_content": {
                    "type": "boolean"
                  },
                  "caption": {
                    "type": "string"
                  },
                  "telegram_remove_caption": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "platform",
                  "user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. Keys vary by platform (url, repost_id, reposted, parent_post_id, post_ids...).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string"
                    },
                    "post_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, unsupported platform or invalid Telegram parameter. error_code: `missing_required_fields`, `invalid_json`, `telegram_invalid_parameter`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "missing_required_fields",
                  "message": "Missing fields, unsupported platform or invalid Telegram parameter."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed by the platform or the plan. error_code: `PROFILE_BLOCKED`, `telegram_message_not_allowed`, `telegram_target_chat_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "PROFILE_BLOCKED",
                  "message": "Not allowed by the platform or the plan."
                }
              }
            }
          },
          "404": {
            "description": "Post not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "409": {
            "description": "Threads: already reposted. error_code: `already_reposted`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "already_reposted",
                  "message": "Threads: already reposted."
                }
              }
            }
          },
          "429": {
            "description": "Daily limit. error_code: `x_daily_write_limit`, `bluesky_daily_interaction_limit`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "x_daily_write_limit",
                  "message": "Daily limit."
                }
              }
            }
          },
          "503": {
            "description": "Bluesky reposts not available yet. error_code: `bluesky_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "bluesky_feature_disabled",
                  "message": "Bluesky reposts not available yet."
                }
              }
            }
          },
          "504": {
            "description": "Telegram did not answer in time; do not retry blindly (retryable: false). error_code: `telegram_outcome_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "telegram_outcome_unknown",
                  "message": "Telegram did not answer in time; do not retry blindly (retryable: false)."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/posts/save": {
      "post": {
        "operationId": "savePost",
        "summary": "Save a Pin to a board, or bookmark a Bluesky post",
        "tags": [
          "Upload Management"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "pinterest",
                      "bluesky"
                    ],
                    "default": "pinterest"
                  },
                  "user": {
                    "type": "string"
                  },
                  "post_id": {
                    "type": "string"
                  },
                  "pinterest_board_id": {
                    "type": "string",
                    "description": "Required for Pinterest."
                  },
                  "pinterest_board_section_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "user",
                  "post_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "post_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "board_id": {
                      "type": "string"
                    },
                    "board_section_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "parent_pin_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/schedule/{job_id}/preview": {
      "get": {
        "operationId": "getScheduledPostPreview",
        "summary": "Preview URLs of a scheduled post",
        "tags": [
          "Upload Management"
        ],
        "description": "Signed, short-lived URLs of the media, cover and thumbnail of one scheduled job (the listing only says has_preview).",
        "parameters": [
          {
            "$ref": "#/components/parameters/JobIdPathParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Preview URLs (null when there is none).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string"
                    },
                    "preview_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "cover_preview_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "thumbnail_preview_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "external_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "source_filename": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "description": "Could not generate preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/youtube/thumbnail": {
      "post": {
        "operationId": "setYoutubeThumbnail",
        "summary": "Set the thumbnail of a YouTube video",
        "tags": [
          "Platform Integration"
        ],
        "description": "Custom thumbnails need a verified YouTube channel. If the video is still processing the answer is 202 with pending: true.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "video_id"
                ],
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "video_id": {
                    "type": "string"
                  },
                  "thumbnail": {
                    "type": "string",
                    "format": "binary",
                    "description": "JPG, PNG, GIF or BMP, max 50 MB (1280x720 recommended; 1080x1920 for Shorts)."
                  },
                  "thumbnail_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Instead of thumbnail."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "video_id": {
                      "type": "string"
                    },
                    "width": {
                      "type": "integer"
                    },
                    "height": {
                      "type": "integer"
                    },
                    "thumbnails": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "width": {
                            "type": "integer"
                          },
                          "height": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "The video is still processing; YouTube applies it when done.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "video_id": {
                      "type": "string"
                    },
                    "pending": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "width": {
                      "type": "integer"
                    },
                    "height": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing user/video_id or thumbnail, not an image, unsupported format or over 50 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key, or the YouTube token needs reconnecting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "403": {
            "description": "YouTube refused it (usually: channel not verified); youtube_status carries YouTube's status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "404": {
            "description": "The video does not exist or is not on the connected channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "429": {
            "description": "YouTube API quota exhausted for today.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/comments/public-reply": {
      "post": {
        "operationId": "publicReplyToComment",
        "summary": "Reply publicly to a comment",
        "tags": [
          "Instagram Interactions"
        ],
        "description": "Posts a visible reply under the comment (POST /uploadposts/comments/reply sends a private DM instead).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "example": "instagram"
                  },
                  "user": {
                    "type": "string"
                  },
                  "comment_id": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "platform",
                  "user",
                  "comment_id",
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Posted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/queue/slot-full": {
      "post": {
        "operationId": "markQueueSlotFull",
        "summary": "Mark a queue slot as full",
        "tags": [
          "Queue System"
        ],
        "description": "The queue skips this slot (for example, you filled it yourself outside Upload-Post).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "slot_datetime": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Slot time, ISO 8601 UTC."
                  }
                },
                "required": [
                  "profile_username",
                  "slot_datetime"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "full_slots": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "operationId": "unmarkQueueSlotFull",
        "summary": "Free a slot marked as full",
        "tags": [
          "Queue System"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "slot_datetime": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Slot time, ISO 8601 UTC."
                  }
                },
                "required": [
                  "profile_username",
                  "slot_datetime"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "full_slots": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/total-impressions/{profile_username}": {
      "get": {
        "operationId": "getTotalImpressions",
        "summary": "Total impressions (or other metrics) of a profile over a period",
        "tags": [
          "Platform Integration"
        ],
        "description": "Sums the daily profile snapshots Upload-Post already stores (no call to the networks).",
        "parameters": [
          {
            "name": "profile_username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "One day, YYYY-MM-DD."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD (default 30 days ago)."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD (default today)."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "last_day",
                "last_week",
                "last_month",
                "last_3months",
                "last_year"
              ]
            },
            "description": "Overrides start_date/end_date."
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated platforms, e.g. youtube,tiktok."
          },
          {
            "name": "breakdown",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "true adds per_platform and per_day."
          },
          {
            "name": "metrics",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated: followers, reach, views, impressions, likes, comments, shares, saves, profileViews, video_count, following, pin_clicks, outbound_clicks."
          }
        ],
        "responses": {
          "200": {
            "description": "Totals.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "total_impressions": {
                      "type": "integer",
                      "description": "Without metrics."
                    },
                    "metrics": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "With metrics."
                    },
                    "per_platform": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "per_day": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "platforms_filter": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid date format or metric name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/post-analytics/{request_id}": {
      "get": {
        "operationId": "getPostAnalytics",
        "summary": "Analytics of a post published with Upload-Post",
        "tags": [
          "Platform Integration"
        ],
        "description": "Per-platform metrics of an upload (by its request_id), with the profile snapshot at publish date and the latest one.",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "request_id of the upload."
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only one platform, e.g. x."
          }
        ],
        "responses": {
          "200": {
            "description": "Metrics.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "post": {
                      "type": "object",
                      "properties": {
                        "request_id": {
                          "type": "string"
                        },
                        "profile_username": {
                          "type": "string"
                        },
                        "post_title": {
                          "type": "string"
                        },
                        "post_caption": {
                          "type": "string"
                        },
                        "media_type": {
                          "type": "string"
                        },
                        "upload_timestamp": {
                          "type": "string"
                        }
                      }
                    },
                    "platforms": {
                      "type": "object",
                      "additionalProperties": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/PostAnalyticsPlatform"
                          }
                        ],
                        "properties": {
                          "profile_snapshot_at_post_date": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "Metric name -> value; keys depend on the platform (see available_metrics)."
                          },
                          "profile_snapshot_latest": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "Metric name -> value; keys depend on the platform (see available_metrics)."
                          },
                          "profile_snapshot_latest_date": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No post with this request_id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/post-analytics": {
      "get": {
        "operationId": "getPostAnalyticsByPlatformId",
        "summary": "Analytics of any post by its platform id",
        "tags": [
          "Platform Integration"
        ],
        "description": "Live metrics of a post of a connected account, whether or not it was published with Upload-Post (source tells which). 100 requests per 5 minutes. X: only tweets of your connected accounts, with daily caps.",
        "parameters": [
          {
            "name": "platform_post_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Post id on the platform."
          },
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "youtube",
                "tiktok",
                "instagram",
                "facebook",
                "linkedin",
                "x",
                "threads",
                "pinterest",
                "reddit",
                "bluesky"
              ]
            },
            "description": "Platform."
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          }
        ],
        "responses": {
          "200": {
            "description": "Metrics.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "post": {
                      "type": "object",
                      "properties": {
                        "platform_post_id": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "profile_username": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string",
                          "example": "api_uploaded"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Only when source is api_uploaded."
                        }
                      }
                    },
                    "platforms": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/components/schemas/PostAnalyticsPlatform"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid query parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "X: the tweet is not from a connected account. error_type: `post_not_owned`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_type": "post_not_owned",
                  "message": "X: the tweet is not from a connected account."
                }
              }
            }
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "429": {
            "description": "X daily limit (limit, retry_after). error_type: `daily_limit`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_type": "daily_limit",
                  "message": "X daily limit (limit, retry_after)."
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/platform-metrics": {
      "get": {
        "operationId": "getPlatformMetricsCatalog",
        "summary": "Metric catalog per platform",
        "tags": [
          "Platform Integration"
        ],
        "description": "Which metrics each platform reports, their labels and the field that plays \"impressions\". Static: cache it.",
        "responses": {
          "200": {
            "description": "Catalog keyed by platform.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "primary_impressions_field": {
                        "type": "string"
                      },
                      "available_metrics": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "metric_labels": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/instagram/publishing_limit": {
      "get": {
        "operationId": "getInstagramPublishingLimit",
        "summary": "Instagram publishing quota",
        "tags": [
          "Platform Integration"
        ],
        "description": "Instagram content publishing usage of the connected account (Instagram allows a limited number of posts per 24 h). Cached; refresh=true skips the cache.",
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username (alias user)."
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Skip the cache."
          }
        ],
        "responses": {
          "200": {
            "description": "Quota.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "instagram"
                    },
                    "profile": {
                      "type": "string"
                    },
                    "quota_usage": {
                      "type": "integer"
                    },
                    "quota_total": {
                      "type": "integer"
                    },
                    "quota_duration": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "integer"
                    },
                    "limit_reached": {
                      "type": "boolean"
                    },
                    "fetched_at": {
                      "type": "string"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/threads/publishing_limit": {
      "get": {
        "operationId": "getThreadsPublishingLimit",
        "summary": "Threads publishing quota",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Profile username (or use profile)."
          },
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of user."
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Skip the cache."
          }
        ],
        "responses": {
          "200": {
            "description": "Quota.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string",
                      "example": "threads"
                    },
                    "posts": {
                      "type": "object",
                      "properties": {
                        "used": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "remaining": {
                          "type": "integer"
                        },
                        "window_seconds": {
                          "type": "integer"
                        }
                      }
                    },
                    "replies": {
                      "type": "object",
                      "properties": {
                        "used": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "remaining": {
                          "type": "integer"
                        },
                        "window_seconds": {
                          "type": "integer"
                        }
                      }
                    },
                    "fetched_at": {
                      "type": "string"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "description": "Send user or profile (one is required: 400 without both)."
      }
    },
    "/uploadposts/pinterest/boards/{board_id}/sections": {
      "get": {
        "operationId": "listPinterestBoardSections",
        "summary": "List the sections of a Pinterest board",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "board_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Board id."
          },
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          }
        ],
        "responses": {
          "200": {
            "description": "Sections.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "board_id": {
                      "type": "string"
                    },
                    "sections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "profile": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createPinterestBoardSection",
        "summary": "Create a section in a Pinterest board",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "board_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Board id."
          },
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Profile username (alias user); default the first profile with Pinterest."
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of profile."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username. Also accepted as profile, or as ?profile= / ?user= in the query."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 180
                  },
                  "profile": {
                    "type": "string",
                    "description": "Alias of user."
                  }
                },
                "required": [
                  "name"
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username. Also accepted as profile, or as ?profile= / ?user= in the query."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 180
                  },
                  "profile": {
                    "type": "string",
                    "description": "Alias of user."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Section created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "board_id": {
                      "type": "string"
                    },
                    "section": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "description": "Without a profile the first profile of the account with a Pinterest account is used."
      }
    },
    "/uploadposts/facebook/page-info": {
      "get": {
        "operationId": "getFacebookPageInfo",
        "summary": "Read a Facebook Page's public info",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "page_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page id (required if the account manages several Pages)."
          }
        ],
        "responses": {
          "200": {
            "description": "Page info (partial: true when Meta withheld some fields).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "page_id": {
                      "type": "string"
                    },
                    "page": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "about": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "link": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "picture_url": {
                          "type": "string"
                        },
                        "cover_url": {
                          "type": "string"
                        },
                        "emails": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "hours": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          },
                          "description": "Meta format: mon_1_open, mon_1_close..."
                        },
                        "hours_list": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "day": {
                                "type": "string"
                              },
                              "open": {
                                "type": "string"
                              },
                              "close": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "partial": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request. code: `user_required`, `facebook_not_connected`, `facebook_page_required`, `facebook_page_not_accessible`, `invalid_field`, `no_fields`, `facebook_validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "user_required",
                  "message": "Invalid request."
                }
              }
            }
          },
          "401": {
            "description": "Facebook token no longer valid. code: `facebook_reconnect_required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "facebook_reconnect_required",
                  "message": "Facebook token no longer valid."
                }
              }
            }
          },
          "404": {
            "description": "Profile not found, or the account manages no Page. code: `profile_not_found`, `no_facebook_pages`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "profile_not_found",
                  "message": "Profile not found, or the account manages no Page."
                }
              }
            }
          },
          "502": {
            "description": "Error on Facebook's side. code: `facebook_api_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "facebook_api_error",
                  "message": "Error on Facebook's side."
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateFacebookPageInfo",
        "summary": "Update a Facebook Page's public info",
        "tags": [
          "Platform Integration"
        ],
        "description": "Only the fields sent change. validate_only: true checks without writing. Needs Meta's pages_manage_metadata permission (pending App Review: 403 facebook_permission_missing until then). POST is accepted as an alias.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "page_id": {
                    "type": "string"
                  },
                  "validate_only": {
                    "type": "boolean"
                  },
                  "about": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string",
                    "format": "uri"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "emails": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "hours": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "day": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              ]
                            },
                            "open": {
                              "type": "string"
                            },
                            "close": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "At most 2 ranges per day."
                  },
                  "picture_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "cover_url": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated (or would update, with validate_only).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "page_id": {
                      "type": "string"
                    },
                    "updated_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ignored_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "validate_only": {
                      "type": "boolean"
                    },
                    "would_update": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request. code: `user_required`, `facebook_not_connected`, `facebook_page_required`, `facebook_page_not_accessible`, `invalid_field`, `no_fields`, `facebook_validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "user_required",
                  "message": "Invalid request."
                }
              }
            }
          },
          "401": {
            "description": "Facebook token no longer valid. code: `facebook_reconnect_required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "facebook_reconnect_required",
                  "message": "Facebook token no longer valid."
                }
              }
            }
          },
          "403": {
            "description": "Meta requires pages_manage_metadata (pending App Review). code: `facebook_permission_missing`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "facebook_permission_missing",
                  "message": "Meta requires pages_manage_metadata (pending App Review)."
                }
              }
            }
          },
          "404": {
            "description": "Profile not found, or the account manages no Page. code: `profile_not_found`, `no_facebook_pages`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "profile_not_found",
                  "message": "Profile not found, or the account manages no Page."
                }
              }
            }
          },
          "502": {
            "description": "Error on Facebook's side. code: `facebook_api_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "code": "facebook_api_error",
                  "message": "Error on Facebook's side."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/dms/media": {
      "get": {
        "operationId": "downloadDmMedia",
        "summary": "Download a DM attachment",
        "tags": [
          "Instagram Interactions"
        ],
        "description": "Returns the file of an attachment received in a DM (the media_id in dm_received). Telegram: bots download up to 20 MB.",
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "telegram",
                "whatsapp"
              ]
            },
            "description": "Platform of the conversation."
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "media_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "media_id of the attachment (Telegram file_id)."
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/uploadposts/analyze-shorts": {
      "post": {
        "operationId": "analyzeShorts",
        "summary": "AI titles and captions for a short video",
        "tags": [
          "Content Upload"
        ],
        "description": "Watches the video and writes a title/description (YouTube) and captions (Instagram, TikTok, Facebook). Counts against the monthly AI Shorts quota (a failed analysis is not counted).",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "video"
                ],
                "properties": {
                  "video": {
                    "type": "string",
                    "format": "binary",
                    "description": "Max 100 MB and 5 minutes."
                  },
                  "platforms": {
                    "type": "string",
                    "default": "youtube,instagram,tiktok",
                    "description": "Comma-separated: youtube, instagram, tiktok, facebook."
                  },
                  "language": {
                    "type": "string",
                    "description": "Output language (default: the video's)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Texts per requested platform.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ai_generated": {
                      "type": "boolean"
                    },
                    "remaining_analyses": {
                      "type": "integer"
                    },
                    "youtube": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    },
                    "instagram": {
                      "type": "object",
                      "properties": {
                        "caption": {
                          "type": "string"
                        }
                      }
                    },
                    "tiktok": {
                      "type": "object",
                      "properties": {
                        "caption": {
                          "type": "string"
                        }
                      }
                    },
                    "facebook": {
                      "type": "object",
                      "properties": {
                        "caption": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing video, no valid platform, over 100 MB or longer than 5 minutes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Monthly AI Shorts quota exhausted (remaining_analyses: 0).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "500": {
            "description": "The AI could not analyze the video; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/rewrite-captions": {
      "post": {
        "operationId": "rewriteCaptions",
        "summary": "Translate or rewrite captions with AI",
        "tags": [
          "Content Upload"
        ],
        "description": "Rewrites texts with the same shape analyze-shorts returns into another language. Uses the AI Shorts quota.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "object",
                    "properties": {
                      "youtube": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        }
                      },
                      "instagram": {
                        "type": "object",
                        "properties": {
                          "caption": {
                            "type": "string"
                          }
                        }
                      },
                      "tiktok": {
                        "type": "object",
                        "properties": {
                          "caption": {
                            "type": "string"
                          }
                        }
                      },
                      "facebook": {
                        "type": "object",
                        "properties": {
                          "caption": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "language": {
                    "type": "string",
                    "example": "Spanish"
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Subset of the platforms in content (default all)."
                  }
                },
                "required": [
                  "content",
                  "language"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rewritten texts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "remaining_analyses": {
                      "type": "integer"
                    },
                    "youtube": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    },
                    "instagram": {
                      "type": "object",
                      "properties": {
                        "caption": {
                          "type": "string"
                        }
                      }
                    },
                    "tiktok": {
                      "type": "object",
                      "properties": {
                        "caption": {
                          "type": "string"
                        }
                      }
                    },
                    "facebook": {
                      "type": "object",
                      "properties": {
                        "caption": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Monthly AI Shorts quota exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/feedback": {
      "post": {
        "operationId": "sendFeedback",
        "summary": "Send feedback to the Upload-Post team",
        "tags": [
          "Feedback"
        ],
        "description": "For AI agents and developers. Never include credentials or personal data (they are redacted anyway). A repeated report returns duplicate: true.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 4000
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "bug",
                      "docs",
                      "error_message",
                      "feature_request",
                      "other"
                    ],
                    "default": "other"
                  },
                  "endpoint": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string"
                  },
                  "agent": {
                    "type": "string",
                    "description": "Name of the agent or tool."
                  }
                },
                "required": [
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Received.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "id": {
                      "type": "string"
                    },
                    "duplicate": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "message missing or shorter than 10 characters, or unknown category.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "More than 10 reports in an hour or 30 in a day.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/google-business/accounts": {
      "get": {
        "operationId": "listGoogleBusinessAccounts",
        "summary": "List Google Business accounts",
        "description": "Accounts (personal, location groups, user groups, organizations) the connected Google user owns or manages, one page per call (Google returns at most 20 per page).",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "type",
            "in": "query",
            "description": "Account type filter.",
            "schema": {
              "type": "string",
              "enum": [
                "PERSONAL",
                "LOCATION_GROUP",
                "USER_GROUP",
                "ORGANIZATION"
              ]
            }
          },
          {
            "name": "parent_account",
            "in": "query",
            "description": "`accounts/{id}` of an organization or user group: lists its accounts.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-20 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Account objects."
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "connected_account": {
                      "type": "string",
                      "description": "Account saved on the connection (`accounts/{id}`)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_page_size`, `invalid_page_token`, `invalid_account`, `invalid_account_type`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createGoogleBusinessAccount",
        "summary": "Create a location or user group",
        "description": "Creates a location group or user group (Google cannot create personal accounts or organizations this way). Needs `\"confirm\": true`. Returns the new account.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "LOCATION_GROUP",
                      "USER_GROUP"
                    ]
                  },
                  "account_name": {
                    "type": "string",
                    "description": "Name of the new group."
                  },
                  "primary_owner": {
                    "type": "string",
                    "description": "`accounts/{id}` of the primary owner. Default: the connected account."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "type",
                  "account_name",
                  "confirm"
                ]
              },
              "example": {
                "user": "agent-paris",
                "type": "LOCATION_GROUP",
                "account_name": "Agences Dupont",
                "primary_owner": "accounts/9876",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's new Account."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_json`, `invalid_account_type`, `account_name_required`, `invalid_account`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`, `audit_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateGoogleBusinessAccount",
        "summary": "Rename a Google Business account",
        "description": "**Not generally available yet.** Off by default: answers `403` with `ownership_changes_disabled` until the feature is available.\n\nRenames a business account (only the name). With `validate_only: true` Google checks the request without changing anything (no `confirm` needed); that mode works today. A real rename is not generally available yet: 403 `ownership_changes_disabled`. `account` must be the account connected to the profile or the owner of one of its saved locations (404 `account_not_found` otherwise).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "account": {
                    "type": "string",
                    "description": "`accounts/{id}` or a bare id."
                  },
                  "account_name": {
                    "type": "string",
                    "description": "New name."
                  },
                  "validate_only": {
                    "type": "boolean",
                    "description": "Google validates only; nothing changes."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (`true`) unless `validate_only`."
                  }
                },
                "required": [
                  "user",
                  "account_name"
                ]
              },
              "example": {
                "user": "agent-paris",
                "account": "accounts/1234",
                "account_name": "Dupont Immobilier",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account (validated or renamed).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "validate_only": {
                      "type": "boolean",
                      "description": "Present when validating only."
                    },
                    "account": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Account."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_json`, `account_name_required`, `account_required`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `ownership_changes_disabled`, `owner_only`, `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `account_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`, `audit_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/accounts/get": {
      "get": {
        "operationId": "getGoogleBusinessAccount",
        "summary": "Get a Google Business account",
        "description": "Reads one account.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "account",
            "in": "query",
            "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Account."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_account`, `account_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `account_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/admins": {
      "get": {
        "operationId": "listGoogleBusinessAdmins",
        "summary": "List admins",
        "description": "Admins of an account or of a location.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "scope",
            "in": "query",
            "description": "`account` (default; `account`, or the connected account) or `location` (`location_id`, which must belong to the connected account). With `scope=account`, `account` can only be the connected account or the owner of one of its saved locations (404 `account_not_found` otherwise).",
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "location"
              ]
            }
          },
          {
            "name": "account",
            "in": "query",
            "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location when `scope=location`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Admins.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "parent": {
                      "type": "string",
                      "description": "`accounts/{id}` or `locations/{id}`."
                    },
                    "admins": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Admin objects (`name`, `admin`, `role`, `pendingInvitation`...)."
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "parent": "locations/111",
                  "admins": [
                    {
                      "name": "locations/111/admins/5550",
                      "admin": "Marie Dupont",
                      "role": "PRIMARY_OWNER"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_scope`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `account_not_found`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `location_check_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createGoogleBusinessAdmin",
        "summary": "Invite an admin",
        "description": "Google emails the invitation; the person gets access once they accept. Not generally available yet: answers 403 `ownership_changes_disabled` (do it in Google Business Profile). When enabled, only the owner of the Upload-Post account can do it (a team member gets 403 `owner_only`). Needs `\"confirm\": true`. Every change is audited. On 502 `google_result_unknown`, check with the matching GET before resending.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "scope": {
                    "type": "string",
                    "description": "`account` (default) or `location`.",
                    "enum": [
                      "account",
                      "location"
                    ]
                  },
                  "account": {
                    "type": "string",
                    "description": "Target account (`scope=account`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Target location (`scope=location`)."
                  },
                  "admin": {
                    "type": "string",
                    "description": "Email of the person to invite (one of `admin` / `admin_account`)."
                  },
                  "admin_account": {
                    "type": "string",
                    "description": "`accounts/{id}` of a location group to invite to a location (`scope=location` only)."
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "OWNER",
                      "MANAGER",
                      "SITE_MANAGER"
                    ]
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "role",
                  "confirm"
                ]
              },
              "example": {
                "user": "agent-paris",
                "scope": "location",
                "location_id": "111",
                "admin": "helper@dupont.example",
                "role": "MANAGER",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invitation created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "parent": {
                      "type": "string"
                    },
                    "admin": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's new Admin."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_json`, `confirmation_required`, `invalid_scope`, `invalid_location_id`, `invalid_role`, `invalid_admin`, `invalid_account`, `admin_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `ownership_changes_disabled`, `owner_only`, `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `account_not_found`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `location_check_unavailable`, `audit_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "updateGoogleBusinessAdmin",
        "summary": "Change an admin's role",
        "description": "Changes the role of an admin (`admin_name` from GET /admins). If the role is already that one, the answer has `unchanged: true` and nothing is sent. Refused with 409 `last_owner` if it would demote the last owner and 409 `connected_identity` if it would demote the Google account connected to Upload-Post. Not generally available yet: answers 403 `ownership_changes_disabled` (do it in Google Business Profile). When enabled, only the owner of the Upload-Post account can do it (a team member gets 403 `owner_only`). Needs `\"confirm\": true`. Every change is audited. On 502 `google_result_unknown`, check with the matching GET before resending.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "admin_name": {
                    "type": "string",
                    "description": "`accounts/{a}/admins/{id}` or `locations/{l}/admins/{id}` (alias `name`)."
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "PRIMARY_OWNER",
                      "OWNER",
                      "MANAGER",
                      "SITE_MANAGER"
                    ]
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "admin_name",
                  "role",
                  "confirm"
                ]
              },
              "example": {
                "user": "agent-paris",
                "admin_name": "locations/111/admins/5551",
                "role": "OWNER",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Admin updated (or unchanged).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "admin": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Admin."
                    },
                    "unchanged": {
                      "type": "boolean",
                      "description": "Present when nothing changed."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_json`, `confirmation_required`, `invalid_scope`, `invalid_location_id`, `invalid_role`, `invalid_admin_name`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `ownership_changes_disabled`, `owner_only`, `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `account_not_found`, `location_not_found`, `admin_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. `error_code`: `last_owner`, `connected_identity`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `location_check_unavailable`, `audit_unavailable`, `identity_check_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      },
      "delete": {
        "operationId": "deleteGoogleBusinessAdmin",
        "summary": "Remove an admin",
        "description": "Removes an admin at once (they would have to be invited again). Refused with 409 `last_owner` / `connected_identity` like the role change. JSON body. Not generally available yet: answers 403 `ownership_changes_disabled` (do it in Google Business Profile). When enabled, only the owner of the Upload-Post account can do it (a team member gets 403 `owner_only`). Needs `\"confirm\": true`. Every change is audited. On 502 `google_result_unknown`, check with the matching GET before resending.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "admin_name": {
                    "type": "string",
                    "description": "Admin resource name from GET /admins (alias `name`)."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "admin_name",
                  "confirm"
                ]
              },
              "example": {
                "user": "agent-paris",
                "admin_name": "locations/111/admins/5551",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Admin removed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "removed": {
                      "type": "string",
                      "description": "Resource name of the removed admin."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_json`, `confirmation_required`, `invalid_scope`, `invalid_location_id`, `invalid_admin_name`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `ownership_changes_disabled`, `owner_only`, `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `account_not_found`, `location_not_found`, `admin_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. `error_code`: `last_owner`, `connected_identity`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `location_check_unavailable`, `audit_unavailable`, `identity_check_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/invitations": {
      "get": {
        "operationId": "listGoogleBusinessInvitations",
        "summary": "List invitations",
        "description": "Pending invitations the connected Google account has received. Each has `name`, `role`, `targetType` and `targetAccount` or `targetLocation`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "account",
            "in": "query",
            "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target_type",
            "in": "query",
            "description": "Filter.",
            "schema": {
              "type": "string",
              "enum": [
                "ACCOUNTS_ONLY",
                "LOCATIONS_ONLY"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invitations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "string"
                    },
                    "invitations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Invitation objects."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_account`, `account_required`, `invalid_target_type`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/invitations/accept": {
      "post": {
        "operationId": "acceptGoogleBusinessInvitation",
        "summary": "Accept an invitation",
        "description": "Accepts a pending invitation (404 `invitation_not_found` otherwise). Not generally available yet: answers 403 `ownership_changes_disabled` (do it in Google Business Profile). When enabled, only the owner of the Upload-Post account can do it (a team member gets 403 `owner_only`). Needs `\"confirm\": true`. Every change is audited. On 502 `google_result_unknown`, check with the matching GET before resending.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "invitation": {
                    "type": "string",
                    "description": "`accounts/{a}/invitations/{id}` (alias `invitation_name`)."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "invitation",
                  "confirm"
                ]
              },
              "example": {
                "user": "agent-paris",
                "invitation": "accounts/9876/invitations/abc123",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invitation accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "invitation": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "accept",
                        "decline"
                      ]
                    },
                    "role": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_json`, `invalid_invitation`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `ownership_changes_disabled`, `owner_only`, `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `invitation_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `audit_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/invitations/decline": {
      "post": {
        "operationId": "declineGoogleBusinessInvitation",
        "summary": "Decline an invitation",
        "description": "Declines a pending invitation (404 `invitation_not_found` otherwise). Not generally available yet: answers 403 `ownership_changes_disabled` (do it in Google Business Profile). When enabled, only the owner of the Upload-Post account can do it (a team member gets 403 `owner_only`). Needs `\"confirm\": true`. Every change is audited. On 502 `google_result_unknown`, check with the matching GET before resending.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "invitation": {
                    "type": "string",
                    "description": "`accounts/{a}/invitations/{id}` (alias `invitation_name`)."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "invitation",
                  "confirm"
                ]
              },
              "example": {
                "user": "agent-paris",
                "invitation": "accounts/9876/invitations/abc123",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invitation declineed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "invitation": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "accept",
                        "decline"
                      ]
                    },
                    "role": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_json`, `invalid_invitation`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `ownership_changes_disabled`, `owner_only`, `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `invitation_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `audit_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/locations/transfer": {
      "post": {
        "operationId": "transferGoogleBusinessLocation",
        "summary": "Transfer a location to another account",
        "description": "Moves a location to another Google account. Google only allows it when the connected user owns the location and manages the destination account. Not generally available yet: answers 403 `ownership_changes_disabled` (do it in Google Business Profile). When enabled, only the owner of the Upload-Post account can do it (a team member gets 403 `owner_only`). Needs `\"confirm\": true`. Every change is audited. On 502 `google_result_unknown`, check with the matching GET before resending.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "destination_account": {
                    "type": "string",
                    "description": "`accounts/{id}` that receives the location."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "location_id",
                  "destination_account",
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Location transferred.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "destination_account": {
                      "type": "string"
                    },
                    "previous_account": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_json`, `invalid_account`, `location_required`, `confirmation_required`, `invalid_location_id`, `same_account`, `invalid_destination_account`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `ownership_changes_disabled`, `owner_only`, `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `location_check_unavailable`, `audit_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/attributes": {
      "get": {
        "operationId": "getGoogleBusinessAttributes",
        "summary": "Get location attributes",
        "description": "Current attributes of the location (Wi-Fi, payments, accessibility, WhatsApp and SMS links...).",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attributes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "attributes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Attribute objects (`name`, `values`, `uriValues`...)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateGoogleBusinessAttributes",
        "summary": "Update location attributes",
        "description": "Sets or removes only the attributes you name; all others stay as they are. Counts toward Google's limit of 10 edits per minute per location (429 `location_edit_rate_limited`).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "attributes": {
                    "type": "array",
                    "maxItems": 100,
                    "description": "Attributes to set. Each has `name` (`attributes/` prefix optional) and exactly one of `values` (one value), `uri_values` (URLs) or `repeated_enum_value` (`{set_values, unset_values}`).",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "values": {
                          "type": "array",
                          "items": {}
                        },
                        "uri_values": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "repeated_enum_value": {
                          "type": "object",
                          "properties": {
                            "set_values": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "unset_values": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "whatsapp_url": {
                    "type": "string",
                    "description": "Shortcut for `attributes/url_whatsapp` (e.g. `https://wa.me/34600000000`). `null` removes it; `\"\"` leaves it as it is.",
                    "nullable": true
                  },
                  "text_messaging_url": {
                    "type": "string",
                    "description": "Shortcut for `attributes/url_text_messaging` (e.g. `sms:+34600000000`). `null` removes it; `\"\"` leaves it as it is.",
                    "nullable": true
                  },
                  "remove": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Attributes to remove."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (`true`) when something is removed."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Validate and return what would be sent, without calling Google."
                  },
                  "include_edit_status": {
                    "type": "boolean",
                    "description": "Default `true`: include `edit_status` (experimental)."
                  }
                },
                "required": [
                  "user"
                ]
              },
              "example": {
                "user": "panaderia-sol",
                "whatsapp_url": "https://wa.me/34600000000",
                "attributes": [
                  {
                    "name": "has_wifi",
                    "values": [
                      true
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attributes updated (or the dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "attribute_mask": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "removed": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "attributes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Attribute objects after the update."
                    },
                    "google_validated": {
                      "type": "boolean",
                      "description": "Dry run only."
                    },
                    "would_send": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Dry run only: the request that would be sent."
                    },
                    "edit_status": {
                      "$ref": "#/components/schemas/GbpEditStatus"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_json`, `invalid_field`, `no_fields`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `location_edit_rate_limited`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "updateGoogleBusinessAttributesPost",
        "summary": "Update location attributes (POST)",
        "description": "Sets or removes only the attributes you name; all others stay as they are. Counts toward Google's limit of 10 edits per minute per location (429 `location_edit_rate_limited`). Same as PATCH; use PATCH.",
        "tags": [
          "Google Business"
        ],
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "attributes": {
                    "type": "array",
                    "maxItems": 100,
                    "description": "Attributes to set. Each has `name` (`attributes/` prefix optional) and exactly one of `values` (one value), `uri_values` (URLs) or `repeated_enum_value` (`{set_values, unset_values}`).",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "values": {
                          "type": "array",
                          "items": {}
                        },
                        "uri_values": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "repeated_enum_value": {
                          "type": "object",
                          "properties": {
                            "set_values": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "unset_values": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "whatsapp_url": {
                    "type": "string",
                    "description": "Shortcut for `attributes/url_whatsapp` (e.g. `https://wa.me/34600000000`). `null` removes it; `\"\"` leaves it as it is.",
                    "nullable": true
                  },
                  "text_messaging_url": {
                    "type": "string",
                    "description": "Shortcut for `attributes/url_text_messaging` (e.g. `sms:+34600000000`). `null` removes it; `\"\"` leaves it as it is.",
                    "nullable": true
                  },
                  "remove": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Attributes to remove."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (`true`) when something is removed."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Validate and return what would be sent, without calling Google."
                  },
                  "include_edit_status": {
                    "type": "boolean",
                    "description": "Default `true`: include `edit_status` (experimental)."
                  }
                },
                "required": [
                  "user"
                ]
              },
              "example": {
                "user": "panaderia-sol",
                "whatsapp_url": "https://wa.me/34600000000",
                "attributes": [
                  {
                    "name": "has_wifi",
                    "values": [
                      true
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attributes updated (or the dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "attribute_mask": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "removed": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "attributes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Attribute objects after the update."
                    },
                    "google_validated": {
                      "type": "boolean",
                      "description": "Dry run only."
                    },
                    "would_send": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Dry run only: the request that would be sent."
                    },
                    "edit_status": {
                      "$ref": "#/components/schemas/GbpEditStatus"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_json`, `invalid_field`, `no_fields`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `location_edit_rate_limited`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/attributes/available": {
      "get": {
        "operationId": "listGoogleBusinessAvailableAttributes",
        "summary": "List available attributes",
        "description": "Attributes a location can use. Three modes: for a location (`user` + `location_id`); for a category (`category` + `region_code`, cached 24 h); or everything in a country (`show_all=true` + `region_code`, cached 24 h). Each item has `parent`, `valueType`, `displayName`, `groupDisplayName`, `repeatable`, `deprecated` and, for enums, `valueMetadata`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username (location mode; optional in the other modes).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Category id, e.g. `gcid:bakery`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region_code",
            "in": "query",
            "description": "ISO 3166-1 alpha-2 country, e.g. `ES`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language_code",
            "in": "query",
            "description": "BCP 47 language.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "show_all",
            "in": "query",
            "description": "`true`: every attribute of the country.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-200 (default 200).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available attributes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string",
                      "description": "Location mode only."
                    },
                    "attributes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's AttributeMetadata objects."
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_category`, `invalid_region_code`, `invalid_language_code`, `invalid_page_size`, `invalid_page_token`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/attributes/google-updated": {
      "get": {
        "operationId": "getGoogleBusinessGoogleUpdatedAttributes",
        "summary": "Get attributes as customers see them",
        "description": "The attribute values after Google's own changes.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attributes as customers see them.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "attributes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Attribute objects."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/attributes/extended": {
      "get": {
        "operationId": "getGoogleBusinessExtendedAttributes",
        "summary": "Get attributes with edit status (experimental)",
        "description": "Per attribute, what you set, what customers see and the moderation stage. Built on an experimental Google API (`experimental: true`); Google may change it with 30 days' notice.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Extended attributes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "experimental": {
                      "type": "boolean"
                    },
                    "channel": {
                      "type": "string"
                    },
                    "experimental_notice": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/categories": {
      "get": {
        "operationId": "listGoogleBusinessCategories",
        "summary": "Search categories",
        "description": "Google Business categories (`gcid:...`). Same for everyone: cached 24 h (`cached: true`). `view=FULL` adds `serviceTypes` and `moreHoursTypes`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "region_code",
            "in": "query",
            "description": "ISO 3166-1 alpha-2 country, e.g. `ES`.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "language_code",
            "in": "query",
            "description": "BCP 47 language, e.g. `es`.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "query",
            "in": "query",
            "description": "Text to search in the category name (max 100 characters).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "view",
            "in": "query",
            "description": "Default `BASIC`.",
            "schema": {
              "type": "string",
              "enum": [
                "BASIC",
                "FULL"
              ]
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-100 (default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile whose Google Business connection is used. Default: any connected Google Business account of yours.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Categories.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Category objects."
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "categories": [
                    {
                      "name": "categories/gcid:bakery",
                      "displayName": "Panadería"
                    }
                  ],
                  "next_page_token": null,
                  "cached": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `google_business_not_connected`, `user_required`, `google_validation_error`, `google_precondition_failed`, `invalid_region_code`, `invalid_language_code`, `invalid_view`, `invalid_query`, `invalid_page_size`, `invalid_page_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/categories/batch": {
      "get": {
        "operationId": "batchGetGoogleBusinessCategories",
        "summary": "Get category details",
        "description": "Details of up to 100 categories. With `view=FULL` (default) each carries `serviceTypes` (the `serviceTypeId` values for structured services) and `moreHoursTypes` (the `hours_type_id` values for `more_hours`). Cached 24 h.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "names",
            "in": "query",
            "description": "1-100 category ids, comma separated (`gcid:bakery,gcid:cafe`) or repeated.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "language_code",
            "in": "query",
            "description": "BCP 47 language.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "region_code",
            "in": "query",
            "description": "Country code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "view",
            "in": "query",
            "description": "Default `FULL`.",
            "schema": {
              "type": "string",
              "enum": [
                "BASIC",
                "FULL"
              ]
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile whose Google Business connection is used. Default: any connected Google Business account of yours.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Categories.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Category objects."
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `google_business_not_connected`, `user_required`, `google_validation_error`, `google_precondition_failed`, `invalid_names`, `invalid_language_code`, `invalid_region_code`, `invalid_view`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/chains": {
      "get": {
        "operationId": "searchGoogleBusinessChains",
        "summary": "Search chains",
        "description": "Searches a chain or brand by name. Use the chain name as `parent_chain` in location info. Cached 24 h.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Chain name (alias `chain_name`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-500 (default 10).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile whose Google Business connection is used. Default: any connected Google Business account of yours.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chains.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "chains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Chain objects."
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `google_business_not_connected`, `user_required`, `google_validation_error`, `google_precondition_failed`, `invalid_chain_name`, `invalid_page_size`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/chains/get": {
      "get": {
        "operationId": "getGoogleBusinessChain",
        "summary": "Get a chain",
        "description": "One chain (`chainNames`, `websites`, `locationCount`). Cached 24 h.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "chain",
            "in": "query",
            "description": "`chains/...`.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "user",
            "in": "query",
            "description": "Profile whose Google Business connection is used. Default: any connected Google Business account of yours.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The chain.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "chain": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Chain."
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `google_business_not_connected`, `user_required`, `google_validation_error`, `google_precondition_failed`, `invalid_chain`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/google-locations/search": {
      "post": {
        "operationId": "searchGoogleBusinessGoogleLocations",
        "summary": "Check whether a business is already on Google",
        "description": "Searches Google Maps for a business (free text or a Location object). If an item has `requestAdminRightsUri`, someone else manages it. Google only allows this search for businesses you work with (lead generation or competitive analysis gets API access revoked). Limited number of searches per day (429 `daily_limit_reached`); when Google's daily limit is used up, 429 `google_daily_quota_exhausted` until midnight Pacific time.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Free text, e.g. `Panadería Sol, Calle Mayor 3, Madrid` (one of `query` / `location`)."
                  },
                  "location": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "A Google Location object with at least `title` (one of `query` / `location`)."
                  },
                  "page_size": {
                    "type": "integer",
                    "description": "1-10 (default 3).",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile whose connection is used. Optional."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matches.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "count": {
                      "type": "integer"
                    },
                    "google_locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's GoogleLocation objects."
                    },
                    "claimed": {
                      "type": "array",
                      "items": {
                        "type": "boolean"
                      },
                      "description": "Per item: someone already manages it."
                    },
                    "policy_notice": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `google_business_not_connected`, `user_required`, `google_validation_error`, `google_precondition_failed`, `invalid_json`, `invalid_search`, `invalid_page_size`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`, `google_daily_quota_exhausted`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`, `gbp_quota_guard_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/google-locations/recommended": {
      "get": {
        "operationId": "listGoogleBusinessRecommendedLocations",
        "summary": "List recommended locations",
        "description": "Locations Google recommends to a personal account or location group (other account types get an error from Google).",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "account",
            "in": "query",
            "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-100 (default 25).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recommendations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "string"
                    },
                    "google_locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's GoogleLocation objects."
                    },
                    "total_size": {
                      "type": "integer"
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_account`, `account_required`, `invalid_page_size`, `invalid_page_token`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/google-locations/report": {
      "post": {
        "operationId": "reportGoogleBusinessGoogleLocation",
        "summary": "Report a wrong listing",
        "description": "Reports a Google location (from the search or the recommendations) to Google, from your account. Needs `\"confirm\": true`. On 502 `google_result_unknown`, do not send it again blindly.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "google_location": {
                    "type": "string",
                    "description": "`googleLocations/{id}`."
                  },
                  "reason_bad_location": {
                    "type": "string",
                    "description": "One of the two reasons.",
                    "enum": [
                      "NOT_A_LOCATION",
                      "PERMANENTLY_CLOSED",
                      "DOES_NOT_EXIST",
                      "SPAM",
                      "NOT_A_BUSINESS",
                      "MOVED",
                      "DUPLICATE"
                    ]
                  },
                  "reason_bad_recommendation": {
                    "type": "string",
                    "description": "One of the two reasons.",
                    "enum": [
                      "NOT_A_STORE_FRONT",
                      "NOT_PART_OF_SUGGESTED_CHAIN",
                      "IRRELEVANT"
                    ]
                  },
                  "elaboration": {
                    "type": "string",
                    "description": "Up to 512 characters. Required for `MOVED`, `NOT_PART_OF_SUGGESTED_CHAIN` and `IRRELEVANT`.",
                    "maxLength": 512
                  },
                  "language_code": {
                    "type": "string",
                    "description": "Language of `elaboration`."
                  },
                  "location_group": {
                    "type": "string",
                    "description": "`accounts/{id}` of the location group the report is for."
                  },
                  "user": {
                    "type": "string",
                    "description": "Profile whose connection is used. Optional."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "google_location",
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "google_location": {
                      "type": "string"
                    },
                    "reported": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `google_business_not_connected`, `user_required`, `google_validation_error`, `google_precondition_failed`, `invalid_json`, `invalid_google_location`, `invalid_reason`, `invalid_elaboration`, `elaboration_required`, `invalid_language_code`, `invalid_account`, `confirmation_required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/location-info": {
      "get": {
        "operationId": "getGoogleBusinessLocationInfo",
        "summary": "Get location info",
        "description": "Business information of the location (name, address, hours, phones, website, categories, open status...). `info` is a flat view; `location` is Google's raw Location resource.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "read_mask",
            "in": "query",
            "description": "Comma-separated Location fields to return (e.g. `name,title,serviceItems`). Default: all.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Location info.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "info": {
                      "$ref": "#/components/schemas/GbpLocationInfoView"
                    },
                    "location": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Location resource."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_read_mask`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateGoogleBusinessLocationInfo",
        "summary": "Update location info",
        "description": "Changes only the fields you send (Google's `updateMask` is built from them). `edit_mode` `legacy` (default) keeps the historical behaviour; `strict` accepts every field, supports `dry_run`, needs `confirm` for risky changes and returns `edit_status`. A new name, address, primary category or phone, or a closed status, can make Google ask for verification again. Google allows 10 edits per minute per location (429 `location_edit_rate_limited`). The strict mode can be temporarily disabled (503 `gbp_feature_disabled`); the legacy mode never is.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "edit_mode": {
                    "type": "string",
                    "description": "`legacy` (default): only description, website, phone, additional_phones, regular_hours, special_hours, primary_category and additional_categories are used and an empty value clears the field. `strict`: every field; empty = unchanged, `null` = clear; risky changes need `confirm`.",
                    "enum": [
                      "legacy",
                      "strict"
                    ]
                  },
                  "validate_only": {
                    "type": "boolean",
                    "description": "Both modes: Google validates without applying."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Strict only: Google validates without applying."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Strict only: required for `title`, `address`, `primary_category`, `phone` or a closed `open_status`."
                  },
                  "include_edit_status": {
                    "type": "boolean",
                    "description": "Strict only. Default `true`."
                  },
                  "title": {
                    "type": "string",
                    "description": "Strict only. Needs `confirm`."
                  },
                  "store_code": {
                    "type": "string",
                    "description": "Strict only.",
                    "nullable": true
                  },
                  "description": {
                    "type": "string",
                    "description": "Max 750 characters.",
                    "maxLength": 750
                  },
                  "website": {
                    "type": "string",
                    "description": "Absolute http(s) URL (alias `website_uri`).",
                    "nullable": true
                  },
                  "phone": {
                    "type": "string",
                    "description": "Primary phone (alias `primary_phone`)."
                  },
                  "additional_phones": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 2,
                    "nullable": true
                  },
                  "regular_hours": {
                    "type": "array",
                    "nullable": true,
                    "description": "`[{\"day\": \"MONDAY\" | [..], \"open\": \"09:00\", \"close\": \"18:00\"}]`, or Google's `{\"periods\": [...]}`.",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "special_hours": {
                    "type": "array",
                    "nullable": true,
                    "description": "`[{\"date\": \"2026-12-25\", \"closed\": true}]` or with `open`/`close`/`end_date`.",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "primary_category": {
                    "type": "string",
                    "description": "e.g. `gcid:real_estate_agency`."
                  },
                  "additional_categories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 9,
                    "nullable": true
                  },
                  "address": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": true,
                    "description": "Strict only. `region_code` (required), `address_lines`, `locality`, `postal_code`, `administrative_area`... Needs `confirm`."
                  },
                  "service_area": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": true,
                    "description": "Strict only. `{business_type, places: [{place_id, place_name}]}`."
                  },
                  "more_hours": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "description": "Strict only. `[{hours_type_id, hours: [...]}]`."
                  },
                  "open_status": {
                    "type": "string",
                    "description": "Strict only.",
                    "enum": [
                      "OPEN",
                      "CLOSED_TEMPORARILY",
                      "CLOSED_PERMANENTLY"
                    ]
                  },
                  "opening_date": {
                    "type": "string",
                    "description": "Strict only. `YYYY-MM-DD` or `YYYY-MM`.",
                    "nullable": true
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "nullable": true,
                    "description": "Strict only."
                  },
                  "ad_phone": {
                    "type": "string",
                    "description": "Strict only.",
                    "nullable": true
                  },
                  "latlng": {
                    "type": "object",
                    "nullable": true,
                    "description": "Strict only.",
                    "properties": {
                      "latitude": {
                        "type": "number"
                      },
                      "longitude": {
                        "type": "number"
                      }
                    }
                  },
                  "relationship_data": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": true,
                    "description": "Strict only. Replaces all relations."
                  },
                  "parent_chain": {
                    "type": "string",
                    "description": "Strict only. `chains/...`.",
                    "nullable": true
                  }
                },
                "required": [
                  "user"
                ]
              },
              "example": {
                "user": "agent-paris",
                "edit_mode": "strict",
                "website": "https://dupont.example",
                "regular_hours": [
                  {
                    "day": [
                      "MONDAY",
                      "TUESDAY"
                    ],
                    "open": "09:00",
                    "close": "19:00"
                  }
                ],
                "special_hours": [
                  {
                    "date": "2026-12-25",
                    "closed": true
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Location updated (or validated).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "validate_only": {
                      "type": "boolean"
                    },
                    "update_mask": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ignored_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Body keys not used in the chosen mode."
                    },
                    "dry_run": {
                      "type": "boolean",
                      "description": "Strict only."
                    },
                    "unchanged_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Strict only."
                    },
                    "edit_mode": {
                      "type": "string",
                      "description": "Strict only."
                    },
                    "has_pending_edits": {
                      "type": "boolean",
                      "description": "Strict only."
                    },
                    "info": {
                      "$ref": "#/components/schemas/GbpLocationInfoView"
                    },
                    "location": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Location after the update."
                    },
                    "edit_status": {
                      "$ref": "#/components/schemas/GbpEditStatus"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_json`, `invalid_edit_mode`, `invalid_field`, `no_fields`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `location_edit_rate_limited`, `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `gbp_feature_disabled`, `google_api_not_enabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "updateGoogleBusinessLocationInfoPost",
        "summary": "Update location info (POST)",
        "description": "Changes only the fields you send (Google's `updateMask` is built from them). `edit_mode` `legacy` (default) keeps the historical behaviour; `strict` accepts every field, supports `dry_run`, needs `confirm` for risky changes and returns `edit_status`. A new name, address, primary category or phone, or a closed status, can make Google ask for verification again. Google allows 10 edits per minute per location (429 `location_edit_rate_limited`). The strict mode can be temporarily disabled (503 `gbp_feature_disabled`); the legacy mode never is. Same as PATCH; use PATCH.",
        "tags": [
          "Google Business"
        ],
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "edit_mode": {
                    "type": "string",
                    "description": "`legacy` (default): only description, website, phone, additional_phones, regular_hours, special_hours, primary_category and additional_categories are used and an empty value clears the field. `strict`: every field; empty = unchanged, `null` = clear; risky changes need `confirm`.",
                    "enum": [
                      "legacy",
                      "strict"
                    ]
                  },
                  "validate_only": {
                    "type": "boolean",
                    "description": "Both modes: Google validates without applying."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Strict only: Google validates without applying."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Strict only: required for `title`, `address`, `primary_category`, `phone` or a closed `open_status`."
                  },
                  "include_edit_status": {
                    "type": "boolean",
                    "description": "Strict only. Default `true`."
                  },
                  "title": {
                    "type": "string",
                    "description": "Strict only. Needs `confirm`."
                  },
                  "store_code": {
                    "type": "string",
                    "description": "Strict only.",
                    "nullable": true
                  },
                  "description": {
                    "type": "string",
                    "description": "Max 750 characters.",
                    "maxLength": 750
                  },
                  "website": {
                    "type": "string",
                    "description": "Absolute http(s) URL (alias `website_uri`).",
                    "nullable": true
                  },
                  "phone": {
                    "type": "string",
                    "description": "Primary phone (alias `primary_phone`)."
                  },
                  "additional_phones": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 2,
                    "nullable": true
                  },
                  "regular_hours": {
                    "type": "array",
                    "nullable": true,
                    "description": "`[{\"day\": \"MONDAY\" | [..], \"open\": \"09:00\", \"close\": \"18:00\"}]`, or Google's `{\"periods\": [...]}`.",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "special_hours": {
                    "type": "array",
                    "nullable": true,
                    "description": "`[{\"date\": \"2026-12-25\", \"closed\": true}]` or with `open`/`close`/`end_date`.",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "primary_category": {
                    "type": "string",
                    "description": "e.g. `gcid:real_estate_agency`."
                  },
                  "additional_categories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 9,
                    "nullable": true
                  },
                  "address": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": true,
                    "description": "Strict only. `region_code` (required), `address_lines`, `locality`, `postal_code`, `administrative_area`... Needs `confirm`."
                  },
                  "service_area": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": true,
                    "description": "Strict only. `{business_type, places: [{place_id, place_name}]}`."
                  },
                  "more_hours": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "description": "Strict only. `[{hours_type_id, hours: [...]}]`."
                  },
                  "open_status": {
                    "type": "string",
                    "description": "Strict only.",
                    "enum": [
                      "OPEN",
                      "CLOSED_TEMPORARILY",
                      "CLOSED_PERMANENTLY"
                    ]
                  },
                  "opening_date": {
                    "type": "string",
                    "description": "Strict only. `YYYY-MM-DD` or `YYYY-MM`.",
                    "nullable": true
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "nullable": true,
                    "description": "Strict only."
                  },
                  "ad_phone": {
                    "type": "string",
                    "description": "Strict only.",
                    "nullable": true
                  },
                  "latlng": {
                    "type": "object",
                    "nullable": true,
                    "description": "Strict only.",
                    "properties": {
                      "latitude": {
                        "type": "number"
                      },
                      "longitude": {
                        "type": "number"
                      }
                    }
                  },
                  "relationship_data": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": true,
                    "description": "Strict only. Replaces all relations."
                  },
                  "parent_chain": {
                    "type": "string",
                    "description": "Strict only. `chains/...`.",
                    "nullable": true
                  }
                },
                "required": [
                  "user"
                ]
              },
              "example": {
                "user": "agent-paris",
                "edit_mode": "strict",
                "website": "https://dupont.example",
                "regular_hours": [
                  {
                    "day": [
                      "MONDAY",
                      "TUESDAY"
                    ],
                    "open": "09:00",
                    "close": "19:00"
                  }
                ],
                "special_hours": [
                  {
                    "date": "2026-12-25",
                    "closed": true
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Location updated (or validated).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "validate_only": {
                      "type": "boolean"
                    },
                    "update_mask": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ignored_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Body keys not used in the chosen mode."
                    },
                    "dry_run": {
                      "type": "boolean",
                      "description": "Strict only."
                    },
                    "unchanged_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Strict only."
                    },
                    "edit_mode": {
                      "type": "string",
                      "description": "Strict only."
                    },
                    "has_pending_edits": {
                      "type": "boolean",
                      "description": "Strict only."
                    },
                    "info": {
                      "$ref": "#/components/schemas/GbpLocationInfoView"
                    },
                    "location": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Location after the update."
                    },
                    "edit_status": {
                      "$ref": "#/components/schemas/GbpEditStatus"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_json`, `invalid_edit_mode`, `invalid_field`, `no_fields`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `location_edit_rate_limited`, `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `gbp_feature_disabled`, `google_api_not_enabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/location-info/google-updated": {
      "get": {
        "operationId": "getGoogleBusinessGoogleUpdatedLocationInfo",
        "summary": "Get changes suggested by Google",
        "description": "The listing as customers see it, with the fields Google changed (`diff_fields`, `diffMask`).",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "read_mask",
            "in": "query",
            "description": "Comma-separated Location fields.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Google's version of the listing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "has_google_updates": {
                      "type": "boolean"
                    },
                    "diff_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "pending_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "location": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The listing as customers see it."
                    },
                    "diffMask": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_read_mask`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/location-info/google-updates": {
      "post": {
        "operationId": "applyGoogleBusinessGoogleUpdates",
        "summary": "Accept or reject Google's changes",
        "description": "Accepts (keep Google's value) or rejects (send yours again) Google's changes field by field. Only the fields named are read and written. A field without a pending Google change answers 409 `no_google_update`. `confirm: true` is required for `title`, `storefrontAddress`, `categories`, `phoneNumbers` and `openInfo`.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "accept",
                      "reject"
                    ]
                  },
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Fields from `diff_fields`."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Validate only."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required for the risky fields listed above."
                  }
                },
                "required": [
                  "user",
                  "decision",
                  "fields"
                ]
              },
              "example": {
                "user": "agent-paris",
                "decision": "accept",
                "fields": [
                  "regularHours"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decision applied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "decision": {
                      "type": "string"
                    },
                    "fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "location": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Location after the change."
                    },
                    "edit_status": {
                      "$ref": "#/components/schemas/GbpEditStatus"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_json`, `invalid_decision`, `invalid_fields`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. `error_code`: `no_google_update`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `location_edit_rate_limited`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/location-info/extended": {
      "get": {
        "operationId": "getGoogleBusinessExtendedLocationInfo",
        "summary": "Get the edit status of each field (experimental)",
        "description": "What you submitted (`locationProvidedByMerchant`), what customers see (`locationSeenByConsumers`) and, per field, the moderation stage (`edit_status`), plus `pending_fields` and `rejected_fields`. Built on an experimental Google API (`experimental: true`).",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Extended location.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "edit_status": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Moderation stage per field."
                    },
                    "pending_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rejected_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "locationProvidedByMerchant": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "What you submitted."
                    },
                    "locationSeenByConsumers": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "What customers see."
                    },
                    "experimental": {
                      "type": "boolean"
                    },
                    "channel": {
                      "type": "string"
                    },
                    "experimental_notice": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/locations": {
      "get": {
        "operationId": "getGoogleBusinessLocations",
        "summary": "Get Google Business locations",
        "description": "Locations of the connected Google Business accounts (all of them, or only the one linked to `profile`), read live and kept about two minutes. Use `name` as `gbp_location_id` in uploads. Connections with many Google accounts are read in parts: `incomplete: true` with `next_cursor` (with `profile`) and `next_cursors` per connection (`reason`: `time`, `max_accounts` or `rate_limited`); call again with `cursor=<next_cursor>`. Errors on this endpoint carry `message` instead of `error_code`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "description": "Profile username: only the locations of its Google Business account.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "With `profile`: the `next_cursor` of a previous answer, unchanged.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "description": "`true` skips the short cache (honoured at most once a minute per connection).",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Locations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Location id to use as `gbp_location_id`."
                          },
                          "title": {
                            "type": "string"
                          },
                          "account_id": {
                            "type": "string",
                            "description": "Upload-Post account key."
                          },
                          "account_name": {
                            "type": "string",
                            "description": "Google account that owns the location."
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "incomplete": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": "string"
                    },
                    "incomplete_reason": {
                      "type": "string"
                    },
                    "next_cursors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "next_cursor": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "success": true,
                  "locations": [
                    {
                      "name": "accounts/123456789/locations/111111111",
                      "title": "Main Street Store",
                      "account_id": "accounts_123456789_111111111"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User, profile or Google Business connection not found. Body is `{success: false, message}` without `error_code`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/locations/list": {
      "get": {
        "operationId": "listGoogleBusinessLocations",
        "summary": "List locations with filters",
        "description": "Locations of one Google account with Google's filter, ordering and read mask, one page per call.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "account",
            "in": "query",
            "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Google's filter syntax, e.g. `title=\"Bakery\"`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "description": "`title` and/or `store_code`, optionally with ` desc`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "read_mask",
            "in": "query",
            "description": "Fields to return. Default `name,title,storeCode,storefrontAddress,categories,openInfo,metadata`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-100 (default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Locations page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "string"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Location objects."
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_account`, `account_required`, `invalid_page_size`, `invalid_read_mask`, `invalid_filter`, `invalid_order_by`, `invalid_page_token`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/locations/create": {
      "post": {
        "operationId": "createGoogleBusinessLocation",
        "summary": "Create a location",
        "description": "Not generally available yet: answers 503 `gbp_feature_disabled` before anything else is checked. Send `location` (a Google Location object) or the friendly fields of location info, plus `language_code`. `title`, `primary_category` and `language_code` are required. Needs `confirm: true` (not with `dry_run`). `request_id` comes back in every answer: on 502 `google_result_unknown` repeat with the same `request_id` and Google never creates it twice. Search first with google-locations/search. Daily creation limits: 429 `daily_limit_reached` / `google_daily_quota_exhausted`.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "account": {
                    "type": "string",
                    "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected."
                  },
                  "location": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Google Location object (instead of the friendly fields)."
                  },
                  "language_code": {
                    "type": "string",
                    "description": "BCP 47; cannot be changed later."
                  },
                  "title": {
                    "type": "string"
                  },
                  "primary_category": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string",
                    "description": "Up to 50 letters, digits, `-` or `_`. Generated if missing.",
                    "maxLength": 50
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Validate and return what would be sent, without applying it."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (`true`) for a real creation."
                  }
                },
                "required": [
                  "user",
                  "language_code"
                ]
              }
            }
          },
          "description": "Also accepts every friendly field of PATCH /location-info (description, phone, address, hours...)."
        },
        "responses": {
          "200": {
            "description": "Location created (or validated).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "string"
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "location": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's new Location."
                    },
                    "location_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_account`, `account_required`, `invalid_json`, `invalid_field`, `invalid_request_id`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_daily_quota_exhausted`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `gbp_quota_guard_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/locations/delete": {
      "delete": {
        "operationId": "deleteGoogleBusinessLocation",
        "summary": "Delete a location",
        "description": "Not generally available yet: answers 503 `gbp_feature_disabled` before anything else is checked. Irreversible. Needs `confirm: true`. If Google does not allow deleting it through the API: 409 `location_cannot_be_deleted` (delete it from business.google.com).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "location_id",
                  "confirm"
                ]
              },
              "example": {
                "user": "agent-paris",
                "location_id": "locations/111",
                "confirm": true
              }
            }
          },
          "description": "JSON body (the query string is read when there is no JSON body)."
        },
        "responses": {
          "200": {
            "description": "Location deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. `error_code`: `location_cannot_be_deleted`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      },
      "post": {
        "operationId": "deleteGoogleBusinessLocationPost",
        "summary": "Delete a location (POST)",
        "description": "Not generally available yet: answers 503 `gbp_feature_disabled` before anything else is checked. Irreversible. Needs `confirm: true`. If Google does not allow deleting it through the API: 409 `location_cannot_be_deleted` (delete it from business.google.com). Same as DELETE; use DELETE.",
        "tags": [
          "Google Business"
        ],
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "location_id",
                  "confirm"
                ]
              },
              "example": {
                "user": "agent-paris",
                "location_id": "locations/111",
                "confirm": true
              }
            }
          },
          "description": "JSON body (the query string is read when there is no JSON body)."
        },
        "responses": {
          "200": {
            "description": "Location deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. `error_code`: `location_cannot_be_deleted`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/lodging": {
      "get": {
        "operationId": "getGoogleBusinessLodging",
        "summary": "Get lodging data",
        "description": "Hotel data in Google's Lodging format (camelCase): property, policies, pools, rooms, accessibility... Only for locations Google treats as lodging.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "read_mask",
            "in": "query",
            "description": "Lodging fields, e.g. `pools,policies`. Default `*`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lodging.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "lodging": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Lodging object."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_read_mask`, `lodging_not_supported`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `lodging_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateGoogleBusinessLodging",
        "summary": "Update lodging data",
        "description": "Changes only the fields you send (empty values change nothing; `null` clears a field; lists are replaced whole). `metadata.updateTime` is set to now unless you send it. Needs `confirm: true` (not with `dry_run`). Counts as one edit toward Google's 10 per minute per location.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "lodging": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Only the fields to change, in Google's Lodging format."
                  },
                  "update_mask": {
                    "type": "string",
                    "description": "Explicit field paths (`pools.pool,policies`). Default: built from `lodging`. `*` is not accepted."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (`true`) unless `dry_run`."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Check eligibility and return what would be sent, without calling Google."
                  }
                },
                "required": [
                  "user",
                  "lodging"
                ]
              },
              "example": {
                "user": "hotel-sol",
                "lodging": {
                  "pools": {
                    "pool": true
                  },
                  "policies": {
                    "checkinTime": {
                      "hours": 15
                    }
                  }
                },
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lodging updated (or the dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "update_mask": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "lodging": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's answer."
                    },
                    "google_validated": {
                      "type": "boolean",
                      "description": "Dry run only."
                    },
                    "would_send": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Dry run only."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_json`, `invalid_lodging`, `invalid_field`, `invalid_update_mask`, `no_fields`, `confirmation_required`, `lodging_not_supported`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `lodging_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `location_edit_rate_limited`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/lodging/google-updated": {
      "get": {
        "operationId": "getGoogleBusinessGoogleUpdatedLodging",
        "summary": "Get lodging data as customers see it",
        "description": "The lodging data after Google's changes, with `diff_mask` listing what Google changed.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "read_mask",
            "in": "query",
            "description": "Lodging fields. Default `*`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Google's version.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "lodging": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Lodging."
                    },
                    "diff_mask": {
                      "type": "string"
                    },
                    "has_google_updates": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_read_mask`, `lodging_not_supported`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `lodging_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/media": {
      "get": {
        "operationId": "listGoogleBusinessMedia",
        "summary": "List gallery media",
        "description": "Photos and videos of the location's gallery (Google's MediaItem objects unchanged). `api_upload_limit`: Google accepts at most 100 media items per location added through the API.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-2500 (default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2500
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gallery page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "media_items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's MediaItem objects."
                    },
                    "total_media_item_count": {
                      "type": "integer"
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "api_upload_limit": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_page_size`, `invalid_page_token`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "uploadGoogleBusinessMedia",
        "summary": "Upload a photo or video",
        "description": "Adds a photo or video to the gallery, either as a file (multipart) or from a public URL (JSON). Photos other than `PROFILE` and `COVER` must be at least 250 px on the short edge and 10 KB (400 `MEDIA_TOO_SMALL`). If Google does not confirm the upload (504 `media_outcome_unknown`), it is not retried: list the gallery before uploading again. 502 `google_unreachable` means it never reached Google and is safe to retry.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "file"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "category": {
                    "type": "string",
                    "description": "Default `ADDITIONAL`. `LOGO` is deprecated by Google and sent as `PROFILE`.",
                    "enum": [
                      "COVER",
                      "PROFILE",
                      "EXTERIOR",
                      "INTERIOR",
                      "PRODUCT",
                      "AT_WORK",
                      "FOOD_AND_DRINK",
                      "MENU",
                      "COMMON_AREA",
                      "ROOMS",
                      "TEAMS",
                      "ADDITIONAL",
                      "LOGO"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 1000 characters. Not allowed on `COVER`; cannot be changed later.",
                    "maxLength": 1000
                  },
                  "media_format": {
                    "type": "string",
                    "description": "Guessed from the file type or the URL extension.",
                    "enum": [
                      "PHOTO",
                      "VIDEO"
                    ]
                  },
                  "file": {
                    "type": "string",
                    "description": "JPG or PNG up to 5 MB, or a video (MP4, MOV...).",
                    "format": "binary"
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "source_url"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "category": {
                    "type": "string",
                    "description": "Default `ADDITIONAL`. `LOGO` is deprecated by Google and sent as `PROFILE`.",
                    "enum": [
                      "COVER",
                      "PROFILE",
                      "EXTERIOR",
                      "INTERIOR",
                      "PRODUCT",
                      "AT_WORK",
                      "FOOD_AND_DRINK",
                      "MENU",
                      "COMMON_AREA",
                      "ROOMS",
                      "TEAMS",
                      "ADDITIONAL",
                      "LOGO"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 1000 characters. Not allowed on `COVER`; cannot be changed later.",
                    "maxLength": 1000
                  },
                  "media_format": {
                    "type": "string",
                    "description": "Guessed from the file type or the URL extension.",
                    "enum": [
                      "PHOTO",
                      "VIDEO"
                    ]
                  },
                  "source_url": {
                    "type": "string",
                    "description": "Public http(s) URL Google downloads the media from."
                  }
                }
              },
              "example": {
                "user": "my-profile",
                "source_url": "https://example.com/front.jpg",
                "category": "EXTERIOR"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "media_name": {
                      "type": "string"
                    },
                    "media_item": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's MediaItem."
                    },
                    "upload_method": {
                      "type": "string",
                      "enum": [
                        "bytes",
                        "url"
                      ]
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `media_source_required`, `invalid_media_source`, `invalid_source_url`, `invalid_media_category`, `invalid_media_format`, `invalid_media_file`, `invalid_description`, `MEDIA_TOO_SMALL`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "409": {
            "description": "Google refused the upload: the location already has the 100 items the API can add. `error_code`: `MEDIA_LIMIT_REACHED`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "413": {
            "description": "Payload too large. `error_code`: `MEDIA_TOO_LARGE`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `media_upload_busy`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "504": {
            "description": "Google did not confirm the result. `error_code`: `media_outcome_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateGoogleBusinessMedia",
        "summary": "Change a media item's category",
        "description": "Only the category can change: Google does not allow editing the description, the format or the source (400 `media_field_not_editable`).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "media_name": {
                    "type": "string",
                    "description": "`accounts/.../locations/.../media/{key}` (alias `name`)."
                  },
                  "media_key": {
                    "type": "string",
                    "description": "Media key, with `location_id`."
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "COVER",
                      "PROFILE",
                      "EXTERIOR",
                      "INTERIOR",
                      "PRODUCT",
                      "AT_WORK",
                      "FOOD_AND_DRINK",
                      "MENU",
                      "COMMON_AREA",
                      "ROOMS",
                      "TEAMS",
                      "ADDITIONAL",
                      "LOGO"
                    ]
                  }
                },
                "required": [
                  "user",
                  "category"
                ]
              },
              "example": {
                "user": "my-profile",
                "media_name": "accounts/1/locations/2/media/AF1QipN",
                "category": "INTERIOR"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "media_name": {
                      "type": "string"
                    },
                    "media_item": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's MediaItem."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_media_name`, `media_name_required`, `invalid_json`, `media_field_not_editable`, `category_required`, `invalid_media_category`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `media_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteGoogleBusinessMedia",
        "summary": "Delete a media item",
        "description": "Removes the item from the public profile; it cannot be restored. Needs `confirm: true` (checked before anything else).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "media_name": {
                    "type": "string",
                    "description": "`accounts/.../locations/.../media/{key}` (alias `name`)."
                  },
                  "media_key": {
                    "type": "string",
                    "description": "Media key, with `location_id`."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "confirm"
                ]
              },
              "example": {
                "user": "my-profile",
                "media_name": "accounts/1/locations/2/media/AF1QipN",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "media_name": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_media_name`, `media_name_required`, `invalid_json`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `media_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/media/get": {
      "get": {
        "operationId": "getGoogleBusinessMedia",
        "summary": "Get one media item",
        "description": "One gallery item, by `media_name` or by `media_key` + `location_id`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "media_name",
            "in": "query",
            "description": "`accounts/.../locations/.../media/{key}`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "media_key",
            "in": "query",
            "description": "Media key (with `location_id`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "media_name": {
                      "type": "string"
                    },
                    "media_item": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's MediaItem."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_media_name`, `media_name_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `media_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/media/customers": {
      "get": {
        "operationId": "listGoogleBusinessCustomerMedia",
        "summary": "List customer photos",
        "description": "Photos Google Maps users added to the location. Each item carries an `attribution` (contributor name, photo, links): Google requires showing it exactly as provided. Customer photos cannot be deleted through the API; `attribution.takedownUrl` is where an inappropriate one can be reported.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-200 (default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer media page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "media_items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's MediaItem objects with `attribution`."
                    },
                    "total_media_item_count": {
                      "type": "integer"
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "attribution_notice": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_page_size`, `invalid_page_token`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/media/customers/get": {
      "get": {
        "operationId": "getGoogleBusinessCustomerMedia",
        "summary": "Get one customer photo",
        "description": "One customer media item, by `media_name` (`accounts/.../media/customers/{key}`) or `media_key` + `location_id`. Each item carries an `attribution` (contributor name, photo, links): Google requires showing it exactly as provided. Customer photos cannot be deleted through the API; `attribution.takedownUrl` is where an inappropriate one can be reported.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "media_name",
            "in": "query",
            "description": "`accounts/.../locations/.../media/customers/{key}`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "media_key",
            "in": "query",
            "description": "Media key (with `location_id`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "media_name": {
                      "type": "string"
                    },
                    "media_item": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's MediaItem."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_media_name`, `media_name_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `media_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/notifications": {
      "get": {
        "operationId": "getGoogleBusinessNotificationSettings",
        "summary": "Get real-time notification settings",
        "description": "Not generally available yet: answers 503 `gbp_notifications_unavailable` and no Google Business event is sent to webhooks. Google keeps one notification setting per Google account; when another tool owns it, `other_tool_configured` is `true`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "account",
            "in": "query",
            "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The setting.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "string"
                    },
                    "notification_setting": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's NotificationSetting (`name`, `notificationTypes`, `pubsubTopic`)."
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "managed_by_upload_post": {
                      "type": "boolean"
                    },
                    "other_tool_configured": {
                      "type": "boolean"
                    },
                    "available_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "webhook_events": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Google notification type -> webhook event."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_account`, `account_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `gbp_notifications_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      },
      "put": {
        "operationId": "updateGoogleBusinessNotificationSettings",
        "summary": "Turn real-time notifications on or off",
        "description": "Not generally available yet: answers 503 `gbp_notifications_unavailable` and no Google Business event is sent to webhooks. Turns notifications on or off for the Google account; webhooks must also list the events (`review_received`, `review_updated`, `customer_media_received`, `listing_google_update`, `listing_duplicate`, `listing_control_changed`) in `webhook_events`. Needs `confirm: true`. If Google does not confirm the change (`outcome_unknown: true`), read the setting before retrying.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "account": {
                    "type": "string",
                    "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "`true` (default) or `false`."
                  },
                  "types": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "GOOGLE_UPDATE",
                        "NEW_REVIEW",
                        "UPDATED_REVIEW",
                        "NEW_CUSTOMER_MEDIA",
                        "DUPLICATE_LOCATION",
                        "VOICE_OF_MERCHANT_UPDATED"
                      ]
                    },
                    "description": "Types to receive (alias `notification_types`). Default: all six."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`: this replaces any other tool's setting for this Google account."
                  },
                  "force": {
                    "type": "boolean",
                    "description": "`true` to replace a setting that belongs to another tool."
                  },
                  "confirm_other_tool": {
                    "type": "boolean",
                    "description": "With `enabled: false` and `force: true` on another tool's setting: switch that tool's notifications off too."
                  }
                },
                "required": [
                  "user",
                  "confirm"
                ]
              },
              "example": {
                "user": "my-profile",
                "types": [
                  "NEW_REVIEW",
                  "UPDATED_REVIEW"
                ],
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The setting after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "string"
                    },
                    "notification_setting": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's NotificationSetting (`name`, `notificationTypes`, `pubsubTopic`)."
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "managed_by_upload_post": {
                      "type": "boolean"
                    },
                    "other_tool_configured": {
                      "type": "boolean"
                    },
                    "available_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "webhook_events": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Google notification type -> webhook event."
                    },
                    "changed": {
                      "type": "boolean"
                    },
                    "google_setting_kept": {
                      "type": "boolean"
                    },
                    "webhook_events_to_subscribe": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "notice": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_account`, `account_required`, `confirmation_required`, `invalid_notification_type`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "409": {
            "description": "Another tool receives this Google account's notifications; send `\"force\": true` to replace it. `error_code`: `NOTIFICATION_SETTING_IN_USE`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `gbp_notifications_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      },
      "patch": {
        "operationId": "updateGoogleBusinessNotificationSettingsPatch",
        "summary": "Turn real-time notifications on or off (PATCH)",
        "description": "Alias of PUT on the same path (same handler); prefer PUT.\n\nNot generally available yet: answers 503 `gbp_notifications_unavailable` and no Google Business event is sent to webhooks. Turns notifications on or off for the Google account; webhooks must also list the events (`review_received`, `review_updated`, `customer_media_received`, `listing_google_update`, `listing_duplicate`, `listing_control_changed`) in `webhook_events`. Needs `confirm: true`. If Google does not confirm the change (`outcome_unknown: true`), read the setting before retrying. Same as PUT.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "account": {
                    "type": "string",
                    "description": "Google account, `accounts/{id}` or a bare id. Default: the account saved when Google Business was connected."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "`true` (default) or `false`."
                  },
                  "types": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "GOOGLE_UPDATE",
                        "NEW_REVIEW",
                        "UPDATED_REVIEW",
                        "NEW_CUSTOMER_MEDIA",
                        "DUPLICATE_LOCATION",
                        "VOICE_OF_MERCHANT_UPDATED"
                      ]
                    },
                    "description": "Types to receive (alias `notification_types`). Default: all six."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`: this replaces any other tool's setting for this Google account."
                  },
                  "force": {
                    "type": "boolean",
                    "description": "`true` to replace a setting that belongs to another tool."
                  },
                  "confirm_other_tool": {
                    "type": "boolean",
                    "description": "With `enabled: false` and `force: true` on another tool's setting: switch that tool's notifications off too."
                  }
                },
                "required": [
                  "user",
                  "confirm"
                ]
              },
              "example": {
                "user": "my-profile",
                "types": [
                  "NEW_REVIEW",
                  "UPDATED_REVIEW"
                ],
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The setting after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "string"
                    },
                    "notification_setting": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's NotificationSetting (`name`, `notificationTypes`, `pubsubTopic`)."
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "managed_by_upload_post": {
                      "type": "boolean"
                    },
                    "other_tool_configured": {
                      "type": "boolean"
                    },
                    "available_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "webhook_events": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Google notification type -> webhook event."
                    },
                    "changed": {
                      "type": "boolean"
                    },
                    "google_setting_kept": {
                      "type": "boolean"
                    },
                    "webhook_events_to_subscribe": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "notice": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_account`, `account_required`, `confirmation_required`, `invalid_notification_type`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "409": {
            "description": "Another tool receives this Google account's notifications; send `\"force\": true` to replace it. `error_code`: `NOTIFICATION_SETTING_IN_USE`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `gbp_notifications_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available",
        "deprecated": true
      }
    },
    "/uploadposts/google-business/performance": {
      "get": {
        "operationId": "getGoogleBusinessPerformance",
        "summary": "Get daily performance metrics",
        "description": "Daily metrics of the location for any range (impressions, calls, website clicks, directions, messaging, menu clicks, bookings). Google publishes them several days late (recent days are often 0). One call returns at most 6 calendar months: continue with `start_date=<next_start_date>`. The location must belong to the connected account (404 `location_not_found`). Metrics: `BUSINESS_IMPRESSIONS_DESKTOP_MAPS`, `BUSINESS_IMPRESSIONS_DESKTOP_SEARCH`, `BUSINESS_IMPRESSIONS_MOBILE_MAPS`, `BUSINESS_IMPRESSIONS_MOBILE_SEARCH`, `CALL_CLICKS`, `WEBSITE_CLICKS`, `BUSINESS_DIRECTION_REQUESTS`, `MESSAGING_CLICKS`, `BUSINESS_FOOD_MENU_CLICKS`, `BUSINESS_BOOKINGS`, `BUSINESS_FOOD_ORDERS` (short aliases such as `call_clicks` accepted; `BUSINESS_FOOD_ORDERS` is deprecated by Google; `BUSINESS_CONVERSATIONS` was retired: 400 `metric_retired`).",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "metrics",
            "in": "query",
            "description": "Comma-separated metrics (alias `metric`). Default: all.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "`YYYY-MM-DD`. Default: 29 days before `end_date`. At most 18 months back.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "`YYYY-MM-DD`. Default: today (UTC). Not in the future.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "day_of_week",
            "in": "query",
            "description": "Breakdown by weekday; needs exactly one metric.",
            "schema": {
              "type": "string",
              "enum": [
                "MONDAY",
                "TUESDAY",
                "WEDNESDAY",
                "THURSDAY",
                "FRIDAY",
                "SATURDAY",
                "SUNDAY"
              ]
            }
          },
          {
            "name": "time_of_day",
            "in": "query",
            "description": "Breakdown by hour 0-23; needs exactly one metric. Not with `day_of_week`.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 23
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Daily series.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "next_start_date": {
                      "type": "string",
                      "nullable": true
                    },
                    "metrics": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "series": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "value": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "totals": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer"
                      }
                    },
                    "multiDailyMetricTimeSeries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's object, unchanged."
                    },
                    "breakdown": {
                      "type": "string",
                      "description": "With `day_of_week` / `time_of_day`."
                    },
                    "dailySubEntityType": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "With a breakdown."
                    },
                    "timeSeries": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "With a breakdown."
                    },
                    "data_note": {
                      "type": "string"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `location_required`, `invalid_location_id`, `user_required`, `google_business_not_connected`, `invalid_metric`, `metric_retired`, `invalid_date_range`, `invalid_breakdown`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `location_not_found`, `profile_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `location_check_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/performance/keywords": {
      "get": {
        "operationId": "getGoogleBusinessSearchKeywords",
        "summary": "Get search keywords",
        "description": "Search terms people used on Google Search or Maps before seeing the profile, with unique users added up over the months of the range. Google hides small numbers: those rows carry `threshold` instead of `impressions`. Up to 1,000 keywords per location and range; `truncated: true` means Google had more.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_month",
            "in": "query",
            "description": "`YYYY-MM`. Default: the month of 29 days ago. At most 18 months back.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_month",
            "in": "query",
            "description": "`YYYY-MM`. Default: the current month.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-100 (default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Keywords page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "start_month": {
                      "type": "string"
                    },
                    "end_month": {
                      "type": "string"
                    },
                    "keywords": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "search_keyword": {
                            "type": "string"
                          },
                          "impressions": {
                            "type": "string",
                            "nullable": true
                          },
                          "threshold": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "searchKeywordsCounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's objects, unchanged."
                    },
                    "total_keywords": {
                      "type": "integer"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `location_required`, `invalid_location_id`, `user_required`, `google_business_not_connected`, `invalid_month_range`, `invalid_page_size`, `invalid_page_token`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `location_not_found`, `profile_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `location_check_unavailable`, `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/place-actions/types": {
      "get": {
        "operationId": "listGoogleBusinessPlaceActionTypes",
        "summary": "List booking and ordering link types",
        "description": "Link types the location can use (`user` + `location_id`), or the types of a country (`region_code`, cached 24 h). Each item has `placeActionType` and `displayName`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username (required unless `region_code`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region_code",
            "in": "query",
            "description": "Country code: types of a country instead of a location.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language_code",
            "in": "query",
            "description": "Language of `displayName`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-100 (default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Types.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "types": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's PlaceActionTypeMetadata."
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_page_size`, `invalid_page_token`, `invalid_region_code`, `invalid_language_code`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/place-actions": {
      "get": {
        "operationId": "listGoogleBusinessPlaceActions",
        "summary": "List booking and ordering links",
        "description": "The buttons on the listing (book, order, delivery, takeout, appointments, online shop). Each link has `name`, `placeActionType`, `uri`, `isPreferred`, `isDisabled`, `providerType` and `isEditable`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter by type.",
            "schema": {
              "type": "string",
              "enum": [
                "APPOINTMENT",
                "ONLINE_APPOINTMENT",
                "DINING_RESERVATION",
                "FOOD_ORDERING",
                "FOOD_DELIVERY",
                "FOOD_TAKEOUT",
                "SHOP_ONLINE",
                "SOLOPRENEUR_APPOINTMENT"
              ]
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-100 (default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Links.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's PlaceActionLink objects."
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_place_action_type`, `invalid_page_size`, `invalid_page_token`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createGoogleBusinessPlaceAction",
        "summary": "Create a booking or ordering link",
        "description": "Google allows one link per URL and type on each location, and one preferred link per type (a new preferred one removes the flag from the previous one). `dry_run: true` validates without calling Google. On 502 `google_result_unknown`, list the links before creating it again.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "type": {
                    "type": "string",
                    "description": "Alias `place_action_type`.",
                    "enum": [
                      "APPOINTMENT",
                      "ONLINE_APPOINTMENT",
                      "DINING_RESERVATION",
                      "FOOD_ORDERING",
                      "FOOD_DELIVERY",
                      "FOOD_TAKEOUT",
                      "SHOP_ONLINE",
                      "SOLOPRENEUR_APPOINTMENT"
                    ]
                  },
                  "uri": {
                    "type": "string",
                    "description": "http(s) URL of the action."
                  },
                  "is_preferred": {
                    "type": "boolean"
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Validate and return what would be sent, without applying it."
                  }
                },
                "required": [
                  "user",
                  "type",
                  "uri"
                ]
              },
              "example": {
                "user": "restaurante-sol",
                "type": "DINING_RESERVATION",
                "uri": "https://book.example/sol",
                "is_preferred": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link created (or the dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "link": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's new PlaceActionLink."
                    },
                    "google_validated": {
                      "type": "boolean",
                      "description": "Dry run only."
                    },
                    "would_send": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Dry run only."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_json`, `invalid_place_action_type`, `invalid_uri`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateGoogleBusinessPlaceAction",
        "summary": "Edit or switch off a link",
        "description": "Changes only the fields you send. Partner links (`isEditable: false`) can only change `is_disabled` (400 `link_not_editable`).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "link": {
                    "type": "string",
                    "description": "`locations/{l}/placeActionLinks/{id}`."
                  },
                  "uri": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "description": "Alias `place_action_type`.",
                    "enum": [
                      "APPOINTMENT",
                      "ONLINE_APPOINTMENT",
                      "DINING_RESERVATION",
                      "FOOD_ORDERING",
                      "FOOD_DELIVERY",
                      "FOOD_TAKEOUT",
                      "SHOP_ONLINE",
                      "SOLOPRENEUR_APPOINTMENT"
                    ]
                  },
                  "is_preferred": {
                    "type": "boolean"
                  },
                  "is_disabled": {
                    "type": "boolean"
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Validate and return what would be sent, without applying it."
                  }
                },
                "required": [
                  "user",
                  "link"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link updated (or the dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "update_mask": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "link": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's PlaceActionLink."
                    },
                    "link_name": {
                      "type": "string",
                      "description": "Dry run only."
                    },
                    "google_validated": {
                      "type": "boolean",
                      "description": "Dry run only."
                    },
                    "would_send": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Dry run only."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_json`, `invalid_link`, `invalid_uri`, `invalid_place_action_type`, `no_fields`, `link_not_editable`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `link_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteGoogleBusinessPlaceAction",
        "summary": "Delete a booking or ordering link",
        "description": "Deletes a link. Needs `confirm: true`. JSON body (the query string is read when there is no JSON body).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "link": {
                    "type": "string",
                    "description": "`locations/{l}/placeActionLinks/{id}`."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "link",
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "link_name": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_link`, `confirmation_required`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `link_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/place-actions/get": {
      "get": {
        "operationId": "getGoogleBusinessPlaceAction",
        "summary": "Get a booking or ordering link",
        "description": "One link.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "link",
            "in": "query",
            "description": "`locations/{l}/placeActionLinks/{id}`.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "link": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's PlaceActionLink."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_link`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `link_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/posts": {
      "get": {
        "operationId": "listGoogleBusinessPosts",
        "summary": "List posts",
        "description": "The location's posts (Updates tab), Google's LocalPost objects with their current `state` (`PROCESSING`, `LIVE`, `SCHEDULED`, `RECURRING`, `REJECTED`). Posts are created with the upload endpoints (`platform[]=google_business`).",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-100 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Posts page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "account": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's LocalPost objects."
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `invalid_page_size`, `invalid_page_token`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_daily_quota_exhausted`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/posts/get": {
      "get": {
        "operationId": "getGoogleBusinessPost",
        "summary": "Get a post",
        "description": "One post with its current `state`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "post_id",
            "in": "query",
            "description": "Full post name: `accounts/{a}/locations/{l}/localPosts/{p}` (alias `post_name`).",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The post.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "post_id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "PROCESSING",
                        "LIVE",
                        "SCHEDULED",
                        "RECURRING",
                        "REJECTED"
                      ]
                    },
                    "post": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's LocalPost."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_post_id`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `post_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_daily_quota_exhausted`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/reviews": {
      "get": {
        "operationId": "listGoogleBusinessReviews",
        "summary": "List reviews",
        "description": "Reviews of the location with `averageRating` and `totalReviewCount`. Only verified locations have reviews. Google's own errors keep Google's HTTP status (e.g. 409, 412, 500, 503) with details in `google_error`. Some validation errors carry only `error`, without `error_code`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "`locations/{id}`, bare id or full path. Default: the account's selected location.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "Reviews per page, max 50. Alias `pageSize`.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`nextPageToken` of the previous answer. Alias `pageToken`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "description": "`updateTime desc` (default), `rating` or `rating desc`; shortcuts `newest`, `lowest`, `highest`. Alias `orderBy`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reviews page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "reviews": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Review objects (`name` is the path used to reply)."
                    },
                    "averageRating": {
                      "type": "number"
                    },
                    "totalReviewCount": {
                      "type": "integer"
                    },
                    "nextPageToken": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `invalid_location_id`, `google_validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Profile or Google Business connection not found answers without `error_code`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/reviews/batch": {
      "get": {
        "operationId": "batchGetGoogleBusinessReviews",
        "summary": "Batch get reviews",
        "description": "Reviews of several locations in one call (`locations:batchGetReviews`). Locations of several Google accounts are fetched with one call per account; `nextPageToken` (starting with `up1:`) carries every account's cursor: pass it back unchanged. Google's own errors keep Google's HTTP status (e.g. 409, 412, 500, 503) with details in `google_error`. Some validation errors carry only `error`, without `error_code`.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_ids",
            "in": "query",
            "description": "Comma-separated list or JSON array (bare ids, `locations/{id}` or full paths). Default: the account's selected location.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-50 (alias `pageSize`).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "Cursor from `nextPageToken` (alias `pageToken`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "description": "`updateTime desc` (default), `rating` or `rating desc`; shortcuts `newest`, `lowest`, `highest`. Alias `orderBy`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ignoreRatingOnlyReviews",
            "in": "query",
            "description": "`true` skips reviews without text (deprecated by Google).",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reviews.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Full paths used."
                    },
                    "locationReviews": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Each item carries its location and the review."
                    },
                    "nextPageToken": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `invalid_location_id`, `google_validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Profile or Google Business connection not found answers without `error_code`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "batchGetGoogleBusinessReviewsPost",
        "summary": "Batch get reviews (JSON body)",
        "description": "Alias of GET on the same path (same handler); prefer GET.\n\nReviews of several locations in one call (`locations:batchGetReviews`). Locations of several Google accounts are fetched with one call per account; `nextPageToken` (starting with `up1:`) carries every account's cursor: pass it back unchanged. Google's own errors keep Google's HTTP status (e.g. 409, 412, 500, 503) with details in `google_error`. Some validation errors carry only `error`, without `error_code`. Same as GET, with a JSON body.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_ids": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Comma-separated list or JSON array (bare ids, `locations/{id}` or full paths). Default: the account's selected location."
                  },
                  "page_size": {
                    "type": "integer",
                    "description": "1-50 (alias `pageSize`).",
                    "minimum": 1,
                    "maximum": 50
                  },
                  "page_token": {
                    "type": "string",
                    "description": "Cursor from `nextPageToken` (alias `pageToken`)."
                  },
                  "order_by": {
                    "type": "string",
                    "description": "`updateTime desc` (default), `rating` or `rating desc`; shortcuts `newest`, `lowest`, `highest`. Alias `orderBy`."
                  },
                  "ignoreRatingOnlyReviews": {
                    "type": "boolean",
                    "description": "`true` skips reviews without text (deprecated by Google)."
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reviews.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Full paths used."
                    },
                    "locationReviews": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Each item carries its location and the review."
                    },
                    "nextPageToken": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `invalid_location_id`, `google_validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Profile or Google Business connection not found answers without `error_code`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "deprecated": true
      }
    },
    "/uploadposts/google-business/reviews/get": {
      "get": {
        "operationId": "getGoogleBusinessReview",
        "summary": "Get a review",
        "description": "One review with its reply; use it to check a reply's moderation state or a reply that timed out. Counts toward a daily limit of reads per account (429 `daily_limit_reached`).",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "review_name",
            "in": "query",
            "description": "`accounts/.../locations/.../reviews/{id}` (one of `review_name` / `review_id`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "review_id",
            "in": "query",
            "description": "Review id, with `location_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location of `review_id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The review.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "review_name": {
                      "type": "string"
                    },
                    "review": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Review."
                    },
                    "reviewReplyState": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "APPROVED",
                        "REJECTED"
                      ]
                    },
                    "policyViolation": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `invalid_review_name`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `review_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/reviews/reply": {
      "put": {
        "operationId": "replyToGoogleBusinessReview",
        "summary": "Reply to a review",
        "description": "Creates the owner reply, or replaces it (Google keeps one reply per review). Provide `review_name` or `review_id` + `location_id`. Never resent blindly: if Google does not answer, the review is read once; if the reply is there the answer is 200 with `verified_after_timeout: true`, otherwise 504 `reply_outcome_unknown`. 502 `google_unreachable` means it never reached Google and is safe to resend.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "comment": {
                    "type": "string",
                    "description": "Public reply, at most 4096 bytes in UTF-8. Blank text is refused."
                  },
                  "review_name": {
                    "type": "string",
                    "description": "`accounts/.../locations/.../reviews/{id}` (preferred)."
                  },
                  "review_id": {
                    "type": "string",
                    "description": "Review id, with `location_id`."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location of `review_id`."
                  }
                },
                "required": [
                  "user",
                  "comment"
                ]
              },
              "example": {
                "user": "my-profile",
                "review_name": "accounts/123456789/locations/222222222/reviews/AbcDef",
                "comment": "Thank you for the kind words!"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reply published or updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "review_name": {
                      "type": "string"
                    },
                    "reply": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The reply as Google returns it."
                    },
                    "reviewReplyState": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "APPROVED",
                        "REJECTED"
                      ]
                    },
                    "policyViolation": {
                      "type": "string",
                      "description": "Only when `REJECTED`."
                    },
                    "verified_after_timeout": {
                      "type": "boolean",
                      "description": "Google did not answer in time and the reply was confirmed by reading the review back."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `invalid_json`, `missing_comment`, `invalid_comment`, `REPLY_TOO_LONG`, `invalid_review_name`, `invalid_location_id`, `google_validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `review_not_found`. Profile or Google Business connection not found answers without `error_code`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "504": {
            "description": "Google did not confirm the reply: check with GET /reviews/get before sending it again. A Google 5xx carries `outcome_unknown: true`. `error_code`: `reply_outcome_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "replyToGoogleBusinessReviewPost",
        "summary": "Reply to a review (POST)",
        "description": "Creates the owner reply, or replaces it (Google keeps one reply per review). Provide `review_name` or `review_id` + `location_id`. Never resent blindly: if Google does not answer, the review is read once; if the reply is there the answer is 200 with `verified_after_timeout: true`, otherwise 504 `reply_outcome_unknown`. 502 `google_unreachable` means it never reached Google and is safe to resend. Same as PUT; use PUT.",
        "tags": [
          "Google Business"
        ],
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "comment": {
                    "type": "string",
                    "description": "Public reply, at most 4096 bytes in UTF-8. Blank text is refused."
                  },
                  "review_name": {
                    "type": "string",
                    "description": "`accounts/.../locations/.../reviews/{id}` (preferred)."
                  },
                  "review_id": {
                    "type": "string",
                    "description": "Review id, with `location_id`."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location of `review_id`."
                  }
                },
                "required": [
                  "user",
                  "comment"
                ]
              },
              "example": {
                "user": "my-profile",
                "review_name": "accounts/123456789/locations/222222222/reviews/AbcDef",
                "comment": "Thank you for the kind words!"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reply published or updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "review_name": {
                      "type": "string"
                    },
                    "reply": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The reply as Google returns it."
                    },
                    "reviewReplyState": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "APPROVED",
                        "REJECTED"
                      ]
                    },
                    "policyViolation": {
                      "type": "string",
                      "description": "Only when `REJECTED`."
                    },
                    "verified_after_timeout": {
                      "type": "boolean",
                      "description": "Google did not answer in time and the reply was confirmed by reading the review back."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `invalid_json`, `missing_comment`, `invalid_comment`, `REPLY_TOO_LONG`, `invalid_review_name`, `invalid_location_id`, `google_validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `review_not_found`. Profile or Google Business connection not found answers without `error_code`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "504": {
            "description": "Google did not confirm the reply: check with GET /reviews/get before sending it again. A Google 5xx carries `outcome_unknown: true`. `error_code`: `reply_outcome_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteGoogleBusinessReviewReply",
        "summary": "Delete a review reply",
        "description": "Deletes the owner reply. Same identifiers as the reply, in the JSON body or the query string.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username (or in the body).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "review_name",
            "in": "query",
            "description": "Review path (or in the body).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "review_id",
            "in": "query",
            "description": "Review id, with `location_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location of `review_id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "review_name": {
                    "type": "string"
                  },
                  "review_id": {
                    "type": "string"
                  },
                  "location_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reply deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "review_name": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `invalid_review_name`, `invalid_location_id`, `google_validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `review_not_found`. Profile or Google Business connection not found answers without `error_code`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/food-menus": {
      "get": {
        "operationId": "getGoogleBusinessFoodMenus",
        "summary": "Get food menus",
        "description": "The location's food menus in Google's FoodMenu format.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "read_mask",
            "in": "query",
            "description": "e.g. `menus`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Menus.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "menus": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's FoodMenu objects."
                    },
                    "food_menus": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's FoodMenus object."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `account_required`, `invalid_read_mask`, `food_menus_not_supported`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "replaceGoogleBusinessFoodMenus",
        "summary": "Replace food menus",
        "description": "Replaces the whole list: anything left out is removed. Read it with GET first. `\"menus\": null` removes every menu; `[]` changes nothing. Dish photos go in each item's `attributes.mediaKeys` (up to 200 in total, from the gallery). Needs `confirm: true` (not with `dry_run`). Only locations Google allows to have menus (400 `food_menus_not_supported`).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "menus": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "description": "Complete list in Google's FoodMenu format."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (`true`) unless `dry_run`."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Check eligibility and the request without sending it."
                  }
                },
                "required": [
                  "user",
                  "menus"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Menus replaced (or the dry run).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "menus": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Menus."
                    },
                    "food_menus": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's answer."
                    },
                    "google_validated": {
                      "type": "boolean",
                      "description": "Dry run only."
                    },
                    "photos": {
                      "type": "integer",
                      "description": "Dry run only: photos referenced."
                    },
                    "would_send": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Dry run only."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `account_required`, `invalid_json`, `no_fields`, `invalid_menus`, `too_many_menu_photos`, `confirmation_required`, `food_menus_not_supported`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `location_edit_rate_limited`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/services": {
      "get": {
        "operationId": "getGoogleBusinessServices",
        "summary": "Get services",
        "description": "The location's services (`service_items`) and whether the list can be changed.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api",
            "in": "query",
            "description": "`v1` (default) or `v4` (Google's older service list format).",
            "schema": {
              "type": "string",
              "enum": [
                "v1",
                "v4"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Services.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "api": {
                      "type": "string"
                    },
                    "service_items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Service items."
                    },
                    "can_modify_service_list": {
                      "type": "boolean",
                      "description": "v1 only."
                    },
                    "service_list": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "v4 only: Google's ServiceList."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `account_required`, `invalid_api`, `services_not_supported`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "replaceGoogleBusinessServices",
        "summary": "Replace services",
        "description": "Replaces the whole list: anything left out is removed. Each item has exactly one of `structuredServiceItem` (`serviceTypeId` from category details with `view=FULL`) or `freeFormServiceItem`, and optional `price`. `\"service_items\": null` removes every service; `[]` changes nothing. Needs `confirm: true` (not with `dry_run`). The answer includes `edit_status` (experimental).",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "service_items": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "description": "Complete list."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required (`true`) unless `dry_run`."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "Google validates the list without applying it (with `api=v4`, only checked on our side)."
                  },
                  "api": {
                    "type": "string",
                    "description": "`v1` (default) or `v4`.",
                    "enum": [
                      "v1",
                      "v4"
                    ]
                  }
                },
                "required": [
                  "user",
                  "service_items"
                ]
              },
              "example": {
                "user": "barberia-sol",
                "confirm": true,
                "service_items": [
                  {
                    "structuredServiceItem": {
                      "serviceTypeId": "job_type_id:haircut"
                    },
                    "price": {
                      "currencyCode": "EUR",
                      "units": "15"
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Services replaced (or validated).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "api": {
                      "type": "string"
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "google_validated": {
                      "type": "boolean"
                    },
                    "service_items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Service items."
                    },
                    "service_list": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "v4 only."
                    },
                    "would_send": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "v4 dry run only."
                    },
                    "edit_status": {
                      "$ref": "#/components/schemas/GbpEditStatus"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `account_required`, `invalid_json`, `invalid_api`, `no_fields`, `invalid_field`, `confirmation_required`, `services_not_supported`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `location_edit_rate_limited`, `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/verification/state": {
      "get": {
        "operationId": "getGoogleBusinessVerificationState",
        "summary": "Get the location's verification state",
        "description": "Whether the location is in good standing. `summary.status`: `ok`, `unverified`, `verification_pending`, `suspended`, `disabled`, `duplicate`, `under_review` or `unknown`; `state` is Google's VoiceOfMerchantState.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "State.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "action": {
                          "type": "string"
                        }
                      }
                    },
                    "state": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's VoiceOfMerchantState."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/verification/options": {
      "post": {
        "operationId": "fetchGoogleBusinessVerificationOptions",
        "summary": "List verification methods",
        "description": "The verification methods Google offers for the location.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "language_code": {
                    "type": "string",
                    "description": "BCP-47, default `en`. The methods depend on the language and the country."
                  },
                  "context": {
                    "type": "object",
                    "description": "Only for service-area businesses without a storefront: `{\"address\": {PostalAddress with regionCode}}`.",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "user"
                ]
              },
              "example": {
                "user": "my-shop",
                "language_code": "es"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Options.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's VerificationOption objects."
                    },
                    "response": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's whole answer."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`, `invalid_json`, `invalid_language_code`, `invalid_context`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/google-business/verification/start": {
      "post": {
        "operationId": "startGoogleBusinessVerification",
        "summary": "Start a verification",
        "description": "Not generally available yet: answers 503 `gbp_feature_disabled`. Google contacts the business (postcard, SMS, call or email), so `confirm: true` is required. 3 verifications a day per location (429 `daily_limit_reached`, `scope: location`). `AUTO` verifications are `COMPLETED` at once; the others wait for the code. On 502 `google_result_unknown`, check the list before trying again.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "ADDRESS",
                      "EMAIL",
                      "PHONE_CALL",
                      "SMS",
                      "AUTO",
                      "TRUSTED_PARTNER"
                    ]
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "`PHONE_CALL` / `SMS`: one of the numbers in the options."
                  },
                  "email_address": {
                    "type": "string",
                    "description": "`EMAIL`: one of the addresses in the options."
                  },
                  "mailer_contact": {
                    "type": "string",
                    "description": "`ADDRESS`: name the postcard is addressed to."
                  },
                  "trusted_partner_token": {
                    "type": "string",
                    "description": "Required for `TRUSTED_PARTNER`."
                  },
                  "token": {
                    "type": "string",
                    "description": "Vetted partners only. Not with the four fields above."
                  },
                  "language_code": {
                    "type": "string",
                    "description": "BCP-47, default `en`. The methods depend on the language and the country."
                  },
                  "context": {
                    "type": "object",
                    "description": "Only for service-area businesses without a storefront: `{\"address\": {PostalAddress with regionCode}}`.",
                    "additionalProperties": true
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Must be `true`."
                  }
                },
                "required": [
                  "user",
                  "method",
                  "confirm"
                ]
              },
              "example": {
                "user": "my-shop",
                "method": "SMS",
                "phone_number": "+34 600 000 000",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification started.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "verification_name": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "verification": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Verification."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`, `invalid_json`, `confirmation_required`, `invalid_verification_method`, `invalid_phone_number`, `invalid_email_address`, `invalid_mailer_contact`, `trusted_partner_token_required`, `conflicting_verification_inputs`, `invalid_language_code`, `invalid_context`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`, `gbp_quota_guard_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/verification/complete": {
      "post": {
        "operationId": "completeGoogleBusinessVerification",
        "summary": "Enter the verification code",
        "description": "Not generally available yet: answers 503 `gbp_feature_disabled`. Sends the code Google sent. 10 attempts a day per account and location (429 `daily_limit_reached`); only codes Google actually checked count. `state: COMPLETED` when Google accepts it.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  },
                  "verification_name": {
                    "type": "string",
                    "description": "`locations/{l}/verifications/{v}` (one of `verification_name` / `verification_id`)."
                  },
                  "verification_id": {
                    "type": "string",
                    "description": "Last part of the name, with `location_id`."
                  },
                  "pin": {
                    "type": "string",
                    "description": "The code Google sent."
                  }
                },
                "required": [
                  "user",
                  "pin"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification completed (or its state).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "verification_name": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "verification": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's Verification."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`, `invalid_json`, `invalid_pin`, `invalid_verification_name`, `verification_required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`, `verification_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`, `google_result_unknown`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`, `gbp_quota_guard_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/verification/token": {
      "post": {
        "operationId": "generateGoogleBusinessVerificationToken",
        "summary": "Get an instant verification token",
        "description": "Not generally available yet: answers 503 `gbp_feature_disabled`. Asks Google for an instant verification token. When Google reserves it to its vetted partners, 403 `partner_only`: use verification/start instead.",
        "tags": [
          "Google Business"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Profile username with Google Business connected (alias `profile`)."
                  },
                  "location_id": {
                    "type": "string",
                    "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`)."
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "result": {
                      "type": "string"
                    },
                    "instant_verification_token": {
                      "type": "string"
                    },
                    "response": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Google's whole answer."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`, `invalid_json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`, `partner_only`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-availability": "not_generally_available"
      }
    },
    "/uploadposts/google-business/verifications": {
      "get": {
        "operationId": "listGoogleBusinessVerifications",
        "summary": "List verifications",
        "description": "Past and pending verifications of the location.",
        "tags": [
          "Google Business"
        ],
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "Profile username with Google Business connected (alias `profile`).",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location: `locations/{id}`, a bare id or `accounts/{a}/locations/{id}`. Default: the location pinned to the profile, else the account's only location (several and none chosen = 400 `location_required` with `available_locations`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "1-100 (default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "description": "`next_page_token` of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verifications.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "location_id": {
                      "type": "string"
                    },
                    "verifications": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Google's Verification objects."
                    },
                    "next_page_token": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "400": {
            "description": "Invalid request, or Google rejected it. `error_code`: `user_required`, `google_business_not_connected`, `location_required`, `invalid_location_id`, `google_validation_error`, `google_precondition_failed`, `invalid_page_size`, `invalid_page_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. `error_code`: `google_business_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. `error_code`: `profile_not_found`, `user_not_found`, `no_locations`, `location_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily limit reached; retry after `retry_after_seconds` when present. `error_code`: `google_rate_limited`, `daily_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "502": {
            "description": "Google failed, could not be reached, or did not confirm the result. `error_code`: `google_api_error`, `google_unreachable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; nothing was sent to Google. `error_code`: `google_api_not_enabled`, `gbp_feature_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GbpError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/users/discord/credentials": {
      "post": {
        "operationId": "connectDiscordCredentials",
        "summary": "Connect Discord with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Discord channel incoming webhook (no OAuth). No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https://discord.com/api/webhooks/..."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "webhook_url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/telegram/credentials": {
      "post": {
        "operationId": "connectTelegramCredentials",
        "summary": "Connect Telegram with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Telegram bot token + target chat. Upload-Post validates both (getMe, getChat) and stores the token encrypted. No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "bot_token": {
                    "type": "string"
                  },
                  "chat_id": {
                    "type": "string",
                    "description": "Public channel @username or numeric chat id."
                  },
                  "receive_updates": {
                    "type": "boolean",
                    "default": false,
                    "description": "Also receive the bot's DMs and other updates (same options as POST /uploadposts/telegram/updates)."
                  },
                  "replace_existing_webhook": {
                    "type": "boolean"
                  },
                  "forward_url": {
                    "type": "string"
                  },
                  "auto_answer_callbacks": {
                    "type": "boolean"
                  },
                  "extra_updates": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "bot_token",
                  "chat_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "updates": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "With receive_updates."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/slack/credentials": {
      "post": {
        "operationId": "connectSlackCredentials",
        "summary": "Connect Slack with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Slack channel Incoming Webhook URL (text only). No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "webhook_url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/mastodon/credentials": {
      "post": {
        "operationId": "connectMastodonCredentials",
        "summary": "Connect Mastodon with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Mastodon instance access token. No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "instance_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "access_token": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "instance_url",
                  "access_token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/nostr/credentials": {
      "post": {
        "operationId": "connectNostrCredentials",
        "summary": "Connect Nostr with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Nostr private key (nsec or hex) and optional relays. No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "private_key": {
                    "type": "string"
                  },
                  "relays": {
                    "type": "string",
                    "description": "Comma-separated wss:// relays (defaults used if omitted)."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "private_key"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/lemmy/credentials": {
      "post": {
        "operationId": "connectLemmyCredentials",
        "summary": "Connect Lemmy with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Lemmy instance, login and target community. No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "instance_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "community": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "instance_url",
                  "username",
                  "password",
                  "community"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/devto/credentials": {
      "post": {
        "operationId": "connectDevToCredentials",
        "summary": "Connect Dev.to with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Dev.to API key. No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "api_key": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "api_key"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/hashnode/credentials": {
      "post": {
        "operationId": "connectHashnodeCredentials",
        "summary": "Connect Hashnode with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Hashnode Personal Access Token and publication id. No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "pat": {
                    "type": "string"
                  },
                  "publication_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "pat",
                  "publication_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/wordpress/credentials": {
      "post": {
        "operationId": "connectWordPressCredentials",
        "summary": "Connect WordPress with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Self-hosted WordPress site, username and Application Password. No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "site_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "username": {
                    "type": "string"
                  },
                  "application_password": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "site_url",
                  "username",
                  "application_password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/whop/credentials": {
      "post": {
        "operationId": "connectWhopCredentials",
        "summary": "Connect Whop with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Whop API key (forum:post:create) and experience id. No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "api_key": {
                    "type": "string"
                  },
                  "experience_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "api_key",
                  "experience_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/listmonk/credentials": {
      "post": {
        "operationId": "connectListmonkCredentials",
        "summary": "Connect Listmonk with credentials",
        "tags": [
          "User Management"
        ],
        "description": "Listmonk instance, login and list id (each post sends a campaign). No OAuth and no browser redirect: Upload-Post validates the credentials, encrypts the secret and links the account to the profile. Also accepted with the profile JWT of the white-label connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "instance_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "list_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the connection."
                  }
                },
                "required": [
                  "profile_username",
                  "instance_url",
                  "username",
                  "password",
                  "list_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, invalid format or credentials refused by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/facebook-page": {
      "get": {
        "operationId": "listFacebookPageChoices",
        "summary": "List the Facebook Pages a profile can publish to",
        "tags": [
          "User Management"
        ],
        "description": "Every Facebook Page of the profile's connected account and the one selected for publishing.",
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          }
        ],
        "responses": {
          "200": {
            "description": "Choices.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "picture": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "selected_page_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "selected_page_name": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing profile_username, nothing connected, or token unavailable. error_code: `invalid_parameter`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "invalid_parameter",
                  "message": "Missing profile_username, nothing connected, or token unavailable."
                }
              }
            }
          },
          "401": {
            "description": "Facebook session expired or revoked (reauth_required: true). error_code: `facebook_reauth_required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "facebook_reauth_required",
                  "message": "Facebook session expired or revoked (reauth_required: true)."
                }
              }
            }
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "403": {
            "description": "The account lacks a permission to list its Pages. error_code: `facebook_permission_denied`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "facebook_permission_denied",
                  "message": "The account lacks a permission to list its Pages."
                }
              }
            }
          },
          "502": {
            "description": "Facebook failed to return the Page list; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "setFacebookPage",
        "summary": "Select the Facebook Page used when publishing",
        "tags": [
          "User Management"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "facebook_page_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "profile_username",
                  "facebook_page_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Selected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "facebook_page_id": {
                      "type": "string"
                    },
                    "facebook_page_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The Facebook Page is not available to the connected account. error_code: `invalid_parameter`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "invalid_parameter",
                  "message": "The Facebook Page is not available to the connected account."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "clearFacebookPage",
        "summary": "Clear the selected Facebook Page",
        "tags": [
          "User Management"
        ],
        "description": "Back to the default (the first one of the account).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  }
                },
                "required": [
                  "profile_username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cleared.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/linkedin-page": {
      "get": {
        "operationId": "listLinkedInPageChoices",
        "summary": "List the LinkedIn Pages a profile can publish to",
        "tags": [
          "User Management"
        ],
        "description": "Every LinkedIn Page of the profile's connected account and the one selected for publishing.",
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          }
        ],
        "responses": {
          "200": {
            "description": "Choices.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "urn:li:organization:123456"
                          },
                          "name": {
                            "type": "string"
                          },
                          "picture": {
                            "type": "string"
                          },
                          "vanityName": {
                            "type": "string"
                          },
                          "followers": {
                            "type": "integer"
                          },
                          "account_id": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "selected_page_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "selected_page_name": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing profile_username, nothing connected, or token unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "setLinkedInPage",
        "summary": "Select the LinkedIn Page used when publishing",
        "tags": [
          "User Management"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "linkedin_page_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "profile_username",
                  "linkedin_page_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Selected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "linkedin_page_id": {
                      "type": "string"
                    },
                    "linkedin_page_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The LinkedIn Page is not available to the connected account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "clearLinkedInPage",
        "summary": "Clear the selected LinkedIn Page",
        "tags": [
          "User Management"
        ],
        "description": "Back to the default (the first one of the account).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  }
                },
                "required": [
                  "profile_username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cleared.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/google-business-location": {
      "get": {
        "operationId": "listGoogleBusinessLocationChoices",
        "summary": "List the Google Business locations a profile can publish to",
        "tags": [
          "User Management"
        ],
        "description": "Every Google Business location of the profile's connected account and the one selected for publishing.",
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          }
        ],
        "responses": {
          "200": {
            "description": "Choices.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "example": "locations/1234567890"
                          },
                          "title": {
                            "type": "string"
                          },
                          "account_id": {
                            "type": "string"
                          },
                          "account_name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "selected_location_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "selected_location_name": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing profile_username, nothing connected, or token unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "setGoogleBusinessLocation",
        "summary": "Select the Google Business location used when publishing",
        "tags": [
          "User Management"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "gbp_location_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "profile_username",
                  "gbp_location_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Selected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "gbp_location_id": {
                      "type": "string"
                    },
                    "gbp_location_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The Google Business location is not available to the connected account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "clearGoogleBusinessLocation",
        "summary": "Clear the selected Google Business location",
        "tags": [
          "User Management"
        ],
        "description": "Back to the default (the first one of the account).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  }
                },
                "required": [
                  "profile_username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cleared.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/notifications/test": {
      "post": {
        "operationId": "testNotifications",
        "summary": "Send a test notification",
        "tags": [
          "Webhooks"
        ],
        "description": "Sends a sample upload_completed through the configured channels (logged as a test delivery, never retried). Only our own outcome per channel is returned, never the destination's answer.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "default": "test"
                  },
                  "media_type": {
                    "type": "string",
                    "default": "text"
                  },
                  "title": {
                    "type": "string"
                  },
                  "caption": {
                    "type": "string"
                  },
                  "profile_username": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string",
                    "description": "Telegram text (default: built from the other fields)."
                  },
                  "result": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "notified": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean"
                          },
                          "skipped": {
                            "type": "boolean"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/users/webhook-secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate the webhook signing secret",
        "tags": [
          "Webhooks"
        ],
        "description": "Generates a new webhook_secret; deliveries are signed with it from now on (also those of webhook subscriptions).",
        "responses": {
          "200": {
            "description": "New secret.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "webhook_secret": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Team members cannot do it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/users/profile-webhook": {
      "get": {
        "operationId": "getProfileWebhook",
        "summary": "Get a profile's own webhook",
        "tags": [
          "Webhooks"
        ],
        "description": "A profile can send its events to its own URL instead of the account webhook. Needs the account API key or a dashboard session (a profile JWT is refused).",
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          }
        ],
        "responses": {
          "200": {
            "description": "The profile webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "webhook_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "webhook_events": {
                      "type": "object",
                      "nullable": true,
                      "additionalProperties": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed with a profile JWT.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "setProfileWebhook",
        "summary": "Set a profile's own webhook",
        "tags": [
          "Webhooks"
        ],
        "description": "webhook_events omitted = every event; null = reset. Signed with the account webhook_secret.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "webhook_events": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "type": "boolean"
                    }
                  }
                },
                "required": [
                  "profile_username",
                  "webhook_url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "webhook_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "webhook_events": {
                      "type": "object",
                      "nullable": true,
                      "additionalProperties": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed with a profile JWT, or a team member changing the URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteProfileWebhook",
        "summary": "Remove a profile's own webhook",
        "tags": [
          "Webhooks"
        ],
        "description": "Its events go back to the account webhook.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  }
                },
                "required": [
                  "profile_username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed with a profile JWT.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/users/preferences": {
      "get": {
        "operationId": "getUserPreferences",
        "summary": "Get account preferences",
        "tags": [
          "User Management"
        ],
        "responses": {
          "200": {
            "description": "Preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "preferences": {
                      "type": "object",
                      "properties": {
                        "weekStartDay": {
                          "type": "integer",
                          "enum": [
                            0,
                            1
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "updateUserPreferences",
        "summary": "Update account preferences",
        "tags": [
          "User Management"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "weekStartDay": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "0 = Sunday, 1 = Monday."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "preferences": {
                      "type": "object",
                      "properties": {
                        "weekStartDay": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "weekStartDay must be 0 or 1.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/uploadposts/oauth/{platform}/start": {
      "post": {
        "operationId": "startOAuthConnection",
        "summary": "Connect API: start connecting a social account",
        "tags": [
          "Authentication"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ],
        "description": "Build your own connect page: returns the platform's authorize_url for a profile. Send the user there; Upload-Post finishes the OAuth and sends them back to redirect_url. Authenticate with the API key (then `profile` is required) or with the profile JWT of POST /uploadposts/users/generate-jwt (profile taken from the token). The state is single-use: a retry needs a new start.",
        "parameters": [
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram",
                "facebook",
                "linkedin",
                "youtube",
                "x",
                "twitter",
                "threads",
                "pinterest",
                "google-business",
                "twitch",
                "reddit"
              ]
            },
            "description": "Platform to connect."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile": {
                    "type": "string",
                    "description": "Profile username (API key auth only)."
                  },
                  "redirect_url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2000,
                    "description": "Absolute http(s) URL to return to."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authorize URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "platform": {
                      "type": "string"
                    },
                    "authorize_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "state": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer",
                      "description": "Seconds the state stays valid."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing profile (API key auth) or invalid redirect_url.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Unknown platform, or profile not found. error_code: `PROFILE_NOT_FOUND`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "PROFILE_NOT_FOUND",
                  "message": "Unknown platform, or profile not found."
                }
              }
            }
          },
          "500": {
            "description": "Platform client not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "503": {
            "description": "Reddit connections temporarily unavailable. error_code: `reddit_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "reddit_unavailable",
                  "message": "Reddit connections temporarily unavailable."
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/connect": {
      "post": {
        "operationId": "connectChatgptAdsAccount",
        "summary": "Connect a ChatGPT Ads account",
        "description": "Stores an OpenAI Ads API key after validating it live against OpenAI. Each key is scoped to one ad account. The key is encrypted at rest and never returned. Posting the same account again replaces the stored key (key rotation). The first account connected becomes the default. Spend runs on your own OpenAI billing.",
        "tags": [
          "ChatGPT Ads"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_key": {
                    "type": "string",
                    "description": "Your OpenAI Ads API key (ads.openai.com -> Settings -> API keys)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Link the ad account to this profile."
                  },
                  "name": {
                    "type": "string",
                    "description": "Friendly label. Default: the ad account name reported by OpenAI."
                  },
                  "default": {
                    "type": "boolean",
                    "description": "Make this the account used when a request does not choose one."
                  }
                },
                "required": [
                  "api_key"
                ]
              },
              "example": {
                "api_key": "your-openai-ads-api-key"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "account": {
                      "$ref": "#/components/schemas/ChatgptAdsAccount"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "ChatGPT Ads account connected successfully",
                  "account": {
                    "ad_account_id": "adacct_123",
                    "name": "Acme Ads",
                    "currency_code": "USD",
                    "timezone": "UTC",
                    "status": "active",
                    "review_status": "approved",
                    "default": true,
                    "connected_at": "2026-09-06T10:12:00+00:00"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`api_key` missing, OpenAI rejected the key, or OpenAI returned no ad account for it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/accounts": {
      "get": {
        "operationId": "listChatgptAdsAccounts",
        "summary": "List connected ChatGPT Ads accounts",
        "description": "Connected ad accounts (never the credentials), default first, each with the `profiles` it is linked to.",
        "tags": [
          "ChatGPT Ads"
        ],
        "responses": {
          "200": {
            "description": "Accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatgptAdsAccount"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/accounts/{ad_account_id}": {
      "delete": {
        "operationId": "disconnectChatgptAdsAccount",
        "summary": "Disconnect a ChatGPT Ads account",
        "description": "Without `profile_username`: forgets the stored key and unlinks every profile (if it was the default, another connected account becomes the default). With `profile_username`: only unlinks that profile and keeps the key for the others. Campaigns keep running in Ads Manager either way.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_account_id",
            "in": "path",
            "required": true,
            "description": "Connected ad account (`adacct_...`).",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Only unlink this profile.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disconnected or unlinked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid `ad_account_id` or `profile_username`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The account is not connected, or the profile does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/account": {
      "get": {
        "operationId": "getChatgptAdsAccount",
        "summary": "Get live ad account metadata",
        "description": "The selected ad account's metadata, read live from OpenAI. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ad account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "account": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad account object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/campaigns": {
      "get": {
        "operationId": "listChatgptAdsCampaigns",
        "summary": "List campaigns",
        "description": "Campaigns of the ad account. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "1-500 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor: `last_id` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Cursor: `first_id` of the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Campaigns page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "campaigns": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "OpenAI's campaign objects."
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "first_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Send it as `after` for the next page."
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createChatgptAdsCampaign",
        "summary": "Create a campaign",
        "description": "Creates a campaign (budget, schedule, location and audience targeting). One of `budget` / `budget_micros` is required. Created `paused` unless `status: active` is sent. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "3-1000 characters.",
                    "minLength": 3,
                    "maxLength": 1000
                  },
                  "budget": {
                    "type": "number",
                    "description": "Lifetime spend limit in the ad account currency. Minimum 1.",
                    "minimum": 1
                  },
                  "budget_micros": {
                    "type": "integer",
                    "description": "Same in micros (`25000000` = 25.00). Alternative to `budget`.",
                    "minimum": 1000000
                  },
                  "status": {
                    "type": "string",
                    "description": "Default `paused`: nothing starts spending by accident.",
                    "enum": [
                      "paused",
                      "active"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "start_time": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Unix timestamp or ISO-8601 datetime. Empty or null clears it."
                  },
                  "end_time": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Unix timestamp or ISO-8601 datetime. Empty or null clears it."
                  },
                  "bidding_type": {
                    "type": "string",
                    "description": "Default `impressions`. Cannot be changed later.",
                    "enum": [
                      "impressions",
                      "clicks",
                      "conversions"
                    ]
                  },
                  "conversion_event_setting_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Exactly one active standard event setting; required for `conversions`."
                  },
                  "mode": {
                    "type": "string",
                    "description": "Passed to OpenAI as is."
                  },
                  "product_feed_id": {
                    "type": "string",
                    "description": "Product feed (product-feed campaigns)."
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "OpenAI location ids (country, region or DMA). Shorthand for `targeting.locations.include`."
                  },
                  "custom_audience_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Shorthand for `targeting.custom_audiences.ids`."
                  },
                  "excluded_custom_audience_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Shorthand for `targeting.excluded_custom_audiences.ids`."
                  },
                  "targeting": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Full OpenAI targeting object. Overrides the shorthands."
                  },
                  "ad_account_id": {
                    "type": "string",
                    "description": "Ad account to use (after the query parameter and the header)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Use the ad account linked to this profile (after the query parameter)."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Spring launch",
                "budget": 25,
                "locations": [
                  "2000043"
                ],
                "status": "paused"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Campaign created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "campaign": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's campaign object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/campaigns/{campaign_id}": {
      "get": {
        "operationId": "getChatgptAdsCampaign",
        "summary": "Get a campaign",
        "description": "One campaign. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "description": "Campaign id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "campaign": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's campaign object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "updateChatgptAdsCampaign",
        "summary": "Update a campaign",
        "description": "Updates a campaign. Every field is optional; at least one is required (400 `No updatable fields supplied`). Archiving is irreversible. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "description": "Campaign id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "3-1000 characters.",
                    "minLength": 3,
                    "maxLength": 1000
                  },
                  "budget": {
                    "type": "number",
                    "description": "Lifetime spend limit in the ad account currency. Minimum 1.",
                    "minimum": 1
                  },
                  "budget_micros": {
                    "type": "integer",
                    "description": "Same in micros (`25000000` = 25.00). Alternative to `budget`.",
                    "minimum": 1000000
                  },
                  "status": {
                    "type": "string",
                    "description": "`archived` is irreversible.",
                    "enum": [
                      "active",
                      "paused",
                      "archived"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "start_time": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Unix timestamp or ISO-8601 datetime. Empty or null clears it."
                  },
                  "end_time": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Unix timestamp or ISO-8601 datetime. Empty or null clears it."
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "OpenAI location ids (country, region or DMA). Shorthand for `targeting.locations.include`."
                  },
                  "custom_audience_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Shorthand for `targeting.custom_audiences.ids`."
                  },
                  "excluded_custom_audience_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Shorthand for `targeting.excluded_custom_audiences.ids`."
                  },
                  "targeting": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Full OpenAI targeting object. Overrides the shorthands."
                  },
                  "ad_account_id": {
                    "type": "string",
                    "description": "Ad account to use (after the query parameter and the header)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Use the ad account linked to this profile (after the query parameter)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "campaign": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's campaign object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/campaigns/{campaign_id}/activate": {
      "post": {
        "operationId": "activateChatgptAdsCampaign",
        "summary": "Activate a campaign",
        "description": "Sets the campaign `active`. An ad only serves when its campaign, ad group and ad are all active and the ad passed OpenAI's review. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "description": "Campaign id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "campaign": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's campaign object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/campaigns/{campaign_id}/pause": {
      "post": {
        "operationId": "pauseChatgptAdsCampaign",
        "summary": "Pause a campaign",
        "description": "Sets the campaign `paused`. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "description": "Campaign id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "campaign": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's campaign object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/campaigns/{campaign_id}/archive": {
      "post": {
        "operationId": "archiveChatgptAdsCampaign",
        "summary": "Archive a campaign",
        "description": "Archives the campaign. Irreversible. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "description": "Campaign id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "campaign": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's campaign object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/campaigns/{campaign_id}/insights": {
      "get": {
        "operationId": "getChatgptAdsCampaignInsights",
        "summary": "Get campaign insights",
        "description": "Performance of one campaign; rows per `aggregation_level` inside it. Repeatable parameters accept `key` or `key[]` and are forwarded to OpenAI. Page forward with `after=<last_id>`. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "description": "Campaign id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "`YYYY-MM-DD`, start of a date range in the ad account timezone.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "`YYYY-MM-DD`, end of the date range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "time_granularity",
            "in": "query",
            "description": "Default `daily`.",
            "schema": {
              "type": "string",
              "enum": [
                "hourly",
                "daily",
                "monthly",
                "none"
              ]
            }
          },
          {
            "name": "aggregation_level",
            "in": "query",
            "description": "Row entity inside the endpoint's scope.",
            "schema": {
              "type": "string",
              "enum": [
                "ad_account",
                "campaign",
                "ad_group",
                "ad"
              ]
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Repeatable (`fields` or `fields[]`). Metrics and metadata: `impressions`, `clicks`, `spend`, `ctr`, `cpc`, `cpm`, `campaign.name`...",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "segments",
            "in": "query",
            "description": "Repeatable. One of `product`, `country`, `device`.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filters",
            "in": "query",
            "description": "Repeatable JSON-encoded objects, passed through to OpenAI.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Repeatable JSON-encoded objects, passed through to OpenAI.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "time_ranges",
            "in": "query",
            "description": "Repeatable JSON-encoded range objects, for windows `since`/`until` cannot express (they win over `since`/`until`).",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "1-2000 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor: `last_id` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Cursor: `first_id` of the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Insights page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "insights": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Insight rows from OpenAI."
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "first_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Send it as `after` for the next page."
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/adgroups": {
      "get": {
        "operationId": "listChatgptAdsAdGroups",
        "summary": "List ad groups",
        "description": "Ad groups of a campaign. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "query",
            "description": "Parent campaign.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "limit",
            "in": "query",
            "description": "1-500 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor: `last_id` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Cursor: `first_id` of the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ad groups page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad_groups": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "OpenAI's ad group objects."
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "first_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Send it as `after` for the next page."
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createChatgptAdsAdGroup",
        "summary": "Create an ad group",
        "description": "Creates an ad group (the bid) under a campaign. One of `max_bid` / `max_bid_micros` is required unless `bidding_config` is sent. Created `paused` unless `status: active` is sent. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaign_id": {
                    "type": "string",
                    "description": "Parent campaign."
                  },
                  "name": {
                    "type": "string",
                    "description": "3-1000 characters.",
                    "minLength": 3,
                    "maxLength": 1000
                  },
                  "max_bid": {
                    "type": "number",
                    "description": "Max bid per billing event in account currency (`0.06` = a $60 CPM on impression billing)."
                  },
                  "max_bid_micros": {
                    "type": "integer",
                    "description": "Same in micros. Alternative to `max_bid`."
                  },
                  "billing_event_type": {
                    "type": "string",
                    "description": "Default `impression`; `click` for click and conversion campaigns.",
                    "enum": [
                      "impression",
                      "click"
                    ]
                  },
                  "bidding_config": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Full OpenAI bidding config. Overrides `max_bid` / `billing_event_type`."
                  },
                  "status": {
                    "type": "string",
                    "description": "Default `paused`: nothing starts spending by accident.",
                    "enum": [
                      "paused",
                      "active"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "context_hints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "When your product or service is useful, in your own words."
                  },
                  "product_set": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Product filters for product-feed campaigns."
                  },
                  "ad_account_id": {
                    "type": "string",
                    "description": "Ad account to use (after the query parameter and the header)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Use the ad account linked to this profile (after the query parameter)."
                  }
                },
                "required": [
                  "campaign_id",
                  "name"
                ]
              },
              "example": {
                "campaign_id": "cmpn_101",
                "name": "US English",
                "max_bid": 0.06,
                "context_hints": [
                  "productivity",
                  "team collaboration"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ad group created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad_group": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad group object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/adgroups/{ad_group_id}": {
      "get": {
        "operationId": "getChatgptAdsAdGroup",
        "summary": "Get an ad group",
        "description": "One ad group. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_group_id",
            "in": "path",
            "required": true,
            "description": "Ad group id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ad group.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad_group": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad group object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "updateChatgptAdsAdGroup",
        "summary": "Update an ad group",
        "description": "Updates an ad group. Every field is optional; at least one is required (400 `No updatable fields supplied`). Archiving is irreversible. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_group_id",
            "in": "path",
            "required": true,
            "description": "Ad group id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "3-1000 characters.",
                    "minLength": 3,
                    "maxLength": 1000
                  },
                  "max_bid": {
                    "type": "number",
                    "description": "Max bid per billing event in account currency (`0.06` = a $60 CPM on impression billing)."
                  },
                  "max_bid_micros": {
                    "type": "integer",
                    "description": "Same in micros. Alternative to `max_bid`."
                  },
                  "billing_event_type": {
                    "type": "string",
                    "description": "Default `impression`; `click` for click and conversion campaigns.",
                    "enum": [
                      "impression",
                      "click"
                    ]
                  },
                  "bidding_config": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Full OpenAI bidding config. Overrides `max_bid` / `billing_event_type`."
                  },
                  "status": {
                    "type": "string",
                    "description": "`archived` is irreversible.",
                    "enum": [
                      "active",
                      "paused",
                      "archived"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "context_hints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "When your product or service is useful, in your own words."
                  },
                  "product_set": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Product filters for product-feed campaigns."
                  },
                  "ad_account_id": {
                    "type": "string",
                    "description": "Ad account to use (after the query parameter and the header)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Use the ad account linked to this profile (after the query parameter)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ad group updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad_group": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad group object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/adgroups/{ad_group_id}/activate": {
      "post": {
        "operationId": "activateChatgptAdsAdGroup",
        "summary": "Activate an ad group",
        "description": "Sets the ad group `active`. An ad only serves when its campaign, ad group and ad are all active and the ad passed OpenAI's review. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_group_id",
            "in": "path",
            "required": true,
            "description": "Ad group id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ad group after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad_group": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad group object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/adgroups/{ad_group_id}/pause": {
      "post": {
        "operationId": "pauseChatgptAdsAdGroup",
        "summary": "Pause an ad group",
        "description": "Sets the ad group `paused`. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_group_id",
            "in": "path",
            "required": true,
            "description": "Ad group id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ad group after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad_group": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad group object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/adgroups/{ad_group_id}/archive": {
      "post": {
        "operationId": "archiveChatgptAdsAdGroup",
        "summary": "Archive an ad group",
        "description": "Archives the ad group. Irreversible. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_group_id",
            "in": "path",
            "required": true,
            "description": "Ad group id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ad group after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad_group": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad group object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/adgroups/{ad_group_id}/insights": {
      "get": {
        "operationId": "getChatgptAdsAdGroupInsights",
        "summary": "Get ad group insights",
        "description": "Performance of one ad group; rows per `aggregation_level` inside it. Repeatable parameters accept `key` or `key[]` and are forwarded to OpenAI. Page forward with `after=<last_id>`. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_group_id",
            "in": "path",
            "required": true,
            "description": "Ad group id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "`YYYY-MM-DD`, start of a date range in the ad account timezone.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "`YYYY-MM-DD`, end of the date range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "time_granularity",
            "in": "query",
            "description": "Default `daily`.",
            "schema": {
              "type": "string",
              "enum": [
                "hourly",
                "daily",
                "monthly",
                "none"
              ]
            }
          },
          {
            "name": "aggregation_level",
            "in": "query",
            "description": "Row entity inside the endpoint's scope.",
            "schema": {
              "type": "string",
              "enum": [
                "ad_account",
                "campaign",
                "ad_group",
                "ad"
              ]
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Repeatable (`fields` or `fields[]`). Metrics and metadata: `impressions`, `clicks`, `spend`, `ctr`, `cpc`, `cpm`, `campaign.name`...",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "segments",
            "in": "query",
            "description": "Repeatable. One of `product`, `country`, `device`.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filters",
            "in": "query",
            "description": "Repeatable JSON-encoded objects, passed through to OpenAI.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Repeatable JSON-encoded objects, passed through to OpenAI.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "time_ranges",
            "in": "query",
            "description": "Repeatable JSON-encoded range objects, for windows `since`/`until` cannot express (they win over `since`/`until`).",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "1-2000 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor: `last_id` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Cursor: `first_id` of the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Insights page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "insights": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Insight rows from OpenAI."
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "first_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Send it as `after` for the next page."
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/ads": {
      "get": {
        "operationId": "listChatgptAdsAds",
        "summary": "List ads",
        "description": "Ads of an ad group. `review_status` is `in_review`, `approved` or `rejected`. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_group_id",
            "in": "query",
            "description": "Parent ad group.",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "limit",
            "in": "query",
            "description": "1-500 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor: `last_id` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Cursor: `first_id` of the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ads page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "OpenAI's ad objects."
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "first_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Send it as `after` for the next page."
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createChatgptAdsAd",
        "summary": "Create an ad",
        "description": "Creates an ad (the creative) under an ad group: send `title`, `body`, `target_url` and `file_id` at the top level, or a full `creative` object (needed for `product_ad_template`). It starts serving after OpenAI's review (`review_status: approved`). Created `paused` unless `status: active` is sent. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ad_group_id": {
                    "type": "string",
                    "description": "Parent ad group."
                  },
                  "name": {
                    "type": "string",
                    "description": "Internal name, 3-1000 characters. Not shown to users.",
                    "minLength": 3,
                    "maxLength": 1000
                  },
                  "title": {
                    "type": "string",
                    "description": "Headline, 3-50 characters.",
                    "minLength": 3,
                    "maxLength": 50
                  },
                  "body": {
                    "type": "string",
                    "description": "Copy, up to 100 characters.",
                    "maxLength": 100
                  },
                  "target_url": {
                    "type": "string",
                    "description": "http(s) destination URL."
                  },
                  "file_id": {
                    "type": "string",
                    "description": "Creative id from POST /creatives."
                  },
                  "price": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "description": "Creative type (flat form).",
                    "enum": [
                      "chat_card",
                      "product_ad_template"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "description": "Default `paused`: nothing starts spending by accident.",
                    "enum": [
                      "paused",
                      "active"
                    ]
                  },
                  "creative": {
                    "type": "object",
                    "description": "Creative. `chat_card` (default) needs `title`, `body`, `target_url` and `file_id`; `product_ad_template` takes image and destination from the feed item.",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "chat_card",
                          "product_ad_template"
                        ]
                      },
                      "title": {
                        "type": "string",
                        "description": "3-50 characters.",
                        "minLength": 3,
                        "maxLength": 50
                      },
                      "body": {
                        "type": "string",
                        "description": "1-100 characters.",
                        "maxLength": 100
                      },
                      "target_url": {
                        "type": "string",
                        "description": "http(s) destination URL."
                      },
                      "file_id": {
                        "type": "string",
                        "description": "Creative id from POST /creatives."
                      },
                      "price": {
                        "type": "string"
                      }
                    }
                  },
                  "ad_account_id": {
                    "type": "string",
                    "description": "Ad account to use (after the query parameter and the header)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Use the ad account linked to this profile (after the query parameter)."
                  }
                },
                "required": [
                  "ad_group_id",
                  "name"
                ]
              },
              "example": {
                "ad_group_id": "adgrp_301",
                "name": "Planner launch card",
                "title": "Try the workspace planner",
                "body": "Coordinate tasks, docs and meetings in one place.",
                "target_url": "https://acme.example/planner",
                "file_id": "file_901",
                "status": "active"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ad created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/ads/{ad_id}": {
      "get": {
        "operationId": "getChatgptAdsAd",
        "summary": "Get an ad",
        "description": "One ad. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_id",
            "in": "path",
            "required": true,
            "description": "Ad id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ad.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "updateChatgptAdsAd",
        "summary": "Update an ad",
        "description": "Updates an ad. Only `name`, `status` and `creative` are read; an edited ad goes back into review. Every field is optional; at least one is required (400 `No updatable fields supplied`). Archiving is irreversible. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_id",
            "in": "path",
            "required": true,
            "description": "Ad id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "3-1000 characters.",
                    "minLength": 3,
                    "maxLength": 1000
                  },
                  "status": {
                    "type": "string",
                    "description": "`archived` is irreversible.",
                    "enum": [
                      "active",
                      "paused",
                      "archived"
                    ]
                  },
                  "creative": {
                    "type": "object",
                    "description": "Creative. `chat_card` (default) needs `title`, `body`, `target_url` and `file_id`; `product_ad_template` takes image and destination from the feed item.",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "chat_card",
                          "product_ad_template"
                        ]
                      },
                      "title": {
                        "type": "string",
                        "description": "3-50 characters.",
                        "minLength": 3,
                        "maxLength": 50
                      },
                      "body": {
                        "type": "string",
                        "description": "1-100 characters.",
                        "maxLength": 100
                      },
                      "target_url": {
                        "type": "string",
                        "description": "http(s) destination URL."
                      },
                      "file_id": {
                        "type": "string",
                        "description": "Creative id from POST /creatives."
                      },
                      "price": {
                        "type": "string"
                      }
                    }
                  },
                  "ad_account_id": {
                    "type": "string",
                    "description": "Ad account to use (after the query parameter and the header)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Use the ad account linked to this profile (after the query parameter)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ad updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/ads/{ad_id}/activate": {
      "post": {
        "operationId": "activateChatgptAdsAd",
        "summary": "Activate an ad",
        "description": "Sets the ad `active`. An ad only serves when its campaign, ad group and ad are all active and the ad passed OpenAI's review. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_id",
            "in": "path",
            "required": true,
            "description": "Ad id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ad after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/ads/{ad_id}/pause": {
      "post": {
        "operationId": "pauseChatgptAdsAd",
        "summary": "Pause an ad",
        "description": "Sets the ad `paused`. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_id",
            "in": "path",
            "required": true,
            "description": "Ad id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ad after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/ads/{ad_id}/archive": {
      "post": {
        "operationId": "archiveChatgptAdsAd",
        "summary": "Archive an ad",
        "description": "Archives the ad. Irreversible. No body: choose the ad account with the query parameter or the header. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_id",
            "in": "path",
            "required": true,
            "description": "Ad id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ad after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ad": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/ads/{ad_id}/insights": {
      "get": {
        "operationId": "getChatgptAdsAdInsights",
        "summary": "Get ad insights",
        "description": "Performance of one ad; rows per `aggregation_level` inside it. Repeatable parameters accept `key` or `key[]` and are forwarded to OpenAI. Page forward with `after=<last_id>`. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_id",
            "in": "path",
            "required": true,
            "description": "Ad id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "`YYYY-MM-DD`, start of a date range in the ad account timezone.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "`YYYY-MM-DD`, end of the date range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "time_granularity",
            "in": "query",
            "description": "Default `daily`.",
            "schema": {
              "type": "string",
              "enum": [
                "hourly",
                "daily",
                "monthly",
                "none"
              ]
            }
          },
          {
            "name": "aggregation_level",
            "in": "query",
            "description": "Row entity inside the endpoint's scope.",
            "schema": {
              "type": "string",
              "enum": [
                "ad_account",
                "campaign",
                "ad_group",
                "ad"
              ]
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Repeatable (`fields` or `fields[]`). Metrics and metadata: `impressions`, `clicks`, `spend`, `ctr`, `cpc`, `cpm`, `campaign.name`...",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "segments",
            "in": "query",
            "description": "Repeatable. One of `product`, `country`, `device`.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filters",
            "in": "query",
            "description": "Repeatable JSON-encoded objects, passed through to OpenAI.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Repeatable JSON-encoded objects, passed through to OpenAI.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "time_ranges",
            "in": "query",
            "description": "Repeatable JSON-encoded range objects, for windows `since`/`until` cannot express (they win over `since`/`until`).",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "1-2000 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor: `last_id` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Cursor: `first_id` of the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Insights page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "insights": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Insight rows from OpenAI."
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "first_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Send it as `after` for the next page."
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/ads/{ad_id}/preview": {
      "post": {
        "operationId": "previewChatgptAdsAd",
        "summary": "Preview an ad",
        "description": "A temporary iframe preview of the ad (expires in 24 h). No body. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_id",
            "in": "path",
            "required": true,
            "description": "Ad id.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preview.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "preview": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's preview object, unchanged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/creatives": {
      "post": {
        "operationId": "uploadChatgptAdsCreative",
        "summary": "Upload a creative image",
        "description": "Uploads the image an ad uses; reuse the returned `file_id`. JSON with `image_url` (OpenAI fetches it) or multipart with a binary `file` (up to 10 MB). A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "image_url"
                ],
                "properties": {
                  "image_url": {
                    "type": "string",
                    "description": "http(s) image URL."
                  },
                  "ad_account_id": {
                    "type": "string",
                    "description": "Ad account to use (after the query parameter and the header)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Use the ad account linked to this profile (after the query parameter)."
                  }
                }
              },
              "example": {
                "image_url": "https://acme.example/assets/planner-card.png"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "Image, up to 10 MB.",
                    "format": "binary"
                  },
                  "image_url": {
                    "type": "string",
                    "description": "Alternative to `file`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Creative uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "creative": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's answer.",
                      "properties": {
                        "file_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "creative": {
                    "file_id": "file_901"
                  }
                }
              }
            }
          },
          "400": {
            "description": "No `image_url` or `file`, a non-http(s) URL, an empty file, or OpenAI rejected it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "413": {
            "description": "Creative file larger than 10 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/insights": {
      "get": {
        "operationId": "getChatgptAdsAccountInsights",
        "summary": "Get ad account insights",
        "description": "Performance of the whole ad account; rows per `aggregation_level`. Repeatable parameters accept `key` or `key[]` and are forwarded to OpenAI. Page forward with `after=<last_id>`. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "`YYYY-MM-DD`, start of a date range in the ad account timezone.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "`YYYY-MM-DD`, end of the date range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "time_granularity",
            "in": "query",
            "description": "Default `daily`.",
            "schema": {
              "type": "string",
              "enum": [
                "hourly",
                "daily",
                "monthly",
                "none"
              ]
            }
          },
          {
            "name": "aggregation_level",
            "in": "query",
            "description": "Row entity inside the endpoint's scope.",
            "schema": {
              "type": "string",
              "enum": [
                "ad_account",
                "campaign",
                "ad_group",
                "ad"
              ]
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Repeatable (`fields` or `fields[]`). Metrics and metadata: `impressions`, `clicks`, `spend`, `ctr`, `cpc`, `cpm`, `campaign.name`...",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "segments",
            "in": "query",
            "description": "Repeatable. One of `product`, `country`, `device`.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filters",
            "in": "query",
            "description": "Repeatable JSON-encoded objects, passed through to OpenAI.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Repeatable JSON-encoded objects, passed through to OpenAI.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "time_ranges",
            "in": "query",
            "description": "Repeatable JSON-encoded range objects, for windows `since`/`until` cannot express (they win over `since`/`until`).",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "1-2000 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor: `last_id` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Cursor: `first_id` of the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Insights page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "insights": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Insight rows from OpenAI."
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "first_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Send it as `after` for the next page."
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "insights": [
                    {
                      "campaign_id": "cmpn_101",
                      "readable_time": "2026-09-01",
                      "timezone": "UTC",
                      "impressions": 15548,
                      "clicks": 312,
                      "spend": 42.75
                    }
                  ],
                  "count": 1,
                  "has_more": false,
                  "first_id": "start=1756684800:end=1756771200:entity_id=cmpn_101",
                  "last_id": "start=1756684800:end=1756771200:entity_id=cmpn_101"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/ads/chatgpt/promote": {
      "post": {
        "operationId": "promoteChatgptAds",
        "summary": "Launch an ad in one call",
        "description": "Creates the campaign, ad group and ad, and uploads the creative from `image_url` (or reuses `file_id`), in one request. Every payload is validated before the first write; everything is created paused and only activated (`status: active`) once all three exist. If a later step fails, the error carries `details.created` with the ids already created so you can finish or archive them. A 401 can also mean OpenAI rejected the stored key (revoked): reconnect the account with POST /connect.",
        "tags": [
          "ChatGPT Ads"
        ],
        "parameters": [
          {
            "name": "ad_account_id",
            "in": "query",
            "description": "ChatGPT Ads account to use (`adacct_...`). Without it: `X-Ads-Account-Id` header, then `ad_account_id` in the JSON body, then the only or the default connected account (several and no default = 400).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Ads-Account-Id",
            "in": "header",
            "description": "Alternative to `ad_account_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "description": "Use the ad account linked to this profile, and only that one (404 if the profile has none linked; never falls back to the default account).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Ad headline, 3-50 characters.",
                    "minLength": 3,
                    "maxLength": 50
                  },
                  "body": {
                    "type": "string",
                    "description": "Ad copy, up to 100 characters.",
                    "maxLength": 100
                  },
                  "target_url": {
                    "type": "string",
                    "description": "http(s) destination URL."
                  },
                  "image_url": {
                    "type": "string",
                    "description": "Creative image URL (one of `image_url` / `file_id`)."
                  },
                  "file_id": {
                    "type": "string",
                    "description": "Already uploaded creative id."
                  },
                  "budget": {
                    "type": "number",
                    "description": "Lifetime spend limit in the ad account currency. Minimum 1.",
                    "minimum": 1
                  },
                  "budget_micros": {
                    "type": "integer",
                    "description": "Same in micros (`25000000` = 25.00). Alternative to `budget`.",
                    "minimum": 1000000
                  },
                  "max_bid": {
                    "type": "number",
                    "description": "Max bid per billing event in account currency (`0.06` = a $60 CPM on impression billing)."
                  },
                  "max_bid_micros": {
                    "type": "integer",
                    "description": "Same in micros. Alternative to `max_bid`."
                  },
                  "name": {
                    "type": "string",
                    "description": "Base name of the three objects. Default: `title`."
                  },
                  "status": {
                    "type": "string",
                    "description": "Default `paused`: nothing starts spending by accident.",
                    "enum": [
                      "paused",
                      "active"
                    ]
                  },
                  "bidding_type": {
                    "type": "string",
                    "description": "Default `impressions`.",
                    "enum": [
                      "impressions",
                      "clicks",
                      "conversions"
                    ]
                  },
                  "billing_event_type": {
                    "type": "string",
                    "description": "Default: `impression` for impression campaigns, `click` otherwise.",
                    "enum": [
                      "impression",
                      "click"
                    ]
                  },
                  "start_time": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Unix timestamp or ISO-8601 datetime. Empty or null clears it."
                  },
                  "end_time": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Unix timestamp or ISO-8601 datetime. Empty or null clears it."
                  },
                  "description": {
                    "type": "string",
                    "description": "Campaign description."
                  },
                  "conversion_event_setting_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "For `conversions` bidding."
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "OpenAI location ids (country, region or DMA). Shorthand for `targeting.locations.include`."
                  },
                  "custom_audience_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Shorthand for `targeting.custom_audiences.ids`."
                  },
                  "excluded_custom_audience_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Shorthand for `targeting.excluded_custom_audiences.ids`."
                  },
                  "targeting": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Full OpenAI targeting object. Overrides the shorthands."
                  },
                  "context_hints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "When the ad is useful, e.g. `[\"productivity\"]`."
                  },
                  "price": {
                    "type": "string",
                    "description": "Creative price."
                  },
                  "ad_group_name": {
                    "type": "string"
                  },
                  "ad_name": {
                    "type": "string"
                  },
                  "ad_account_id": {
                    "type": "string",
                    "description": "Ad account to use (after the query parameter and the header)."
                  },
                  "profile_username": {
                    "type": "string",
                    "description": "Use the ad account linked to this profile (after the query parameter)."
                  }
                },
                "required": [
                  "title",
                  "body",
                  "target_url"
                ]
              },
              "example": {
                "name": "Spring launch",
                "title": "Try the workspace planner",
                "body": "Coordinate tasks, docs and meetings in one place.",
                "target_url": "https://acme.example/planner",
                "image_url": "https://acme.example/assets/planner-card.png",
                "budget": 25,
                "max_bid": 0.06,
                "context_hints": [
                  "productivity",
                  "team collaboration"
                ],
                "status": "active"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Campaign, ad group and ad created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "campaign": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's campaign."
                    },
                    "ad_group": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad group."
                    },
                    "ad": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "OpenAI's ad."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "paused",
                        "active"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "campaign": {
                    "id": "cmpn_101",
                    "status": "active"
                  },
                  "ad_group": {
                    "id": "adgrp_301",
                    "status": "active"
                  },
                  "ad": {
                    "id": "ad_501",
                    "status": "active",
                    "review_status": "in_review"
                  },
                  "status": "active",
                  "message": "Ad created. It starts serving once OpenAI's review approves it (check 'review_status')."
                }
              }
            }
          },
          "400": {
            "description": "Validation failed, OpenAI rejected the request (its reason is in `message`), several accounts are connected and none was chosen, or the stored credentials cannot be read. When a step after the campaign fails, `details.created` lists what was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No ChatGPT Ads account connected, profile not found or without a linked ad account, or the object does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited by Upload-Post (`error_type: rate_limit`) or by OpenAI. Retry after a short pause.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "OpenAI Ads is unreachable or returned an unexpected response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          },
          "504": {
            "description": "OpenAI Ads did not respond in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatgptAdsError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/media-uploads": {
      "post": {
        "operationId": "createMediaUpload",
        "summary": "Get a signed URL to upload a file",
        "tags": [
          "Content Upload"
        ],
        "description": "For clients that cannot send large files in a multipart request (AI agents, the MCP server): create the upload, PUT the bytes to upload_url with the returned headers, call /complete, then pass media_url to the upload endpoints. Files expire after staging_ttl_hours. Per-file size, files in progress and monthly files/bytes depend on the plan.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "media_type": {
                    "type": "string",
                    "enum": [
                      "video",
                      "image",
                      "document"
                    ],
                    "default": "video"
                  },
                  "filename": {
                    "type": "string",
                    "maxLength": 180,
                    "description": "With an allowed extension (video: mp4, mov, m4v, webm, mpeg, mpg, avi, mkv; image: jpg, jpeg, png, webp, gif; document: pdf, ppt, pptx, doc, docx)."
                  },
                  "content_type": {
                    "type": "string",
                    "description": "MIME type matching media_type."
                  },
                  "content_length": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Size in bytes."
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 80
                  }
                },
                "required": [
                  "filename",
                  "content_length"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upload created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "upload_id": {
                      "type": "string"
                    },
                    "upload_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "method": {
                      "type": "string",
                      "example": "PUT"
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "put_expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "max_file_bytes": {
                      "type": "integer"
                    },
                    "staging_ttl_hours": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid media_type, extension, content_type or content_length.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "413": {
            "description": "Over the plan's per-file limit (limit_bytes).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "429": {
            "description": "Too many uploads in progress (Retry-After), or monthly files/bytes limit. error_code: `STAGING_UPLOADS_IN_PROGRESS`, `STAGING_MONTHLY_FILES_LIMIT`, `STAGING_MONTHLY_BYTES_LIMIT`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                },
                "example": {
                  "success": false,
                  "error_code": "STAGING_UPLOADS_IN_PROGRESS",
                  "message": "Too many uploads in progress (Retry-After), or monthly files/bytes limit."
                }
              }
            }
          },
          "503": {
            "description": "Storage not available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/media-uploads/{upload_id}/complete": {
      "post": {
        "operationId": "completeMediaUpload",
        "summary": "Confirm a signed upload",
        "tags": [
          "Content Upload"
        ],
        "description": "Checks the uploaded object (size, type) and returns media_url.",
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Upload id."
          }
        ],
        "responses": {
          "200": {
            "description": "Uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/MediaUpload"
                    }
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The object is empty or its content_type is not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Upload not found, or the object was not uploaded yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "410": {
            "description": "The upload expired, was deleted or rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "413": {
            "description": "Over the plan's per-file limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "429": {
            "description": "Monthly ingest limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/media-uploads/{upload_id}": {
      "get": {
        "operationId": "getMediaUpload",
        "summary": "Get a signed upload",
        "tags": [
          "Content Upload"
        ],
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Upload id."
          },
          {
            "name": "include_url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Include media_url (when uploaded)."
          }
        ],
        "responses": {
          "200": {
            "description": "The upload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUpload"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Upload not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteMediaUpload",
        "summary": "Delete a signed upload",
        "tags": [
          "Content Upload"
        ],
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Upload id."
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "upload_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "delete_error": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Upload not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/reddit/subreddits": {
      "get": {
        "operationId": "listRedditSubreddits",
        "summary": "Subreddits the Reddit account belongs to",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          }
        ],
        "responses": {
          "200": {
            "description": "Subreddit names.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "subreddits": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing parameters, or no Reddit account on the profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "description": "Reddit token invalid: reconnect (reauth_required: true).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "404": {
            "description": "User, profile or Reddit connection not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "409": {
            "description": "No Reddit refresh token: reconnect (reauth_required: true).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/reddit/post-types": {
      "get": {
        "operationId": "getRedditPostTypes",
        "summary": "Post types a subreddit allows",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "subreddit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subreddit name without r/."
          }
        ],
        "responses": {
          "200": {
            "description": "Allowed types.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "allowed_post_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing parameters, or no Reddit account on the profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "description": "Reddit token invalid: reconnect (reauth_required: true).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "404": {
            "description": "User, profile or Reddit connection not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "409": {
            "description": "No Reddit refresh token: reconnect (reauth_required: true).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "403": {
            "description": "The subreddit is private, quarantined or the account is banned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/reddit/flairs": {
      "get": {
        "operationId": "listRedditFlairs",
        "summary": "Post flairs of a subreddit",
        "tags": [
          "Platform Integration"
        ],
        "description": "Pass the id as reddit_flair_id when publishing; editable flairs take reddit_flair_text.",
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Profile username."
          },
          {
            "name": "subreddit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subreddit name without r/."
          }
        ],
        "responses": {
          "200": {
            "description": "Flairs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "flairs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "css_class": {
                            "type": "string"
                          },
                          "text_color": {
                            "type": "string"
                          },
                          "mod_only": {
                            "type": "boolean"
                          },
                          "text_editable": {
                            "type": "boolean"
                          },
                          "background_color": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing parameters, or no Reddit account on the profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "description": "Reddit token invalid: reconnect (reauth_required: true).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "404": {
            "description": "User, profile or Reddit connection not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "409": {
            "description": "No Reddit refresh token: reconnect (reauth_required: true).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        }
      }
    },
    "/uploadposts/users/bluesky/credentials": {
      "post": {
        "operationId": "connectBlueskyCredentials",
        "summary": "Connect Bluesky with an app password",
        "tags": [
          "User Management"
        ],
        "description": "Logs in to Bluesky with the handle and an app password, stores the password encrypted and links the account to the profile. Also accepted with the profile JWT of the connect page.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "handle": {
                    "type": "string",
                    "example": "name.bsky.social"
                  },
                  "password": {
                    "type": "string",
                    "description": "Bluesky app password (one with DM access to use Bluesky DMs)."
                  }
                },
                "required": [
                  "profile_username",
                  "handle",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields or Bluesky refused the login.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "User or profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "503": {
            "description": "Bluesky is temporarily rate-limiting the connection (rate_limited: true); retry in a few minutes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/users/youtube/credentials": {
      "post": {
        "operationId": "setYoutubeOAuthClient",
        "summary": "Use your own Google OAuth client for a profile's YouTube",
        "tags": [
          "User Management"
        ],
        "description": "Stores (encrypted) the client_id and client_secret of your own Google Cloud OAuth client; that profile then authorizes YouTube against it (its own API quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  }
                },
                "required": [
                  "profile_username",
                  "client_id",
                  "client_secret"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Profile not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/uploadposts/reddit/detailed-posts/": {
      "get": {
        "operationId": "getRedditDetailedPosts",
        "summary": "Get Reddit detailed posts",
        "description": "Retrieve detailed posts from a Reddit account connected to a profile, including complete media information. Supports automatic pagination up to 2000 posts. The path ends with a slash (`/detailed-posts/`); without it the API answers a 308 redirect.",
        "tags": [
          "Platform Integration"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "description": "Username of the profile with a connected Reddit account.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reddit posts retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RedditPost"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "description": "API Key authentication. Format: `Apikey YOUR_API_KEY`"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Profile JWT: the token of the access_url returned by POST /uploadposts/users/generate-jwt (white-label connect page). Accepted where an operation lists it: validate-jwt, the Connect API start, manual credentials, Page/location selection, disconnecting a social account and the end-client approval routes. It only acts on the profile it was issued for."
      }
    },
    "parameters": {
      "TikTokProfile": {
        "name": "profile",
        "in": "query",
        "required": true,
        "description": "Profile username. Must have a TikTok account connected.",
        "schema": {
          "type": "string"
        }
      },
      "TikTokMusicGenre": {
        "name": "genre",
        "in": "query",
        "description": "Commercial Music Library genre, e.g. `ALL`, `POP`, `HIP_HOP/RAP`, `R&B/SOUL`. The slashes and the ampersand are part of TikTok's enum. Unknown values fall back to `ALL`.",
        "schema": {
          "type": "string",
          "default": "ALL"
        }
      },
      "TikTokMusicCountry": {
        "name": "country_code",
        "in": "query",
        "description": "ISO-3166 alpha-2 country whose trending chart is read. The catalogue is per country, so this changes which tracks come back.",
        "schema": {
          "type": "string",
          "default": "US"
        }
      },
      "TikTokMusicDateRange": {
        "name": "date_range",
        "in": "query",
        "description": "Trending window.",
        "schema": {
          "type": "string",
          "enum": [
            "1DAY",
            "7DAY",
            "30DAY",
            "90DAY"
          ],
          "default": "7DAY"
        }
      },
      "ProfileQueryParam": {
        "name": "profile_username",
        "in": "query",
        "required": true,
        "description": "The profile username.",
        "schema": {
          "type": "string"
        }
      },
      "JobIdPathParam": {
        "name": "job_id",
        "in": "path",
        "required": true,
        "description": "The unique job identifier.",
        "schema": {
          "type": "string"
        }
      },
      "PageParam": {
        "name": "page",
        "in": "query",
        "description": "Page number (starts at 1).",
        "schema": {
          "type": "integer",
          "default": 1,
          "minimum": 1
        }
      },
      "LimitParam": {
        "name": "limit",
        "in": "query",
        "description": "Number of items per page.",
        "schema": {
          "type": "integer",
          "default": 10,
          "enum": [
            10,
            20,
            50,
            100
          ]
        }
      }
    },
    "responses": {
      "PlatformNotSupported": {
        "description": "That network cannot answer this question yet. Upload-Post is one endpoint per QUESTION with a `platform`, so the message names the platforms that can. Branch on the error_code, not on a hard-coded platform list: when the network is added, the same call starts returning data. Some endpoints carry the text in `error` instead of `message`.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "message": {
                  "type": "string",
                  "example": "'instagram' does not support audience insights yet. Supported: tiktok."
                },
                "error_code": {
                  "type": "string",
                  "example": "platform_not_supported"
                }
              }
            }
          }
        }
      },
      "TikTokReconnectRequired": {
        "description": "The profile has no TikTok connection able to serve this endpoint, or TikTok no longer accepts the connection's token (revoked or missing a permission; then `reauth_required: true` is included). Reconnecting the TikTok account from Manage Users enables it. Retrying without reconnecting does not help.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "message": {
                  "type": "string",
                  "example": "Profile 'my_profile' has no TikTok connection that supports this endpoint. Reconnect your TikTok account from Manage Users."
                },
                "error_code": {
                  "type": "string",
                  "example": "tiktok_reconnect_required"
                },
                "reauth_required": {
                  "type": "boolean",
                  "description": "Present (true) when TikTok no longer accepts the connection's token."
                }
              }
            }
          }
        }
      },
      "TikTokReauthRequired": {
        "description": "The TikTok token expired and could not be refreshed; the account must be reconnected.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "message": {
                  "type": "string",
                  "example": "Your TikTok session has expired. Please reconnect your TikTok account at app.upload-post.com/manage-users."
                },
                "reauth_required": {
                  "type": "boolean",
                  "example": true
                }
              }
            }
          }
        }
      },
      "TikTokUpstreamError": {
        "description": "TikTok failed the request. Its message is returned verbatim. A request TikTok refuses as invalid (error 40002) is a 400 with error_code `invalid_parameter` instead, and a revoked token a 400 `tiktok_reconnect_required`.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "message": {
                  "type": "string",
                  "example": "TikTok API error 40002: invalid parameter"
                }
              }
            }
          }
        }
      },
      "BadRequest": {
        "description": "Bad Request — Missing or invalid parameters.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized — Invalid or expired token.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "success": false,
              "message": "Invalid or expired token"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Forbidden — Plan restrictions or insufficient permissions.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not Found — Resource does not exist.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Too Many Requests — Monthly limit exceeded.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "message": {
                  "type": "string",
                  "example": "This upload would exceed your monthly limit."
                },
                "usage": {
                  "$ref": "#/components/schemas/UsageInfo"
                }
              }
            }
          }
        }
      },
      "UploadTooManyRequests": {
        "description": "Too Many Requests — the monthly upload limit is exceeded, or (uploads with scheduled_date or add_to_queue) the account already has the maximum number of pending scheduled posts for its plan (`error_code: SCHEDULED_POSTS_LIMIT`).",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "message": {
                  "type": "string",
                  "example": "This upload would exceed your monthly limit."
                },
                "error": {
                  "type": "string"
                },
                "usage": {
                  "$ref": "#/components/schemas/UsageInfo"
                },
                "error_code": {
                  "type": "string",
                  "description": "SCHEDULED_POSTS_LIMIT when the pending scheduled posts cap was reached.",
                  "example": "SCHEDULED_POSTS_LIMIT"
                },
                "pending_scheduled_posts": {
                  "type": "integer",
                  "description": "Scheduled posts the account has waiting (SCHEDULED_POSTS_LIMIT only)."
                },
                "max_pending_scheduled_posts": {
                  "type": "integer",
                  "description": "Maximum pending scheduled posts for the account's plan (SCHEDULED_POSTS_LIMIT only)."
                }
              }
            }
          }
        }
      },
      "ScheduledPostsLimit": {
        "description": "Too Many Requests — the account already has the maximum number of pending scheduled posts for its plan. Only posts due more than 15 minutes ahead count. Wait for some to publish or cancel scheduled posts, then try again.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string",
                  "example": "Scheduled posts limit reached (20000 pending)."
                },
                "error_code": {
                  "type": "string",
                  "example": "SCHEDULED_POSTS_LIMIT"
                },
                "pending_scheduled_posts": {
                  "type": "integer",
                  "example": 20000
                },
                "max_pending_scheduled_posts": {
                  "type": "integer",
                  "example": 20000
                }
              }
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal Server Error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "TikTokMusicTrack": {
        "type": "object",
        "description": "One track of TikTok's Commercial Music Library.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Send this as `tiktok_music_id` on an upload. NOT `commercial_music_id`: TikTok rejects that one on public posts.",
            "example": "7205381234567890123"
          },
          "commercial_music_id": {
            "type": "string",
            "description": "TikTok's catalogue id for the same track. Returned for reference only."
          },
          "title": {
            "type": "string",
            "example": "Summer Nights"
          },
          "artist": {
            "type": "string",
            "example": "The Example Band"
          },
          "duration": {
            "type": "number",
            "description": "Track duration in seconds.",
            "example": 32
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "POP"
            ]
          },
          "cover_url": {
            "type": "string",
            "description": "Artwork image URL."
          },
          "preview_url": {
            "type": "string",
            "description": "Audio preview URL."
          },
          "rank": {
            "type": "integer",
            "description": "Position in TikTok's trending chart for the requested filters."
          }
        }
      },
      "TikTokLocation": {
        "type": "object",
        "description": "One TikTok place. Both fields must be sent together on an upload.",
        "properties": {
          "location_id": {
            "type": "string",
            "description": "Send as `tiktok_location_id`.",
            "example": "v2_2f4a1b9c8e"
          },
          "location_name": {
            "type": "string",
            "description": "Send as `tiktok_location_name`. TikTok rejects the id without it.",
            "example": "Museo Nacional del Prado"
          },
          "location_address": {
            "type": "string",
            "description": "Postal address, useful for disambiguating results in a picker.",
            "example": "C. de Ruiz de Alarcon, 23, 28014 Madrid, Spain"
          }
        }
      },
      "VideoPlatformEnum": {
        "type": "string",
        "enum": [
          "tiktok",
          "instagram",
          "linkedin",
          "youtube",
          "facebook",
          "x",
          "threads",
          "pinterest",
          "bluesky",
          "reddit",
          "google_business",
          "discord",
          "telegram"
        ],
        "description": "Supported platforms for video upload."
      },
      "PhotoPlatformEnum": {
        "type": "string",
        "enum": [
          "tiktok",
          "instagram",
          "linkedin",
          "facebook",
          "x",
          "threads",
          "pinterest",
          "bluesky",
          "reddit",
          "google_business",
          "discord",
          "telegram"
        ],
        "description": "Supported platforms for photo upload."
      },
      "TextPlatformEnum": {
        "type": "string",
        "enum": [
          "linkedin",
          "x",
          "facebook",
          "threads",
          "reddit",
          "bluesky",
          "google_business",
          "discord",
          "telegram"
        ],
        "description": "Supported platforms for text upload."
      },
      "TikTokPrivacyLevel": {
        "type": "string",
        "enum": [
          "PUBLIC_TO_EVERYONE",
          "MUTUAL_FOLLOW_FRIENDS",
          "FOLLOWER_OF_CREATOR",
          "SELF_ONLY"
        ],
        "description": "[TikTok] Privacy setting for the post.",
        "default": "PUBLIC_TO_EVERYONE"
      },
      "TikTokPostMode": {
        "type": "string",
        "enum": [
          "DIRECT_POST",
          "MEDIA_UPLOAD"
        ],
        "description": "[TikTok] DIRECT_POST publishes immediately. MEDIA_UPLOAD sends to TikTok drafts (same as tiktok_upload_to_draft=true). Either field works on any TikTok account.",
        "default": "DIRECT_POST"
      },
      "InstagramVideoMediaType": {
        "type": "string",
        "enum": [
          "REELS",
          "STORIES"
        ],
        "description": "[Instagram] Type of video media.",
        "default": "REELS"
      },
      "InstagramPhotoMediaType": {
        "type": "string",
        "enum": [
          "IMAGE",
          "STORIES"
        ],
        "description": "[Instagram] Type of photo media. Automatically handles CAROUSEL/REELS logic if mixed media is detected.",
        "default": "IMAGE"
      },
      "InstagramShareMode": {
        "type": "string",
        "enum": [
          "CUSTOM",
          "TRIAL_REELS_SHARE_TO_FOLLOWERS_IF_LIKED",
          "TRIAL_REELS_DONT_SHARE_TO_FOLLOWERS"
        ],
        "description": "[Instagram] Reel posting mode. CUSTOM = regular Reel. Trial Reel modes test content with non-followers first.",
        "default": "CUSTOM"
      },
      "LinkedInVisibility": {
        "type": "string",
        "enum": [
          "PUBLIC",
          "CONNECTIONS",
          "LOGGED_IN",
          "CONTAINER"
        ],
        "description": "[LinkedIn] Visibility setting for the post. Required when platform includes linkedin.",
        "default": "PUBLIC"
      },
      "YouTubePrivacyStatus": {
        "type": "string",
        "enum": [
          "public",
          "unlisted",
          "private"
        ],
        "description": "[YouTube] Privacy setting for the video.",
        "default": "public"
      },
      "FacebookVideoMediaType": {
        "type": "string",
        "enum": [
          "REELS",
          "STORIES"
        ],
        "description": "[Facebook] Type of video media.",
        "default": "REELS"
      },
      "FacebookPhotoMediaType": {
        "type": "string",
        "enum": [
          "POSTS",
          "STORIES"
        ],
        "description": "[Facebook] Type of photo media.",
        "default": "POSTS"
      },
      "XReplySettings": {
        "type": "string",
        "enum": [
          "following",
          "mentionedUsers",
          "subscribers",
          "verified"
        ],
        "description": "[X] Controls who can reply to the tweet."
      },
      "FFmpegJobStatus": {
        "type": "string",
        "enum": [
          "PENDING",
          "PROCESSING",
          "FINISHED",
          "ERROR"
        ],
        "description": "Status of an FFmpeg processing job."
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "message": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "UsageInfo": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "description": "Current usage count."
          },
          "limit": {
            "type": "integer",
            "description": "Monthly limit."
          },
          "last_reset": {
            "type": "string",
            "format": "date-time",
            "description": "Last reset timestamp."
          }
        }
      },
      "SyncUploadResponse": {
        "type": "object",
        "description": "Synchronous upload response (completed within timeout).",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "results": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "url": {
                  "type": "string"
                },
                "publish_id": {
                  "type": "string"
                },
                "container_id": {
                  "type": "string"
                },
                "post_id": {
                  "type": "string"
                },
                "video_was_transcoded": {
                  "type": "boolean"
                },
                "changes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "List of transformations applied to the media."
                },
                "prevalidation_metadata": {
                  "type": "object",
                  "description": "Media metadata detected before upload."
                },
                "error": {
                  "type": "string"
                }
              }
            },
            "description": "Per-platform results keyed by platform name."
          },
          "usage": {
            "$ref": "#/components/schemas/UsageInfo"
          }
        }
      },
      "AsyncUploadResponse": {
        "type": "object",
        "description": "Asynchronous upload response (processing in background).",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "message": {
            "type": "string",
            "example": "Upload initiated successfully in background."
          },
          "request_id": {
            "type": "string",
            "description": "Use this to poll status via GET /uploadposts/status."
          },
          "total_platforms": {
            "type": "integer",
            "description": "Number of platforms being uploaded to."
          }
        }
      },
      "ScheduledUploadResponse": {
        "type": "object",
        "description": "Scheduled upload response.",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "job_id": {
            "type": "string",
            "description": "Scheduled job identifier."
          },
          "scheduled_date": {
            "type": "string",
            "format": "date-time",
            "description": "Scheduled publish date/time in UTC."
          }
        }
      },
      "QueuedUploadResponse": {
        "type": "object",
        "description": "Queued upload response.",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "job_id": {
            "type": "string",
            "description": "Scheduled job identifier."
          },
          "scheduled_date": {
            "type": "string",
            "format": "date-time",
            "description": "Assigned queue slot date/time."
          },
          "queue_slot": {
            "type": "string",
            "format": "date-time",
            "description": "Queue slot datetime."
          },
          "message": {
            "type": "string",
            "example": "Post added to queue"
          }
        }
      },
      "DocumentUploadResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "results": {
            "type": "object",
            "properties": {
              "linkedin": {
                "type": "object",
                "properties": {
                  "success": {
                    "type": "boolean"
                  },
                  "document_urn": {
                    "type": "string"
                  },
                  "post_id": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string"
                  },
                  "content_type": {
                    "type": "string"
                  },
                  "file_size": {
                    "type": "integer"
                  },
                  "filename": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "UploadStatusResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "job_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "in_progress",
              "completed"
            ],
            "description": "Aggregated status."
          },
          "completed": {
            "type": "integer",
            "description": "Number of platforms completed."
          },
          "total": {
            "type": "integer",
            "description": "Total number of platforms."
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string"
                },
                "success": {
                  "type": "boolean"
                },
                "message": {
                  "type": "string"
                },
                "upload_timestamp": {
                  "type": "string",
                  "format": "date-time"
                },
                "platform_post_id": {
                  "type": "string",
                  "nullable": true
                },
                "post_url": {
                  "type": "string",
                  "nullable": true
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Non-fatal notices. TikTok: a warning that the public post ID will be added later when TikTok releases it after moderation."
                },
                "post_id_resolved_late": {
                  "type": "boolean",
                  "description": "TikTok: true when the real post ID and post_url were filled in after the upload finished (TikTok releases them once moderation ends, up to 24 hours later)."
                }
              }
            }
          },
          "last_update": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UploadHistoryResponse": {
        "type": "object",
        "properties": {
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryItem"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          }
        }
      },
      "HistoryItem": {
        "type": "object",
        "properties": {
          "user_email": {
            "type": "string"
          },
          "profile_username": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "media_type": {
            "type": "string",
            "enum": [
              "video",
              "photo",
              "text"
            ]
          },
          "upload_timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "success": {
            "type": "boolean"
          },
          "platform_post_id": {
            "type": "string",
            "nullable": true
          },
          "post_url": {
            "type": "string",
            "nullable": true
          },
          "post_id_resolved_late": {
            "type": "boolean",
            "description": "TikTok: true when platform_post_id and post_url were filled in after the upload finished (TikTok releases the post ID once moderation ends, up to 24 hours later)."
          },
          "error_message": {
            "type": "string",
            "nullable": true
          },
          "media_size_bytes": {
            "type": "integer",
            "nullable": true
          },
          "post_title": {
            "type": "string",
            "nullable": true
          },
          "post_caption": {
            "type": "string",
            "nullable": true
          },
          "is_async": {
            "type": "boolean",
            "nullable": true
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "Present when the upload originated from a scheduled job."
          },
          "video_was_transcoded": {
            "type": "boolean",
            "nullable": true
          },
          "changes": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            },
            "description": "List of transformations applied to the media (e.g., transcoding, aspect ratio changes)."
          },
          "prevalidation_metadata": {
            "type": "object",
            "nullable": true,
            "description": "Media metadata detected before upload (dimensions, codec, duration, etc.)."
          },
          "request_id": {
            "type": "string",
            "nullable": true
          },
          "request_id_logs": {
            "type": "string",
            "nullable": true,
            "description": "Internal request ID for log correlation."
          },
          "request_total_platforms": {
            "type": "integer",
            "nullable": true
          },
          "dashboard": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the upload was initiated from the dashboard."
          }
        }
      },
      "ScheduledPost": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string",
            "description": "Unique identifier of the scheduled job."
          },
          "scheduled_date": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 date/time when the post will go live (UTC)."
          },
          "post_type": {
            "type": "string",
            "enum": [
              "video",
              "photo",
              "text"
            ],
            "description": "Type of content."
          },
          "profile_username": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "preview_url": {
            "type": "string",
            "nullable": true,
            "description": "Short-lived signed URL to preview the media. Null for text posts."
          }
        }
      },
      "QueueSlot": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23,
            "description": "Hour of the slot (0-23)."
          },
          "minute": {
            "type": "integer",
            "minimum": 0,
            "maximum": 59,
            "description": "Minute of the slot (0-59)."
          }
        },
        "required": [
          "hour",
          "minute"
        ]
      },
      "QueueSettings": {
        "type": "object",
        "properties": {
          "timezone": {
            "type": "string",
            "description": "IANA timezone.",
            "example": "America/New_York"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueueSlot"
            }
          },
          "days_of_week": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            },
            "description": "Active days: 0=Monday through 6=Sunday."
          },
          "slots_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "auto"
            ],
            "description": "auto = the queue fills the best hours from /uploadposts/best-times. Opt-in."
          },
          "effective_slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueueSlot"
            },
            "description": "The slots the queue is filling now."
          },
          "auto_slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueueSlot"
            },
            "description": "Auto mode: recommended hours in `timezone`."
          },
          "auto_slots_info": {
            "type": "object",
            "description": "Auto mode: computed_at, timezone, count, status (ok, no_data_using_fixed_slots, refresh_failed_kept_previous, disabled_using_fixed_slots) and per-network source/confidence."
          },
          "auto_platforms": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram",
                "facebook",
                "youtube",
                "linkedin",
                "x",
                "threads",
                "pinterest",
                "bluesky",
                "reddit"
              ]
            }
          }
        }
      },
      "QueueSettingsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "queue_settings": {
            "$ref": "#/components/schemas/QueueSettings"
          },
          "configured": {
            "type": "boolean",
            "description": "true once queue settings were saved for this profile; false means queue_settings shows the defaults because the queue was never configured.",
            "example": true
          }
        }
      },
      "QueuePreviewResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "timezone": {
            "type": "string"
          },
          "slots": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "datetime_utc": {
                  "type": "string",
                  "format": "date-time"
                },
                "datetime_local": {
                  "type": "string",
                  "format": "date-time"
                },
                "available": {
                  "type": "boolean"
                },
                "is_queue_slot": {
                  "type": "boolean",
                  "description": "Whether this slot is a configured queue slot."
                },
                "scheduled_post": {
                  "type": "object",
                  "nullable": true,
                  "properties": {
                    "job_id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "platforms": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "next_available": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NextSlotResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "next_slot": {
            "type": "object",
            "nullable": true,
            "properties": {
              "datetime_utc": {
                "type": "string",
                "format": "date-time"
              },
              "datetime_local": {
                "type": "string",
                "format": "date-time"
              },
              "timezone": {
                "type": "string"
              }
            }
          },
          "message": {
            "type": "string",
            "description": "Present when no slots are available."
          }
        }
      },
      "AnalyticsResponse": {
        "type": "object",
        "additionalProperties": {
          "type": "object",
          "properties": {
            "followers": {
              "type": "number"
            },
            "reach": {
              "type": "number"
            },
            "views": {
              "type": "number",
              "description": "Total content views. For Instagram, this is the official 'views' metric (replaces deprecated 'impressions'). Same value as 'impressions' field."
            },
            "impressions": {
              "type": "number",
              "description": "Total impressions/views. For Instagram, YouTube, and TikTok this equals the 'views' field. Kept for backwards compatibility."
            },
            "profileViews": {
              "type": "number",
              "description": "Profile views or accounts engaged (Instagram)."
            },
            "likes": {
              "type": "number"
            },
            "comments": {
              "type": "number"
            },
            "shares": {
              "type": "number"
            },
            "saves": {
              "type": "number"
            },
            "video_count": {
              "type": "integer",
              "description": "Total number of videos (TikTok)."
            },
            "following": {
              "type": "integer",
              "description": "Number of accounts followed (TikTok)."
            },
            "reach_timeseries": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "value": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "description": "Analytics data keyed by platform name. Metrics vary by platform."
      },
      "FacebookPage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Facebook Page ID. Use this value as `facebook_page_id` in upload endpoints."
          },
          "name": {
            "type": "string",
            "description": "Display name of the Facebook page."
          },
          "picture": {
            "type": "string",
            "nullable": true,
            "description": "URL of the page's profile picture."
          },
          "account_id": {
            "type": "string",
            "description": "Internal identifier for the user's connected Facebook account."
          }
        }
      },
      "LinkedInPage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "LinkedIn organization URN. Use as `target_linkedin_page_id`."
          },
          "name": {
            "type": "string",
            "description": "Display name of the LinkedIn page."
          },
          "picture": {
            "type": "string",
            "nullable": true,
            "description": "URL of the page logo."
          },
          "account_id": {
            "type": "string",
            "description": "Internal identifier for the connected LinkedIn account."
          },
          "vanityName": {
            "type": "string",
            "nullable": true,
            "description": "Custom vanity URL of the page."
          }
        }
      },
      "PinterestBoard": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Pinterest board ID for posting."
          },
          "name": {
            "type": "string",
            "description": "Display name of the board."
          }
        }
      },
      "RedditPost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "subreddit": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "likes": {
            "type": "integer"
          },
          "comments": {
            "type": "integer"
          },
          "impressions": {
            "type": "integer"
          },
          "has_image": {
            "type": "boolean"
          },
          "has_video": {
            "type": "boolean"
          },
          "media": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "image",
                    "video",
                    "external_video"
                  ]
                },
                "url": {
                  "type": "string"
                },
                "width": {
                  "type": "integer"
                },
                "height": {
                  "type": "integer"
                },
                "duration": {
                  "type": "number",
                  "description": "Duration in seconds (video only)."
                },
                "thumbnail": {
                  "type": "string",
                  "description": "Thumbnail URL (external_video only)."
                },
                "provider": {
                  "type": "string",
                  "description": "Provider name (external_video only)."
                }
              }
            }
          },
          "url": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "thumbnail": {
            "type": "string"
          }
        }
      },
      "UserProfile": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "Unique profile identifier. This is the `user` value of every API call; it never changes."
          },
          "display_name": {
            "type": "string",
            "nullable": true,
            "description": "Label shown in the dashboard instead of the username; null when unset. Set it with PATCH /uploadposts/users/{username}. Not the same as social_accounts.<platform>.display_name."
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp of profile creation."
          },
          "social_accounts": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "username": {
                      "type": "string",
                      "description": "Platform-specific user identifier."
                    },
                    "handle": {
                      "type": "string",
                      "description": "Platform handle/username."
                    },
                    "display_name": {
                      "type": "string",
                      "description": "Display name on the platform."
                    },
                    "social_images": {
                      "type": "string",
                      "description": "URL of the profile picture."
                    },
                    "reauth_required": {
                      "type": "boolean",
                      "description": "Whether the account needs to be re-authenticated."
                    }
                  }
                },
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "nullable": true
                }
              ]
            },
            "description": "Connected social media accounts keyed by platform name."
          },
          "client_approval": {
            "type": "boolean",
            "description": "Only in GET /uploadposts/users/validate-jwt, while post approvals are on: true when this connection link may approve or reject the profile's pending posts (the link was generated with client_approval: true and the profile still has it on)."
          }
        }
      },
      "FFmpegJob": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/FFmpegJobStatus"
          },
          "duration_seconds": {
            "type": "number",
            "description": "Duration of the input media in seconds."
          },
          "output_extension": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "description": "Present once the job has an output.",
            "properties": {
              "media_url": {
                "type": "string",
                "description": "Temporary public signed URL of a copy of the output (video and image outputs only; audio outputs do not get one). No API key needed: pass it as video_url or photos[] to the upload endpoints. Poll the job again for a fresh signature; the copy is deleted 24 hours after the job finished."
              },
              "media_url_expires_in_seconds": {
                "type": "integer",
                "description": "Lifetime of the media_url signature, in seconds.",
                "example": 21600
              },
              "media_url_note": {
                "type": "string",
                "description": "Human-readable reminder of how to use media_url."
              },
              "download_url": {
                "type": "string",
                "description": "Authenticated download endpoint (GET /api/uploadposts/ffmpeg/jobs/{job_id}/download). Requires your API key; do not pass it as video_url."
              },
              "download_auth": {
                "type": "string",
                "example": "Authorization: Apikey <your Upload-Post API key>"
              }
            }
          }
        }
      },
      "FFmpegConsumptionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "consumption": {
            "type": "object",
            "properties": {
              "used_minutes": {
                "type": "number"
              },
              "remaining_minutes": {
                "type": "number"
              },
              "quota_minutes": {
                "type": "number"
              },
              "usage_percentage": {
                "type": "number"
              },
              "total_requests": {
                "type": "integer"
              },
              "current_month": {
                "type": "string"
              },
              "plan": {
                "type": "string"
              }
            }
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "duration_seconds": {
                  "type": "number"
                },
                "duration_minutes": {
                  "type": "number"
                },
                "timestamp": {
                  "type": "string",
                  "format": "date-time"
                },
                "month": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "quota_info": {
            "type": "object",
            "properties": {
              "plan": {
                "type": "string"
              },
              "quota_minutes": {
                "type": "number"
              },
              "reset_day": {
                "type": "integer"
              },
              "next_reset": {
                "type": "string",
                "format": "date"
              }
            }
          }
        }
      },
      "ConnectionStatusPayload": {
        "type": "object",
        "description": "Payload sent to your webhook URL when a social account connection status changes.",
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "social_account.connected",
              "social_account.disconnected",
              "social_account.reauth_required"
            ],
            "description": "The connection status event type."
          },
          "user_email": {
            "type": "string",
            "description": "The email address of the account owner."
          },
          "platform": {
            "type": "string",
            "description": "The social platform (e.g., instagram, youtube, tiktok, x, linkedin, facebook, threads, pinterest, reddit, bluesky, google_business)."
          },
          "account_name": {
            "type": "string",
            "description": "The account identifier on the platform."
          },
          "status": {
            "type": "string",
            "enum": [
              "connected",
              "disconnected",
              "reauth_required"
            ],
            "description": "The new connection status."
          },
          "profile_username": {
            "type": "string",
            "nullable": true,
            "description": "The Upload-Post profile associated with this account."
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Additional context for the status change (e.g., manual_disconnect, account_blocked, token_refresh_threshold_exceeded)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp of the event in ISO 8601 format."
          }
        }
      },
      "WebhookPayload": {
        "type": "object",
        "description": "Payload sent to your webhook URL when an upload completes.",
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "upload_completed"
            ],
            "description": "Event type."
          },
          "user_email": {
            "type": "string"
          },
          "profile_username": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "media_type": {
            "type": "string",
            "enum": [
              "video",
              "photo",
              "text"
            ]
          },
          "title": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "url": {
                "type": "string",
                "nullable": true
              },
              "publish_id": {
                "type": "string",
                "nullable": true
              },
              "post_id": {
                "type": "string",
                "nullable": true
              },
              "error": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookDeliveryAttempt": {
        "type": "object",
        "properties": {
          "attempt": {
            "type": "integer"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean"
          },
          "status_code": {
            "type": "integer",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true,
            "description": "timeout, connection_error or another short label when there was no HTTP answer"
          },
          "duration_ms": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "description": "One logged webhook delivery (kept 7 days).",
        "properties": {
          "delivery_id": {
            "type": "string",
            "description": "Same value as the X-Upload-Post-Delivery header; identical on every retry."
          },
          "event": {
            "type": "string",
            "example": "upload_completed"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed",
              "cancelled"
            ]
          },
          "target": {
            "type": "string",
            "enum": [
              "account",
              "profile",
              "subscription"
            ]
          },
          "profile_username": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "description": "Webhook URL without its query string."
          },
          "request_id": {
            "type": "string",
            "nullable": true
          },
          "job_id": {
            "type": "string",
            "nullable": true
          },
          "platform": {
            "type": "string",
            "nullable": true
          },
          "test": {
            "type": "boolean",
            "description": "true for deliveries sent by POST /uploadposts/users/notifications/test (never retried)."
          },
          "attempt_count": {
            "type": "integer"
          },
          "max_attempts": {
            "type": "integer",
            "example": 6
          },
          "last_status_code": {
            "type": "integer",
            "nullable": true
          },
          "last_error": {
            "type": "string",
            "nullable": true,
            "description": "Short error label, or why the delivery is waiting/closed: channel_paused, expired, webhook_removed, event_unsubscribed, blocked_url, retries_disabled."
          },
          "next_attempt_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "delivered_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "redelivery_of": {
            "type": "string",
            "nullable": true,
            "description": "delivery_id of the original, on a manual redelivery."
          },
          "redelivery_count": {
            "type": "integer"
          },
          "attempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryAttempt"
            }
          },
          "payload": {
            "type": "object",
            "nullable": true,
            "description": "Exact body that was sent. In the list only with include_payload=true; always in the single-delivery and redeliver responses."
          },
          "subscription_id": {
            "type": "string",
            "nullable": true,
            "description": "Webhook subscription that received it (target subscription)."
          }
        }
      },
      "WebhookDeliveryError": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "message": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "AutoDMRule": {
        "type": "object",
        "description": "Account-wide Instagram AutoDM rule.",
        "properties": {
          "rule_id": {
            "type": "string",
            "example": "rule_4f1c2a9e0b7d4c51a2e3f6b8"
          },
          "scope": {
            "type": "string",
            "example": "account"
          },
          "platform": {
            "type": "string",
            "example": "instagram"
          },
          "profile_username": {
            "type": "string"
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "comment",
                "story_reply",
                "story_mention",
                "dm_keyword"
              ]
            }
          },
          "trigger_keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reply_message": {
            "type": "string"
          },
          "buttons": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "example": "web_url"
                },
                "url": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              }
            }
          },
          "per_user_cooldown_hours": {
            "type": "integer"
          },
          "message_cooldown_hours": {
            "type": "integer",
            "description": "Effective cooldown for story_reply, story_mention and dm_keyword: never below 24."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "reconnect_required",
              "stopped",
              "disabled"
            ]
          },
          "stop_reason": {
            "type": "string",
            "nullable": true,
            "enum": [
              "account_moved",
              "account_disconnected",
              "profile_unlinked",
              "profile_deleted",
              "user_missing",
              null
            ]
          },
          "is_paused": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "paused_at": {
            "type": "string",
            "nullable": true
          },
          "last_triggered_at": {
            "type": "string",
            "nullable": true
          },
          "last_sent_at": {
            "type": "string",
            "nullable": true
          },
          "stats": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "successful_replies, failed_replies, skipped_cooldown, deferred, plus per-trigger <trigger>_triggers / <trigger>_replies and unknown_outcome once they count something."
          },
          "pending": {
            "type": "integer",
            "description": "Events waiting to be sent."
          },
          "webhook": {
            "type": "object",
            "properties": {
              "subscribed": {
                "type": "boolean"
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "receiving_events": {
                "type": "boolean"
              },
              "last_event_at": {
                "type": "string",
                "nullable": true
              },
              "last_event_age_hours": {
                "type": "number",
                "nullable": true
              },
              "hint": {
                "type": "string",
                "nullable": true,
                "description": "Plain-language hint when subscribed but no event arrived in the last 6 hours."
              },
              "error": {
                "type": "string",
                "nullable": true
              }
            }
          }
        }
      },
      "BlueskyError": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "confirmation_required",
              "bluesky_invalid_parameter",
              "bluesky_missing_parameter",
              "bluesky_method_not_allowed",
              "bluesky_user_required",
              "bluesky_not_connected",
              "bluesky_rejected",
              "bluesky_not_found",
              "bluesky_blocked",
              "bluesky_auth_required",
              "bluesky_reauth_required",
              "bluesky_rate_limited",
              "bluesky_read_rate_limited",
              "bluesky_edge_rate_limited",
              "bluesky_read_capacity",
              "bluesky_reads_disabled",
              "bluesky_notification_writes_disabled",
              "bluesky_unavailable",
              "unsupported_platform",
              "bluesky_private_read_disabled",
              "bluesky_login_failed",
              "bluesky_session_unavailable"
            ]
          },
          "retry_after": {
            "type": "integer",
            "description": "Seconds (429/503)."
          },
          "allowed_methods": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "bluesky_method_not_allowed only."
          },
          "unknown_parameters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bluesky_error": {
            "type": "string",
            "description": "Bluesky's own error name, when it gives one."
          }
        }
      },
      "BlueskyAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "DID."
          },
          "handle": {
            "type": "string"
          },
          "display_name": {
            "type": "string",
            "nullable": true
          },
          "avatar": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "followers_count": {
            "type": "integer"
          },
          "follows_count": {
            "type": "integer"
          },
          "posts_count": {
            "type": "integer"
          },
          "banner": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "indexed_at": {
            "type": "string",
            "format": "date-time"
          },
          "pinned_post_id": {
            "type": "string"
          },
          "viewer": {
            "type": "object",
            "additionalProperties": true
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "description": "id, handle, display_name, avatar and url always; the rest when Bluesky returns them."
      },
      "BlueskyPost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "at:// URI."
          },
          "cid": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "author": {
            "$ref": "#/components/schemas/BlueskyAccount"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "indexed_at": {
            "type": "string",
            "format": "date-time"
          },
          "like_count": {
            "type": "integer"
          },
          "repost_count": {
            "type": "integer"
          },
          "reply_count": {
            "type": "integer"
          },
          "quote_count": {
            "type": "integer"
          },
          "bookmark_count": {
            "type": "integer"
          },
          "langs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "media_type": {
            "type": "string",
            "enum": [
              "IMAGE",
              "VIDEO",
              "CAROUSEL_ALBUM",
              "TEXT"
            ]
          },
          "media_url": {
            "type": "string",
            "nullable": true
          },
          "thumbnail_url": {
            "type": "string",
            "nullable": true
          },
          "reply_to": {
            "type": "string",
            "nullable": true
          },
          "thread_root": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "BlueskyPagination": {
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": "string",
            "nullable": true
          },
          "has_more": {
            "type": "boolean"
          }
        }
      },
      "BlueskyActionError": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "retry_after": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "resets_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BlueskyResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "platform": {
            "type": "string",
            "example": "bluesky"
          },
          "action": {
            "type": "string"
          },
          "record_uri": {
            "type": "string"
          },
          "changed": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "CodedError": {
        "type": "object",
        "description": "Error body with a stable machine-readable code. See the error code catalog in the docs.",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error_code": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "Same value as error_code (team access errors only)."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "WebhookSubscription": {
        "type": "object",
        "description": "One extra webhook destination of the account (n8n trigger, REST hook...). Independent from the account webhook_url.",
        "properties": {
          "id": {
            "type": "string",
            "example": "whsub_65f0c2a9e1b4d7c3a8f9e012"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public https URL (max 2048 characters)."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Event names this destination receives (sorted, unique)."
          },
          "profile_username": {
            "type": "string",
            "nullable": true,
            "description": "Only events of this profile; null = every profile of the account."
          },
          "source": {
            "type": "string",
            "nullable": true,
            "example": "n8n",
            "description": "Free label of the integration that created it (a-z, 0-9, _ . -; max 40)."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Free label (max 100)."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": "string",
            "nullable": true,
            "enum": [
              "endpoint_gone",
              "failing_too_long",
              "blocked_url",
              "profile_removed",
              null
            ],
            "description": "Why Upload-Post stopped sending: the URL answered 404/410 repeatedly, it kept failing for days, it is not an allowed destination, or its profile was deleted. A disabled subscription stays listed for 30 days; create it again to re-enable it."
          },
          "disabled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_delivery_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "health": {
            "type": "object",
            "properties": {
              "consecutive_failures": {
                "type": "integer"
              },
              "last_failure": {
                "type": "string",
                "nullable": true,
                "description": "Short label of the last failure (e.g. http_500, timeout, dns)."
              },
              "last_failure_at": {
                "type": "string",
                "nullable": true
              },
              "paused_until": {
                "type": "string",
                "nullable": true
              }
            }
          }
        }
      },
      "WebhookSubscriptionError": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "reason": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "allowed_events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With invalid_events / invalid_event."
          },
          "limit": {
            "type": "integer",
            "description": "With subscription_limit_reached."
          }
        }
      },
      "TeamAccessError": {
        "type": "object",
        "description": "Team access refusal (roles on).",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error_code": {
            "type": "string",
            "enum": [
              "team_role_forbidden",
              "team_profile_forbidden",
              "team_approvals_disabled",
              "team_page_not_pinned",
              "team_page_forbidden",
              "team_access_unavailable"
            ]
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "permission": {
            "type": "string"
          }
        }
      },
      "PostApproval": {
        "type": "object",
        "description": "A post waiting for (or past) review. Created when an Editor (pending_approval) or a Contributor (draft) publishes.",
        "properties": {
          "approval_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_approval",
              "draft",
              "approving",
              "approved",
              "rejected",
              "withdrawn",
              "expired"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "approval",
              "draft"
            ]
          },
          "version": {
            "type": "integer",
            "description": "Goes up by one on every edit; approve sends the version it reviewed."
          },
          "profile_username": {
            "type": "string"
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "post_type": {
            "type": "string",
            "example": "video"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "caption": {
            "type": "string",
            "nullable": true
          },
          "platform_content": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "caption": {
                  "type": "string"
                }
              }
            }
          },
          "immediate": {
            "type": "boolean",
            "description": "Publish as soon as it is approved (no date of its own)."
          },
          "queued": {
            "type": "boolean",
            "description": "Sent with add_to_queue: the queue slot is picked when it is approved."
          },
          "scheduled_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "author_email": {
            "type": "string"
          },
          "author_role": {
            "type": "string",
            "enum": [
              "editor",
              "contributor"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_by": {
            "type": "string",
            "nullable": true,
            "description": "Email of the reviewer, or client:<profile> for the end client."
          },
          "decided_by_role": {
            "type": "string",
            "nullable": true
          },
          "decided_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "decision_comment": {
            "type": "string",
            "nullable": true
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "Scheduled job created on approval."
          },
          "request_id": {
            "type": "string",
            "nullable": true
          },
          "external_id": {
            "type": "string",
            "nullable": true
          },
          "destinations": {
            "type": "object",
            "properties": {
              "facebook_page_id": {
                "type": "string",
                "nullable": true
              },
              "linkedin_page_id": {
                "type": "string",
                "nullable": true
              },
              "pinterest_board_id": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "destinations_effective": {
            "type": "object",
            "description": "Detail only: the Page actually used when publishing (the one pinned to the profile wins) and its name."
          },
          "fields": {
            "type": "object",
            "additionalProperties": true,
            "description": "Detail only: the platform options sent with the post."
          },
          "has_preview": {
            "type": "boolean",
            "description": "Listings only."
          },
          "preview_url": {
            "type": "string",
            "nullable": true,
            "description": "Short-lived signed URL (detail, and the first 50 items of a listing)."
          },
          "thumbnail_url": {
            "type": "string",
            "nullable": true,
            "description": "Short-lived signed URL."
          }
        }
      },
      "ActionError": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "description": "Error of an action endpoint: a human `error` (or `message`) and, when there is one, a stable `error_code`."
      },
      "AutoDMMonitor": {
        "type": "object",
        "properties": {
          "monitor_id": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "post_url": {
            "type": "string",
            "nullable": true
          },
          "post_id": {
            "type": "string",
            "nullable": true
          },
          "reply_message": {
            "type": "string"
          },
          "profile_username": {
            "type": "string"
          },
          "monitoring_interval": {
            "type": "integer"
          },
          "is_active": {
            "type": "boolean"
          },
          "is_running": {
            "type": "boolean"
          },
          "is_paused": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "paused",
              "resuming",
              "stopped",
              "expired"
            ]
          },
          "stats": {
            "type": "object",
            "properties": {
              "total_comments": {
                "type": "integer"
              },
              "new_comments": {
                "type": "integer"
              },
              "successful_replies": {
                "type": "integer"
              },
              "failed_replies": {
                "type": "integer"
              }
            }
          },
          "created_at": {
            "type": "string"
          },
          "last_check": {
            "type": "string",
            "nullable": true
          },
          "paused_at": {
            "type": "string",
            "nullable": true
          },
          "stopped_at": {
            "type": "string",
            "nullable": true
          },
          "stop_reason": {
            "type": "string",
            "nullable": true,
            "description": "e.g. post_not_found, reconnect_required."
          }
        }
      },
      "PostAnalyticsPlatform": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "platform_post_id": {
            "type": "string"
          },
          "post_url": {
            "type": "string",
            "nullable": true
          },
          "post_metrics": {
            "type": "object",
            "additionalProperties": true,
            "description": "Metric name -> value; keys depend on the platform (see available_metrics)."
          },
          "post_metrics_source": {
            "type": "string",
            "nullable": true
          },
          "post_metrics_error": {
            "type": "string",
            "nullable": true
          },
          "available_metrics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metric_labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "primary_impressions_field": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "GbpError": {
        "type": "object",
        "description": "Google Business error. `error_code` (same value in `code`) is stable; `error` is the message for people. Common codes on every endpoint: 401 `google_business_reconnect_required` (reconnect Google Business), 403 `google_business_permission_denied`, 429 `google_rate_limited` (with `retry_after_seconds`), 502 `google_unreachable` (safe to retry) and `google_result_unknown` (a write may have been applied: check before retrying), 503 `gbp_feature_disabled` (the action is temporarily switched off). The endpoints that existed first (locations, reviews list, reply and batch) may answer some errors with only `error` or `message`.",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "description": "Human readable message."
          },
          "message": {
            "type": "string",
            "description": "Message on some older endpoints instead of `error`."
          },
          "code": {
            "type": "string",
            "description": "Same value as `error_code`."
          },
          "error_code": {
            "type": "string",
            "example": "location_required"
          },
          "retry_after_seconds": {
            "type": "integer"
          },
          "scope": {
            "type": "string",
            "description": "Which limit was reached (daily limits)."
          },
          "daily_limit": {
            "type": "integer"
          },
          "feature": {
            "type": "string",
            "description": "With `gbp_feature_disabled`."
          },
          "action": {
            "type": "string",
            "description": "With `confirmation_required`."
          },
          "available_locations": {
            "type": "array",
            "description": "With `location_required`.",
            "items": {
              "type": "object",
              "properties": {
                "location_id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              }
            }
          },
          "errors": {
            "description": "With `invalid_field`: what failed validation."
          },
          "google_error": {
            "type": "object",
            "additionalProperties": true,
            "description": "Google's error details (e.g. `fieldViolations`)."
          },
          "request_id": {
            "type": "string",
            "description": "Location creation only."
          },
          "outcome_unknown": {
            "type": "boolean",
            "description": "Google did not confirm a write."
          }
        },
        "example": {
          "success": false,
          "code": "location_required",
          "error_code": "location_required",
          "error": "This Google Business account has several locations: pass location_id.",
          "available_locations": [
            {
              "location_id": "locations/111",
              "title": "Agence Dupont"
            }
          ]
        }
      },
      "GbpEditStatus": {
        "type": "object",
        "additionalProperties": true,
        "description": "Google's moderation stage of each edited field or attribute (experimental Google API). Stages: `PENDING`, `ACCEPTED`, `REJECTED` (see `rejection_reason`), `UPDATED_BY_GOOGLE`, `DRAFT`. If Google does not return it the edit still succeeds and the answer carries `warnings`.",
        "properties": {
          "fields": {
            "type": "object",
            "description": "Location info: per field.",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "stage": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "update_time": {
                  "type": "string"
                },
                "rejection_reason": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          },
          "attributes": {
            "type": "object",
            "description": "Attributes: per attribute.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "pending_review": {
            "type": "boolean"
          },
          "rejected": {
            "type": "boolean"
          },
          "experimental": {
            "type": "boolean"
          },
          "channel": {
            "type": "string"
          }
        }
      },
      "GbpLocationInfoView": {
        "type": "object",
        "additionalProperties": true,
        "description": "Flat, readable view of a Google Business location.",
        "properties": {
          "location_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "additional_phones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "website": {
            "type": "string"
          },
          "primary_category": {
            "type": "string"
          },
          "primary_category_name": {
            "type": "string"
          },
          "additional_categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "regular_hours": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "special_hours": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "address": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "open_status": {
            "type": "string"
          },
          "opening_date": {
            "type": "string",
            "nullable": true
          },
          "store_code": {
            "type": "string",
            "nullable": true
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ad_phone": {
            "type": "string",
            "nullable": true
          },
          "service_area": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
          },
          "more_hours": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "parent_chain": {
            "type": "string",
            "nullable": true
          },
          "service_items": {
            "type": "integer"
          },
          "maps_uri": {
            "type": "string"
          },
          "place_id": {
            "type": "string"
          },
          "has_pending_edits": {
            "type": "boolean"
          },
          "has_google_updated": {
            "type": "boolean"
          },
          "has_voice_of_merchant": {
            "type": "boolean"
          },
          "can_delete": {
            "type": "boolean"
          }
        }
      },
      "NotificationSettings": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "channels": {
            "type": "object",
            "properties": {
              "webhook": {
                "type": "boolean"
              },
              "telegram": {
                "type": "boolean"
              },
              "slack": {
                "type": "boolean"
              },
              "whatsapp": {
                "type": "boolean"
              }
            }
          },
          "webhook_url": {
            "type": "string",
            "nullable": true
          },
          "webhook_secret": {
            "type": "string",
            "nullable": true,
            "description": "Signs every webhook (X-Upload-Post-Signature)."
          },
          "webhook_events": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "type": "boolean"
                },
                "description": "Event name -> enabled."
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/WebhookEventName"
                },
                "description": "Names of the enabled events."
              }
            ],
            "description": "Which events the account webhook receives: an object {event: true|false} or a list of names; both are stored as sent and returned the same way. Omitted or empty = every event except the opt-in ones."
          },
          "telegram_chat_id": {
            "type": "string",
            "nullable": true
          },
          "slack_webhook_url": {
            "type": "string",
            "nullable": true
          },
          "whatsapp_to_phone": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "ChatgptAdsError": {
        "type": "object",
        "description": "ChatGPT Ads error. There is no `error_code`: branch on the HTTP status; `message` carries the reason (OpenAI's own reason on a 400 it rejected).",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Promote only: `{\"created\": {campaign_id, ad_group_id, ad_id}}` already created when a later step failed.",
            "properties": {
              "created": {
                "type": "object",
                "properties": {
                  "campaign_id": {
                    "type": "string"
                  },
                  "ad_group_id": {
                    "type": "string"
                  },
                  "ad_id": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "error_type": {
            "type": "string",
            "description": "`rate_limit` on Upload-Post's own 429."
          }
        },
        "example": {
          "success": false,
          "message": "ChatGPT Ads rejected the stored API key. Issue a new one in Ads Manager (https://ads.openai.com → Settings → API keys) and reconnect the account."
        }
      },
      "ChatgptAdsAccount": {
        "type": "object",
        "description": "A connected ChatGPT Ads account. The API key is never returned.",
        "properties": {
          "ad_account_id": {
            "type": "string",
            "example": "adacct_123"
          },
          "name": {
            "type": "string"
          },
          "currency_code": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "review_status": {
            "type": "string",
            "nullable": true
          },
          "default": {
            "type": "boolean"
          },
          "connected_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "profiles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Profiles linked to this account (list; on connect only the one passed)."
          }
        }
      },
      "MediaUpload": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "upload_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "uploaded",
              "deleted",
              "rejected"
            ]
          },
          "media_type": {
            "type": "string",
            "enum": [
              "video",
              "image",
              "document"
            ]
          },
          "filename": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "bytes_expected": {
            "type": "integer",
            "nullable": true
          },
          "bytes_actual": {
            "type": "integer",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "media_url": {
            "type": "string",
            "description": "Signed URL to pass as the media URL of an upload (when uploaded and include_url)."
          },
          "media_url_expires_in_seconds": {
            "type": "integer"
          }
        }
      },
      "WebhookEventName": {
        "type": "string",
        "enum": [
          "upload_completed",
          "social_account_connected",
          "social_account_disconnected",
          "social_account_reauth_required",
          "dm_received",
          "comment_received",
          "review_received",
          "review_updated",
          "customer_media_received",
          "listing_google_update",
          "listing_duplicate",
          "listing_control_changed",
          "telegram_update",
          "post_analytics_updated",
          "youtube_video_published",
          "youtube_video_updated",
          "post_approval_requested",
          "post_approved",
          "post_rejected",
          "post_approval_expired"
        ],
        "description": "Webhook event name (dots are accepted too: social_account.connected). youtube_video_* are accepted only while YouTube push is on, post_approval_* only while post approvals are on. dm_received, comment_received, telegram_update, the Google Business events, post_analytics_updated and the gated ones are opt-in: they are only sent if listed."
      },
      "ClientPostApproval": {
        "type": "object",
        "description": "A post waiting for approval as the end client sees it (connect page): never the author, who decided, or internal ids (author_email, author_role, decided_by, decided_by_role, request_id, external_id, job_id, fields are left out).",
        "properties": {
          "approval_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_approval",
              "draft",
              "approving",
              "approved",
              "rejected",
              "withdrawn",
              "expired"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "approval",
              "draft"
            ]
          },
          "version": {
            "type": "integer",
            "description": "Goes up by one on every edit; approve sends the version it reviewed."
          },
          "profile_username": {
            "type": "string"
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "post_type": {
            "type": "string",
            "example": "video"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "caption": {
            "type": "string",
            "nullable": true
          },
          "platform_content": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "caption": {
                  "type": "string"
                }
              }
            }
          },
          "immediate": {
            "type": "boolean",
            "description": "Publish as soon as it is approved (no date of its own)."
          },
          "queued": {
            "type": "boolean",
            "description": "Sent with add_to_queue: the queue slot is picked when it is approved."
          },
          "scheduled_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "decision_comment": {
            "type": "string",
            "nullable": true
          },
          "destinations": {
            "type": "object",
            "properties": {
              "facebook_page_id": {
                "type": "string",
                "nullable": true
              },
              "linkedin_page_id": {
                "type": "string",
                "nullable": true
              },
              "pinterest_board_id": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "destinations_effective": {
            "type": "object",
            "description": "Detail only: the Page actually used when publishing (the one pinned to the profile wins) and its name."
          },
          "has_preview": {
            "type": "boolean",
            "description": "Listings only."
          },
          "preview_url": {
            "type": "string",
            "nullable": true,
            "description": "Short-lived signed URL (detail, and the first 50 items of a listing)."
          },
          "thumbnail_url": {
            "type": "string",
            "nullable": true,
            "description": "Short-lived signed URL."
          }
        }
      }
    }
  }
}
