{
  "openapi": "3.1.0",
  "info": {
    "title": "PostGuild Publishing API",
    "version": "0.2.0",
    "description": "Publishing, scheduling, media processing, profiles, webhooks, and management of connected Facebook, Instagram, X, YouTube, and TikTok accounts. Some operations need additional provider grants."
  },
  "servers": [
    {
      "url": "/",
      "description": "The origin serving this document"
    }
  ],
  "security": [
    {
      "BearerApiKey": []
    },
    {
      "Apikey": []
    }
  ],
  "tags": [
    {
      "name": "Publishing"
    },
    {
      "name": "Profiles"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Queue",
      "description": "Fixed posting slots and availability"
    },
    {
      "name": "Media",
      "description": "Signed staging uploads and managed video processing"
    },
    {
      "name": "Meta management",
      "description": "Facebook Pages, Instagram Professional, comments, and messages"
    },
    {
      "name": "YouTube management",
      "description": "Channel data, management, live streams, and reports"
    },
    {
      "name": "X management",
      "description": "Metered mentions, account reads, and list actions"
    },
    {
      "name": "TikTok management",
      "description": "Creator settings and advertiser operations"
    },
    {
      "name": "Teams and approvals",
      "description": "Workspace delegation and post approval"
    }
  ],
  "paths": {
    "/api/analytics/{slug}": {
      "get": {
        "summary": "Get connected channel metrics",
        "description": "Returns current cumulative YouTube Data API counters for the selected channel. Other connected platforms have unsupported status. Subscriber counts can be rounded or hidden by YouTube.",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "analytics": {
                      "type": "object",
                      "additionalProperties": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "const": "available"
                              },
                              "metrics": {
                                "type": "object",
                                "properties": {
                                  "views": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "pattern": "^[0-9]+$",
                                    "description": "Provider count as a decimal string, or null when unavailable."
                                  },
                                  "subscribers": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "pattern": "^[0-9]+$",
                                    "description": "Provider count as a decimal string, or null when unavailable."
                                  },
                                  "videos": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "pattern": "^[0-9]+$",
                                    "description": "Provider count as a decimal string, or null when unavailable."
                                  }
                                },
                                "required": [
                                  "views",
                                  "subscribers",
                                  "videos"
                                ]
                              },
                              "measured_at": {
                                "type": "string",
                                "format": "date-time"
                              }
                            },
                            "required": [
                              "status",
                              "metrics",
                              "measured_at"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "enum": [
                                  "unavailable",
                                  "unsupported"
                                ]
                              },
                              "metrics": {
                                "type": "null"
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "status",
                              "metrics",
                              "reason"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "profile_username",
                    "analytics"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/upload": {
      "post": {
        "summary": "Queue a video publish",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Reuse for the same submission when retrying a request."
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "video"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "A future ISO 8601 timestamp with an explicit UTC offset. Omit for immediate queueing."
                  },
                  "external_id": {
                    "type": "string",
                    "maxLength": 150,
                    "description": "An optional caller reference returned in status and history."
                  },
                  "platform[]": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Platform"
                        },
                        {
                          "type": "string",
                          "const": "twitter"
                        }
                      ]
                    },
                    "maxItems": 5,
                    "minItems": 1
                  },
                  "platforms[]": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Platform"
                        },
                        {
                          "type": "string",
                          "const": "twitter"
                        }
                      ]
                    },
                    "maxItems": 5,
                    "minItems": 1
                  },
                  "video": {
                    "type": "string",
                    "format": "binary"
                  },
                  "tiktok_privacy_level": {
                    "type": "string",
                    "description": "The visibility selected by the TikTok account owner."
                  },
                  "tiktok_consent": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ],
                    "description": "True only after the account owner consents to this post."
                  },
                  "disable_comment": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "disable_duet": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "disable_stitch": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "youtube_visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private",
                      "unlisted"
                    ]
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON object of provider options. When set, replaces the individual option fields."
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "add_to_queue": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "max_posts_per_slot": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "platform[]"
                    ]
                  },
                  {
                    "required": [
                      "platforms[]"
                    ]
                  }
                ]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "text": {
                    "type": "string"
                  },
                  "scheduled_date": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "add_to_queue": {
                    "type": "boolean"
                  },
                  "media_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "video": {
                    "type": "string"
                  },
                  "max_posts_per_slot": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "required": [
                  "user",
                  "platforms"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedPost"
                }
              }
            }
          },
          "202": {
            "description": "Publish request accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedPost"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Editors create pending approvals, and Contributors save drafts. Delegated media must be attached directly. Delegated TikTok publishing is unavailable."
      }
    },
    "/api/upload_photos": {
      "post": {
        "summary": "Queue a photo publish",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Reuse for the same submission when retrying a request."
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "photos[]"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "A future ISO 8601 timestamp with an explicit UTC offset. Omit for immediate queueing."
                  },
                  "external_id": {
                    "type": "string",
                    "maxLength": 150,
                    "description": "An optional caller reference returned in status and history."
                  },
                  "platform[]": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Platform"
                        },
                        {
                          "type": "string",
                          "const": "twitter"
                        }
                      ]
                    },
                    "maxItems": 5,
                    "minItems": 1
                  },
                  "platforms[]": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Platform"
                        },
                        {
                          "type": "string",
                          "const": "twitter"
                        }
                      ]
                    },
                    "maxItems": 5,
                    "minItems": 1
                  },
                  "photos[]": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "maxItems": 10,
                    "minItems": 1
                  },
                  "tiktok_privacy_level": {
                    "type": "string",
                    "description": "The visibility selected by the TikTok account owner."
                  },
                  "tiktok_consent": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ],
                    "description": "True only after the account owner consents to this post."
                  },
                  "disable_comment": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "disable_duet": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "disable_stitch": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "youtube_visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private",
                      "unlisted"
                    ]
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON object of provider options. When set, replaces the individual option fields."
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "add_to_queue": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "max_posts_per_slot": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "platform[]"
                    ]
                  },
                  {
                    "required": [
                      "platforms[]"
                    ]
                  }
                ]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "text": {
                    "type": "string"
                  },
                  "scheduled_date": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "add_to_queue": {
                    "type": "boolean"
                  },
                  "media_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "photos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "max_posts_per_slot": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "required": [
                  "user",
                  "platforms"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedPost"
                }
              }
            }
          },
          "202": {
            "description": "Publish request accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedPost"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Editors create pending approvals, and Contributors save drafts. Delegated media must be attached directly. Delegated TikTok publishing is unavailable."
      }
    },
    "/api/upload_text": {
      "post": {
        "summary": "Queue a text publish",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Reuse for the same submission when retrying a request."
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "A future ISO 8601 timestamp with an explicit UTC offset. Omit for immediate queueing."
                  },
                  "external_id": {
                    "type": "string",
                    "maxLength": 150,
                    "description": "An optional caller reference returned in status and history."
                  },
                  "platform[]": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Platform"
                        },
                        {
                          "type": "string",
                          "const": "twitter"
                        }
                      ]
                    },
                    "maxItems": 5,
                    "minItems": 1
                  },
                  "platforms[]": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Platform"
                        },
                        {
                          "type": "string",
                          "const": "twitter"
                        }
                      ]
                    },
                    "maxItems": 5,
                    "minItems": 1
                  },
                  "tiktok_privacy_level": {
                    "type": "string",
                    "description": "The visibility selected by the TikTok account owner."
                  },
                  "tiktok_consent": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ],
                    "description": "True only after the account owner consents to this post."
                  },
                  "disable_comment": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "disable_duet": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "disable_stitch": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "youtube_visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private",
                      "unlisted"
                    ]
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON object of provider options. When set, replaces the individual option fields."
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "add_to_queue": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  },
                  "max_posts_per_slot": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "platform[]"
                    ]
                  },
                  {
                    "required": [
                      "platforms[]"
                    ]
                  }
                ]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "A future ISO 8601 timestamp with an explicit UTC offset. Omit for immediate queueing."
                  },
                  "external_id": {
                    "type": "string",
                    "maxLength": 150,
                    "description": "An optional caller reference returned in status and history."
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Platform"
                        },
                        {
                          "type": "string",
                          "const": "twitter"
                        }
                      ]
                    },
                    "maxItems": 5,
                    "minItems": 1
                  },
                  "platform": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Platform"
                        },
                        {
                          "type": "string",
                          "const": "twitter"
                        }
                      ]
                    },
                    "maxItems": 5,
                    "minItems": 1
                  },
                  "options": {
                    "type": "object"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "add_to_queue": {
                    "type": "boolean"
                  },
                  "max_posts_per_slot": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "platforms"
                    ]
                  },
                  {
                    "required": [
                      "platform"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedPost"
                }
              }
            }
          },
          "202": {
            "description": "Publish request accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedPost"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Editors create pending approvals, and Contributors save drafts. Delegated media must be attached directly. Delegated TikTok publishing is unavailable."
      }
    },
    "/api/uploadposts/ads/tiktok/account": {
      "get": {
        "summary": "GET ads tiktok account",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/accounts": {
      "get": {
        "summary": "GET ads tiktok accounts",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "operationId": "attachTikTokAdsAdvertiser",
        "summary": "Attach an authorized TikTok advertiser",
        "tags": [
          "TikTok management"
        ],
        "description": "Connects an advertiser from an unexpired grant owned by the account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "grant_id": {
                    "type": "string"
                  },
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  }
                },
                "required": [
                  "grant_id",
                  "advertiser_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "account": {
                      "type": "object",
                      "properties": {
                        "advertiser_id": {
                          "type": "string",
                          "pattern": "^[0-9]{1,25}$"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connected_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/accounts/{advertiserId}": {
      "delete": {
        "summary": "DELETE ads tiktok accounts",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "advertiserId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/adgroups": {
      "get": {
        "summary": "List TikTok advertiser adgroups",
        "description": "Account- and advertiser-scoped TikTok Ads read.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "operationId": "createTikTokAdsGroup",
        "summary": "Create a disabled TikTok Traffic ad group",
        "tags": [
          "TikTok management"
        ],
        "description": "Uses an owned disabled manual Traffic campaign and location IDs. Lifetime budgets require an end date. Status stays disabled.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "goal": {
                    "type": "string",
                    "const": "traffic"
                  },
                  "budget": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "daily",
                          "lifetime"
                        ]
                      },
                      "amount": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 1000000
                      }
                    },
                    "required": [
                      "amount"
                    ]
                  },
                  "targeting": {
                    "type": "object",
                    "properties": {
                      "location_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[0-9]{1,25}$"
                        }
                      }
                    },
                    "required": [
                      "location_ids"
                    ]
                  },
                  "schedule": {
                    "type": "object",
                    "properties": {
                      "start_date": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "end_date": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "start_date"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "const": "paused"
                  },
                  "request_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,19}$"
                  },
                  "campaign_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  }
                },
                "required": [
                  "advertiser_id",
                  "campaign_id",
                  "name",
                  "goal",
                  "budget",
                  "targeting",
                  "schedule",
                  "request_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "adgroup_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "adgroup": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/adgroups/{id}": {
      "get": {
        "summary": "Read TikTok adgroups object",
        "description": "Select the relevant connected advertiser.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "patch": {
        "summary": "Rename TikTok adgroups object",
        "description": "Requires advertiser_id, name, and confirm: true. This operation only changes the name.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/adgroups/{id}/delete": {
      "post": {
        "summary": "delete TikTok adgroups object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/adgroups/{id}/insights": {
      "get": {
        "summary": "Read TikTok adgroups insights",
        "description": "Report on an object owned by the selected advertiser.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/adgroups/{id}/pause": {
      "post": {
        "summary": "pause TikTok adgroups object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/adgroups/{id}/resume": {
      "post": {
        "summary": "resume TikTok adgroups object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/ads": {
      "get": {
        "summary": "List TikTok advertiser ads",
        "description": "Account- and advertiser-scoped TikTok Ads read.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "operationId": "createTikTokAdsSparkAd",
        "summary": "Create a disabled TikTok Spark ad",
        "tags": [
          "TikTok management"
        ],
        "description": "Uses an owned disabled Traffic ad group, a connected TT_USER identity, and a video TikTok confirms for that identity.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "goal": {
                    "type": "string",
                    "const": "traffic"
                  },
                  "identity_id": {
                    "type": "string"
                  },
                  "identity_type": {
                    "type": "string",
                    "const": "TT_USER"
                  },
                  "post_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "landing_page_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "call_to_action": {
                    "type": "string",
                    "enum": [
                      "LEARN_MORE",
                      "SHOP_NOW",
                      "SIGN_UP"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "const": "paused"
                  },
                  "request_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,19}$"
                  },
                  "adgroup_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  }
                },
                "required": [
                  "advertiser_id",
                  "adgroup_id",
                  "name",
                  "identity_id",
                  "post_id",
                  "landing_page_url",
                  "request_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "ad_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "ad": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/ads/{id}": {
      "get": {
        "summary": "Read TikTok ads object",
        "description": "Select the relevant connected advertiser.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "patch": {
        "summary": "Rename TikTok ads object",
        "description": "Requires advertiser_id, name, and confirm: true. This operation only changes the name.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/ads/{id}/delete": {
      "post": {
        "summary": "delete TikTok ads object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/ads/{id}/insights": {
      "get": {
        "summary": "Read TikTok ads insights",
        "description": "Report on an object owned by the selected advertiser.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/ads/{id}/pause": {
      "post": {
        "summary": "pause TikTok ads object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/ads/{id}/resume": {
      "post": {
        "summary": "resume TikTok ads object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/audiences": {
      "get": {
        "summary": "List TikTok advertiser audiences",
        "description": "Account- and advertiser-scoped TikTok Ads read.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/campaigns": {
      "get": {
        "summary": "List TikTok advertiser campaigns",
        "description": "Account- and advertiser-scoped TikTok Ads read.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "Create a disabled TikTok campaign",
        "description": "Requires enabled paused-campaign creation, an explicit paused state, and an advertiser authorization.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/campaigns/{id}": {
      "get": {
        "summary": "Read TikTok campaigns object",
        "description": "Select the relevant connected advertiser.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "patch": {
        "summary": "Rename TikTok campaigns object",
        "description": "Requires advertiser_id, name, and confirm: true. This operation only changes the name.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/campaigns/{id}/delete": {
      "post": {
        "summary": "delete TikTok campaigns object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/campaigns/{id}/insights": {
      "get": {
        "summary": "Read TikTok campaigns insights",
        "description": "Report on an object owned by the selected advertiser.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/campaigns/{id}/pause": {
      "post": {
        "summary": "pause TikTok campaigns object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/campaigns/{id}/resume": {
      "post": {
        "summary": "resume TikTok campaigns object",
        "description": "Requires explicit confirmation. Resume requires operator-enabled activation.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/connect": {
      "post": {
        "operationId": "connectTikTokAdsGrant",
        "summary": "Connect an advertiser or open an advertiser selection grant",
        "tags": [
          "TikTok management"
        ],
        "description": "Exchange one TikTok authorization code. Include advertiser_id for immediate connection, or omit it to choose an advertiser within 15 minutes.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "auth_code": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  }
                },
                "required": [
                  "auth_code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "const": true
                        },
                        "account": {
                          "type": "object",
                          "properties": {
                            "advertiser_id": {
                              "type": "string",
                              "pattern": "^[0-9]{1,25}$"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "connected_at": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updated_at": {
                              "type": "string",
                              "format": "date-time"
                            }
                          }
                        }
                      },
                      "required": [
                        "success"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "const": true
                        },
                        "grant_id": {
                          "type": "string"
                        },
                        "advertisers_count": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "expires_in": {
                          "type": "integer",
                          "minimum": 900,
                          "maximum": 900
                        }
                      },
                      "required": [
                        "success",
                        "grant_id"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/identities": {
      "get": {
        "summary": "List TikTok advertiser identities",
        "description": "Account- and advertiser-scoped TikTok Ads read.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/insights": {
      "get": {
        "summary": "GET ads tiktok insights",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/locations": {
      "get": {
        "summary": "List TikTok advertiser locations",
        "description": "Account- and advertiser-scoped TikTok Ads read.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/tiktok-ads.md"
        },
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/analyze-shorts": {
      "post": {
        "summary": "POST analyze shorts",
        "description": "Generate short-video post metadata from sampled frames using the configured vision model.",
        "tags": [
          "Media"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/ai-shorts.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/delete": {
      "post": {
        "summary": "POST autodms delete",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/logs": {
      "get": {
        "summary": "GET autodms logs",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/pause": {
      "post": {
        "summary": "POST autodms pause",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/resume": {
      "post": {
        "summary": "POST autodms resume",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/rules": {
      "post": {
        "summary": "POST autodms rules",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "get": {
        "summary": "GET autodms rules",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/rules/delete": {
      "post": {
        "summary": "POST autodms rules delete",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/rules/pause": {
      "post": {
        "summary": "POST autodms rules pause",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/rules/resume": {
      "post": {
        "summary": "POST autodms rules resume",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/start": {
      "post": {
        "summary": "POST autodms start",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/status": {
      "get": {
        "summary": "GET autodms status",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/autodms/stop": {
      "post": {
        "summary": "POST autodms stop",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-autodm.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/comments": {
      "get": {
        "summary": "GET comments",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST comments",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE comments",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/comments/action": {
      "post": {
        "summary": "POST comments action",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/comments/create": {
      "post": {
        "summary": "POST comments create",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/comments/delete": {
      "delete": {
        "summary": "DELETE comments delete",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST comments delete",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/comments/public-reply": {
      "post": {
        "summary": "POST comments public reply",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/comments/reply": {
      "post": {
        "summary": "POST comments reply",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/dms/conversations": {
      "get": {
        "summary": "GET dms conversations",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/dms/instagram/profile": {
      "get": {
        "summary": "GET dms instagram profile",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST dms instagram profile",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE dms instagram profile",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/dms/media": {
      "get": {
        "summary": "GET dms media",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/instagram-dm-media.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/dms/send": {
      "post": {
        "summary": "POST dms send",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/facebook/insights": {
      "get": {
        "summary": "GET facebook insights",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/facebook/page-info": {
      "get": {
        "summary": "GET facebook page info",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "patch": {
        "summary": "PATCH facebook page info",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST facebook page info",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/facebook/pages": {
      "get": {
        "summary": "List selected Facebook Pages",
        "description": "Lists the selected Page for each owned active profile. Provide profile to restrict the result to one profile. The API reads stored connection metadata.",
        "tags": [
          "Profiles"
        ],
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "page_id": {
                            "type": "string"
                          },
                          "page_name": {
                            "type": "string"
                          },
                          "profile": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "page_id",
                          "page_name",
                          "profile"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "pages"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/facebook/ratings": {
      "get": {
        "summary": "GET facebook ratings",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/facebook/tagged": {
      "get": {
        "summary": "GET facebook tagged",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/facebook/videos/{videoId}/captions": {
      "get": {
        "summary": "GET facebook videos captions",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST facebook videos captions",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/facebook/visitor-posts": {
      "get": {
        "summary": "GET facebook visitor posts",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ffmpeg/consumption": {
      "get": {
        "summary": "GET ffmpeg consumption",
        "description": "Read used and reserved processing seconds for the current UTC month.",
        "tags": [
          "Media"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/ffmpeg-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ffmpeg/jobs/{id}": {
      "get": {
        "summary": "GET ffmpeg jobs",
        "description": "Read the status and result of an account-owned media processing job.",
        "tags": [
          "Media"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/ffmpeg-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/ffmpeg/jobs/{id}/download": {
      "get": {
        "summary": "GET ffmpeg jobs download",
        "description": "Redirect to the signed result of a completed media processing job.",
        "tags": [
          "Media"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/ffmpeg-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Signed media redirect"
          }
        }
      }
    },
    "/api/uploadposts/ffmpeg/jobs/upload": {
      "post": {
        "summary": "POST ffmpeg jobs upload",
        "description": "Queue a bounded MP4 transcode, trim, resize, or mute job with an operation object and asset_id, media_url, or multipart file.",
        "tags": [
          "Media"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/ffmpeg-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/api/uploadposts/history": {
      "get": {
        "summary": "Get publish history",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 64,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "history",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Post"
                      }
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/instagram/publishing_limit": {
      "get": {
        "summary": "GET instagram publishing_limit",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/instagram/stories": {
      "get": {
        "summary": "GET instagram stories",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/instagram/tagged": {
      "get": {
        "summary": "GET instagram tagged",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/me": {
      "get": {
        "summary": "GET me",
        "description": "Read the current account and its UTC monthly publishing allowance.",
        "tags": [
          "Profiles"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/media": {
      "get": {
        "summary": "GET media",
        "tags": [
          "Meta management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/meta-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/media-uploads": {
      "post": {
        "summary": "POST media uploads",
        "description": "Send filename, content_type, and content_length for a JPG, PNG, or MP4 up to 50 MB. Upload the bytes using the returned URL and signed headers.",
        "tags": [
          "Media"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string"
                  },
                  "content_type": {
                    "type": "string",
                    "enum": [
                      "image/jpeg",
                      "image/png",
                      "video/mp4"
                    ]
                  },
                  "content_length": {
                    "type": "integer",
                    "minimum": 12,
                    "maximum": 52428800
                  },
                  "media_type": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video"
                    ]
                  }
                },
                "required": [
                  "filename",
                  "content_type",
                  "content_length"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/api/uploadposts/media-uploads/{id}": {
      "get": {
        "summary": "GET media uploads",
        "description": "Inspect or cancel the authenticated account’s staged upload.",
        "tags": [
          "Media"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE media uploads",
        "description": "Inspect or cancel the authenticated account’s staged upload.",
        "tags": [
          "Media"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/media-uploads/{id}/complete": {
      "post": {
        "summary": "POST media uploads complete",
        "description": "Validate the staged upload and store an immutable account-owned asset. Returns asset_id and a temporary media_url.",
        "tags": [
          "Media"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/media-uploads/{id}/content": {
      "get": {
        "summary": "GET media uploads content",
        "description": "Open a completed media file with the temporary token from media_url.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "TemporaryMediaToken": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Signed media redirect"
          }
        }
      }
    },
    "/api/uploadposts/oauth/{platform}/start": {
      "post": {
        "summary": "POST oauth start",
        "description": "Create a provider-specific hosted connection URL for profile_username. Open it in the browser to start OAuth.",
        "tags": [
          "Profiles"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/platform-metrics": {
      "get": {
        "summary": "GET platform metrics",
        "description": "Read the capabilities and metric definitions currently available.",
        "tags": [
          "Publishing"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/post-analytics": {
      "get": {
        "summary": "GET post analytics",
        "description": "Look up analytics for an owned publication using platform and platform_post_id. The current provider implementation is YouTube.",
        "tags": [
          "Publishing"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/analytics-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/post-analytics/{requestId}": {
      "get": {
        "summary": "Get video metrics for an owned post",
        "description": "Returns cumulative counters only for confirmed PostGuild YouTube deliveries whose original channel is still connected. Other destinations have unsupported status.",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "type": "object",
                            "properties": {
                              "platform": {
                                "$ref": "#/components/schemas/Platform"
                              },
                              "platform_post_id": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "platform",
                              "platform_post_id"
                            ]
                          },
                          {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "const": "available"
                                  },
                                  "metrics": {
                                    "type": "object",
                                    "properties": {
                                      "views": {
                                        "type": [
                                          "string",
                                          "null"
                                        ],
                                        "pattern": "^[0-9]+$",
                                        "description": "Provider count as a decimal string, or null when unavailable."
                                      },
                                      "likes": {
                                        "type": [
                                          "string",
                                          "null"
                                        ],
                                        "pattern": "^[0-9]+$",
                                        "description": "Provider count as a decimal string, or null when unavailable."
                                      },
                                      "comments": {
                                        "type": [
                                          "string",
                                          "null"
                                        ],
                                        "pattern": "^[0-9]+$",
                                        "description": "Provider count as a decimal string, or null when unavailable."
                                      }
                                    },
                                    "required": [
                                      "views",
                                      "likes",
                                      "comments"
                                    ]
                                  },
                                  "measured_at": {
                                    "type": "string",
                                    "format": "date-time"
                                  }
                                },
                                "required": [
                                  "status",
                                  "metrics",
                                  "measured_at"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "enum": [
                                      "unavailable",
                                      "unsupported"
                                    ]
                                  },
                                  "metrics": {
                                    "type": "null"
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "status",
                                  "metrics",
                                  "reason"
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "profile_username",
                    "results"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/post-analytics/cached": {
      "get": {
        "summary": "GET post analytics cached",
        "description": "Read cached analytics snapshots for account-owned publications. This endpoint makes no provider requests.",
        "tags": [
          "Publishing"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/analytics-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/posts/edit": {
      "post": {
        "summary": "POST posts edit",
        "description": "Edit a publication recorded by PostGuild on Facebook, YouTube, or a text-only X post. Identify it by request_id or platform_post_id.",
        "tags": [
          "Publishing"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/posts/repost": {
      "post": {
        "summary": "POST posts repost",
        "description": "Repost a native X post from the X account connected to the specified profile.",
        "tags": [
          "Publishing"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/posts/retry": {
      "post": {
        "summary": "Retry a confirmed failed destination",
        "tags": [
          "Publishing"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "request_id",
                  "platform"
                ],
                "properties": {
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "platform": {
                    "$ref": "#/components/schemas/Platform"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Retry queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "request_id",
                    "platform"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "platform": {
                      "$ref": "#/components/schemas/Platform"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/posts/unpublish": {
      "post": {
        "summary": "POST posts unpublish",
        "description": "Remove an account-owned publication on Facebook, YouTube, or X. Requires confirm: true.",
        "tags": [
          "Publishing"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/queue/next-slot": {
      "get": {
        "summary": "GET queue next slot",
        "description": "Return the next available queue slot for profile_username within 60 days.",
        "tags": [
          "Queue"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/queue/preview": {
      "get": {
        "summary": "GET queue preview",
        "description": "List occupancy of upcoming slots for profile_username. Optional days is between 1 and 60.",
        "tags": [
          "Queue"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/queue/settings": {
      "get": {
        "summary": "GET queue settings",
        "description": "Read or write fixed slots for profile_username. Provide an IANA timezone, hour/minute slots, Monday-based days_of_week and max_posts_per_slot as needed.",
        "tags": [
          "Queue"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST queue settings",
        "description": "Read or write fixed slots for profile_username. Provide an IANA timezone, hour/minute slots, Monday-based days_of_week and max_posts_per_slot as needed.",
        "tags": [
          "Queue"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_username": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "hour",
                        "minute"
                      ],
                      "properties": {
                        "hour": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 23
                        },
                        "minute": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 59
                        }
                      }
                    }
                  },
                  "days_of_week": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 6
                    }
                  },
                  "max_posts_per_slot": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "required": [
                  "profile_username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/queue/slot-full": {
      "post": {
        "summary": "POST queue slot full",
        "description": "Block or unblock a configured slot using profile_username and slot_datetime.",
        "tags": [
          "Queue"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE queue slot full",
        "description": "Block or unblock a configured slot using profile_username and slot_datetime.",
        "tags": [
          "Queue"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/rewrite-captions": {
      "post": {
        "summary": "POST rewrite captions",
        "description": "Rewrite captions and metadata in a target language using the configured text model.",
        "tags": [
          "Media"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/ai-shorts.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/schedule": {
      "get": {
        "summary": "List scheduled posts",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 64,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "scheduled_posts",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "scheduled_posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Post"
                      }
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/schedule/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "patch": {
        "summary": "Change the date of a queued post",
        "tags": [
          "Publishing"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduled_date": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "caption": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Post"
                    },
                    {
                      "type": "object",
                      "required": [
                        "success"
                      ],
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "const": true
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "summary": "Cancel queued deliveries",
        "tags": [
          "Publishing"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "summary": "GET schedule",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/schedule/{id}/preview": {
      "get": {
        "summary": "GET schedule preview",
        "description": "Return a short-lived URL for the scheduled post’s first media file.",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/schedule/{id}/thumbnail": {
      "get": {
        "summary": "GET schedule thumbnail",
        "description": "Return a short-lived URL for the scheduled post’s first photo.",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/status": {
      "get": {
        "summary": "Get per-destination status",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "request_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Post"
                    },
                    {
                      "type": "object",
                      "required": [
                        "success"
                      ],
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "const": true
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/tiktok/settings": {
      "get": {
        "summary": "GET tiktok settings",
        "description": "Read the selected creator’s current publishing and privacy settings.",
        "tags": [
          "TikTok management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/x-tiktok-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/users": {
      "get": {
        "summary": "List profiles",
        "tags": [
          "Profiles"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "profiles"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "profiles": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Profile"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ]
      },
      "post": {
        "summary": "Create a profile",
        "tags": [
          "Profiles"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username"
                ],
                "properties": {
                  "username": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "display_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Profile created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "username",
                    "display_name"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "username": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                    },
                    "display_name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "summary": "Archive a profile",
        "tags": [
          "Profiles"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username"
                ],
                "properties": {
                  "username": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/users/{slug}": {
      "patch": {
        "summary": "Rename a profile",
        "tags": [
          "Profiles"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 64,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "display_name"
                ],
                "properties": {
                  "display_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "username",
                    "display_name"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "username": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                    },
                    "display_name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "summary": "GET users",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/users/facebook-page": {
      "get": {
        "summary": "GET users facebook page",
        "description": "Read, pin, or unpin the Facebook Page selected through OAuth. Use profile_username and, when pinning, facebook_page_id.",
        "tags": [
          "Profiles"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST users facebook page",
        "description": "Read, pin, or unpin the Facebook Page selected through OAuth. Use profile_username and, when pinning, facebook_page_id.",
        "tags": [
          "Profiles"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE users facebook page",
        "description": "Read, pin, or unpin the Facebook Page selected through OAuth. Use profile_username and, when pinning, facebook_page_id.",
        "tags": [
          "Profiles"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/users/generate-jwt": {
      "post": {
        "summary": "Create a hosted client connection link",
        "tags": [
          "Profiles"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username"
                ],
                "properties": {
                  "username": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Platform"
                    },
                    "maxItems": 5
                  },
                  "client_approval": {
                    "type": "boolean",
                    "description": "Enable review for this link and profile. Sending false disables review for existing links to the profile."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "access_url",
                    "expires_in"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "access_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/users/notifications": {
      "get": {
        "summary": "GET users notifications",
        "description": "Read, configure, or remove the account-level HTTPS webhook. Configuration uses webhook_url and optional webhook_events.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST users notifications",
        "description": "Read, configure, or remove the account-level HTTPS webhook. Configuration uses webhook_url and optional webhook_events.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE users notifications",
        "description": "Read, configure, or remove the account-level HTTPS webhook. Configuration uses webhook_url and optional webhook_events.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/users/notifications/test": {
      "post": {
        "summary": "POST users notifications test",
        "description": "Queue a test event for the account webhook.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/api/uploadposts/users/preferences": {
      "get": {
        "summary": "GET users preferences",
        "description": "Read or update the calendar week start. Send weekStartDay as an integer from 0 to 6.",
        "tags": [
          "Profiles"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST users preferences",
        "description": "Read or update the calendar week start. Send weekStartDay as an integer from 0 to 6.",
        "tags": [
          "Profiles"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/users/profile-webhook": {
      "get": {
        "summary": "GET users profile webhook",
        "description": "Read or change webhook_url and webhook_events for profile_username.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST users profile webhook",
        "description": "Read or change webhook_url and webhook_events for profile_username.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE users profile webhook",
        "description": "Read or change webhook_url and webhook_events for profile_username.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/users/social": {
      "delete": {
        "summary": "Disconnect a social account",
        "tags": [
          "Profiles"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username",
                  "platform"
                ],
                "properties": {
                  "username": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "platform": {
                    "$ref": "#/components/schemas/Platform"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/users/validate-jwt": {
      "get": {
        "summary": "GET users validate jwt",
        "description": "Validate the Bearer token from a PostGuild hosted connection URL. This token is scoped to the named profile and does not authorize publishing.",
        "tags": [
          "Profiles"
        ],
        "security": [
          {
            "ConnectLink": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/users/webhook-secret": {
      "post": {
        "summary": "POST users webhook secret",
        "description": "Rotate the shared signing secret for account and profile webhooks.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/webhooks/deliveries": {
      "get": {
        "summary": "List webhook deliveries",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Opaque pagination cursor returned by the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "deliveries",
                    "next_cursor"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/webhooks/deliveries/{id}": {
      "get": {
        "summary": "Get one webhook delivery",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "delivery"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "delivery": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/WebhookDelivery"
                        },
                        {
                          "type": "object",
                          "required": [
                            "payload"
                          ],
                          "properties": {
                            "payload": {
                              "type": "object"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/webhooks/deliveries/{id}/redeliver": {
      "post": {
        "summary": "POST webhooks deliveries redeliver",
        "description": "Queue another delivery for an existing event from the past seven days. The replay has a new delivery ID.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/api/uploadposts/webhooks/subscriptions": {
      "get": {
        "summary": "List webhook subscriptions",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "limit",
                    "subscriptions"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "subscriptions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Subscription"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "summary": "Create a subscription",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "A public HTTPS receiver using the default HTTPS port."
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "profile_username": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The URL already has a subscription",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "created",
                    "subscription"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "created": {
                      "type": "boolean",
                      "const": false
                    },
                    "subscription": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Subscription created. Store the signing secret from this response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "created",
                    "subscription",
                    "signing_secret"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "created": {
                      "type": "boolean",
                      "const": true
                    },
                    "subscription": {
                      "$ref": "#/components/schemas/Subscription"
                    },
                    "signing_secret": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/webhooks/subscriptions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "summary": "Get a webhook subscription",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "subscription"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "subscription": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "summary": "Delete a subscription",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/webhooks/subscriptions/{id}/test": {
      "post": {
        "summary": "Queue a signed test webhook",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Test delivery queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "delivery_id"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "delivery_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/x/lists": {
      "post": {
        "summary": "POST x lists",
        "description": "Manage connected X lists and membership. Send user and a supported action. Deletion requires confirm: true.",
        "tags": [
          "X management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/x-tiktok-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/x/mentions": {
      "get": {
        "summary": "GET x mentions",
        "description": "Read mentions for the X account connected to user. Results incur metered X API calls.",
        "tags": [
          "X management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/x-tiktok-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/x/read/{kind}": {
      "get": {
        "summary": "GET x read",
        "description": "Run a documented X read family on the connected account. Available kinds, filters, and required grants are listed in the X API guide.",
        "tags": [
          "X management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/x-tiktok-api.md"
        },
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/abuse-reasons": {
      "get": {
        "summary": "GET YouTube /abuse-reasons",
        "description": "Optional hl. Categories accepts region_code, default US. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/activities": {
      "get": {
        "summary": "GET YouTube /activities",
        "description": "Selected channel. Search supports q. Lists accept max_results and page_token. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/analytics/groups": {
      "get": {
        "summary": "GET YouTube /analytics/groups",
        "description": "Available PostGuild dimensions and metrics, channel groups, or items in one group. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/analytics/groups/{id}/items": {
      "get": {
        "summary": "GET YouTube /analytics/groups/{id}/items",
        "description": "Available PostGuild dimensions and metrics, channel groups, or items in one group. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/analytics/query": {
      "get": {
        "summary": "GET YouTube /analytics/query",
        "description": "Non-monetary metrics, optional dimensions, start_date, and end_date within 367 days. Optional max_results and start_index. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/analytics/reports": {
      "get": {
        "summary": "GET YouTube /analytics/reports",
        "description": "Available PostGuild dimensions and metrics, channel groups, or items in one group. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/captions": {
      "get": {
        "summary": "GET YouTube /captions",
        "description": "video_id. Create via multipart with a caption file and language, optional name and is_draft. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /captions",
        "description": "video_id. Create via multipart with a caption file and language, optional name and is_draft. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/captions/{id}": {
      "put": {
        "summary": "PUT YouTube /captions/{id}",
        "description": "video_id. Replace via multipart or set is_draft via JSON. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE YouTube /captions/{id}",
        "description": "video_id. Replace via multipart or set is_draft via JSON. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/captions/{id}/download": {
      "get": {
        "summary": "GET YouTube /captions/{id}/download",
        "description": "video_id and optional format. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/categories": {
      "get": {
        "summary": "GET YouTube /categories",
        "description": "Optional hl. Categories accepts region_code, default US. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/channel": {
      "get": {
        "summary": "GET YouTube /channel",
        "description": "The selected channel only. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "patch": {
        "summary": "Update YouTube channel settings",
        "description": "Update the connected channel's branding fields or translations. Omitted branding fields are preserved. Select the profile using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Channel settings and authorization",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile": {
                    "type": "string"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 1000
                  },
                  "keywords": {
                    "oneOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "default_language": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tracking_analytics_account_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "unsubscribed_trailer": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "localizations": {
                    "type": "object",
                    "additionalProperties": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "required": [
                        "title",
                        "description"
                      ],
                      "properties": {
                        "title": {
                          "type": "string",
                          "maxLength": 100
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 1000
                        }
                      }
                    }
                  },
                  "localizations_remove": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "409": {
            "description": "Another channel settings update is in progress"
          }
        }
      }
    },
    "/api/uploadposts/youtube/channel/lookup": {
      "get": {
        "summary": "GET YouTube /channel/lookup",
        "description": "The selected channel only. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/channel/sections": {
      "get": {
        "summary": "GET YouTube /channel/sections",
        "description": "The selected channel only. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /channel/sections",
        "description": "Create with type, optional position, and title, playlist_ids, or channel_ids for types that require them. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/channel/sections/{id}": {
      "patch": {
        "summary": "PATCH YouTube /channel/sections/{id}",
        "description": "Edit or remove an owned section. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE YouTube /channel/sections/{id}",
        "description": "Edit or remove an owned section. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/comments": {
      "get": {
        "summary": "GET YouTube /comments",
        "description": "List comments on video_id. Send text with comment_id to reply, or with video_id to create a thread. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /comments",
        "description": "List comments on video_id. Send text with comment_id to reply, or with video_id to create a thread. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/comments/{id}": {
      "patch": {
        "summary": "PATCH YouTube /comments/{id}",
        "description": "Edit the selected channel's own comment with text, or remove an accessible comment on an owned video. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE YouTube /comments/{id}",
        "description": "Edit the selected channel's own comment with text, or remove an accessible comment on an owned video. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/comments/moderate": {
      "post": {
        "summary": "POST YouTube /comments/moderate",
        "description": "comment_id and moderation_status on an owned video. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/comments/replies": {
      "get": {
        "summary": "GET YouTube /comments/replies",
        "description": "comment_id on an owned video. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/languages": {
      "get": {
        "summary": "GET YouTube /languages",
        "description": "Optional hl. Categories accepts region_code, default US. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/bans": {
      "post": {
        "summary": "POST YouTube /live/bans",
        "description": "Create a temporary or permanent ban for channel_id on broadcast_id. Temporary bans require duration_seconds. Keep the returned ban_token to lift the ban from that broadcast. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/bans/{id}": {
      "delete": {
        "summary": "DELETE YouTube /live/bans/{id}",
        "description": "Create a temporary or permanent ban for channel_id on broadcast_id. Temporary bans require duration_seconds. Keep the returned ban_token to lift the ban from that broadcast. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/broadcasts": {
      "get": {
        "summary": "GET YouTube /live/broadcasts",
        "description": "Create with title, scheduled_start_time, optional description, scheduled_end_time, privacy_status, and made_for_kids. Defaults to private. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /live/broadcasts",
        "description": "Create with title, scheduled_start_time, optional description, scheduled_end_time, privacy_status, and made_for_kids. Defaults to private. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/broadcasts/{id}": {
      "get": {
        "summary": "GET YouTube /live/broadcasts/{id}",
        "description": "A broadcast owned by the selected channel. PATCH accepts title, description, scheduling and visibility fields. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "patch": {
        "summary": "PATCH YouTube /live/broadcasts/{id}",
        "description": "A broadcast owned by the selected channel. PATCH accepts title, description, scheduling and visibility fields. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE YouTube /live/broadcasts/{id}",
        "description": "A broadcast owned by the selected channel. PATCH accepts title, description, scheduling and visibility fields. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/broadcasts/{id}/bind": {
      "post": {
        "summary": "POST YouTube /live/broadcasts/{id}/bind",
        "description": "An owned stream_id, or null to unbind. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/broadcasts/{id}/cuepoint": {
      "post": {
        "summary": "POST YouTube /live/broadcasts/{id}/cuepoint",
        "description": "Insert an ad break with optional duration_seconds and either offset_ms or walltime_ms. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/broadcasts/{id}/transition": {
      "post": {
        "summary": "POST YouTube /live/broadcasts/{id}/transition",
        "description": "status of testing, live, or complete. Starting or ending a broadcast requires confirm: true. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/chat": {
      "get": {
        "summary": "GET YouTube /live/chat",
        "description": "broadcast_id, with text to send a message or poll containing a question and two to four options. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /live/chat",
        "description": "broadcast_id, with text to send a message or poll containing a question and two to four options. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/chat/messages/{id}": {
      "delete": {
        "summary": "DELETE YouTube /live/chat/messages/{id}",
        "description": "Remove a message found on the verified chat page. Send broadcast_id and optionally page_token. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/chat/polls/{id}/close": {
      "post": {
        "summary": "POST YouTube /live/chat/polls/{id}/close",
        "description": "Close an active poll in the chat for broadcast_id. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/moderators": {
      "get": {
        "summary": "GET YouTube /live/moderators",
        "description": "broadcast_id and moderator channel_id when adding. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /live/moderators",
        "description": "broadcast_id and moderator channel_id when adding. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/moderators/{id}": {
      "delete": {
        "summary": "DELETE YouTube /live/moderators/{id}",
        "description": "Remove a moderator found in the moderators list for broadcast_id. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/streams": {
      "get": {
        "summary": "GET YouTube /live/streams",
        "description": "Create with title and optional description, ingestion_type, frame_rate, and resolution. The create response includes the channel's ingestion configuration. Treat its stream key as a credential. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /live/streams",
        "description": "Create with title and optional description, ingestion_type, frame_rate, and resolution. The create response includes the channel's ingestion configuration. Treat its stream key as a credential. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/streams/{id}": {
      "get": {
        "summary": "GET YouTube /live/streams/{id}",
        "description": "An owned stream. PATCH accepts title and description. List and detail responses omit ingestion credentials. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "patch": {
        "summary": "PATCH YouTube /live/streams/{id}",
        "description": "An owned stream. PATCH accepts title and description. List and detail responses omit ingestion credentials. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE YouTube /live/streams/{id}",
        "description": "An owned stream. PATCH accepts title and description. List and detail responses omit ingestion credentials. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/live/super-chats": {
      "get": {
        "summary": "GET YouTube /live/super-chats",
        "description": "Super Chats and Stickers visible to the selected channel. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/playlists": {
      "get": {
        "summary": "GET YouTube /playlists",
        "description": "List owned playlists. Create with title, optional description and privacy_status. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /playlists",
        "description": "List owned playlists. Create with title, optional description and privacy_status. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/playlists/{id}": {
      "patch": {
        "summary": "PATCH YouTube /playlists/{id}",
        "description": "An owned playlist. PATCH accepts title, description, and privacy_status. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE YouTube /playlists/{id}",
        "description": "An owned playlist. PATCH accepts title, description, and privacy_status. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/playlists/{id}/items": {
      "get": {
        "summary": "GET YouTube /playlists/{id}/items",
        "description": "List items; insert an owned video by video_id. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /playlists/{id}/items",
        "description": "List items; insert an owned video by video_id. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/playlists/{id}/items/{child}": {
      "patch": {
        "summary": "PATCH YouTube /playlists/{id}/items/{child}",
        "description": "Reorder with position or remove the item. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "child",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE YouTube /playlists/{id}/items/{child}",
        "description": "Reorder with position or remove the item. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "child",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/regions": {
      "get": {
        "summary": "GET YouTube /regions",
        "description": "Optional hl. Categories accepts region_code, default US. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/reporting/jobs": {
      "get": {
        "summary": "GET YouTube /reporting/jobs",
        "description": "List jobs or create a recurring report with report_type_id and name. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /reporting/jobs",
        "description": "List jobs or create a recurring report with report_type_id and name. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/reporting/jobs/{id}": {
      "get": {
        "summary": "GET YouTube /reporting/jobs/{id}",
        "description": "One Reporting job. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "DELETE YouTube /reporting/jobs/{id}",
        "description": "One Reporting job. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/reporting/jobs/{id}/reports": {
      "get": {
        "summary": "GET YouTube /reporting/jobs/{id}/reports",
        "description": "Report list, metadata, or CSV attachment. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/reporting/jobs/{id}/reports/{child}": {
      "get": {
        "summary": "GET YouTube /reporting/jobs/{id}/reports/{child}",
        "description": "Report list, metadata, or CSV attachment. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "child",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/reporting/jobs/{id}/reports/{child}/download": {
      "get": {
        "summary": "GET YouTube /reporting/jobs/{id}/reports/{child}/download",
        "description": "Report list, metadata, or CSV attachment. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "child",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/reporting/report-types": {
      "get": {
        "summary": "GET YouTube /reporting/report-types",
        "description": "Available Google report types in the grant. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/search": {
      "get": {
        "summary": "GET YouTube /search",
        "description": "Selected channel. Search supports q. Lists accept max_results and page_token. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/subscriptions": {
      "get": {
        "summary": "GET YouTube /subscriptions",
        "description": "Selected channel. Search supports q. Lists accept max_results and page_token. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "POST YouTube /subscriptions",
        "description": "Subscribe by target channel_id or remove one of the selected channel's own subscriptions. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/subscriptions/{id}": {
      "delete": {
        "summary": "DELETE YouTube /subscriptions/{id}",
        "description": "Subscribe by target channel_id or remove one of the selected channel's own subscriptions. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/thumbnail": {
      "post": {
        "summary": "POST YouTube /thumbnail",
        "description": "Multipart video_id and one JPEG or PNG up to 50 MB. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/videos": {
      "get": {
        "summary": "GET YouTube /videos",
        "description": "One video_id belonging to the selected channel. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/videos/{id}/rate": {
      "post": {
        "summary": "POST YouTube /videos/{id}/rate",
        "description": "Set a rating of like, dislike, or none. For an abuse report, send reason_id and optional secondary_reason_id and comments. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/videos/{id}/report-abuse": {
      "post": {
        "summary": "POST YouTube /videos/{id}/report-abuse",
        "description": "Set a rating of like, dislike, or none. For an abuse report, send reason_id and optional secondary_reason_id and comments. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/videos/rating": {
      "get": {
        "summary": "GET YouTube /videos/rating",
        "description": "One video_id belonging to the selected channel. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/approvals": {
      "get": {
        "operationId": "listApprovals",
        "summary": "List open approval items",
        "description": "Editors and Contributors see their own items. Set count_only to return counts by status.",
        "tags": [
          "Teams and approvals"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "examples": [
                "pending_approval,draft"
              ]
            }
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count_only",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "author",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/approvals/client": {
      "get": {
        "operationId": "listClientApprovals",
        "summary": "List items awaiting client approval",
        "description": "Returns pending items from the profile attached to a valid review link, with signed media previews.",
        "tags": [
          "Teams and approvals"
        ],
        "security": [
          {
            "ConnectLink": []
          }
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "examples": [
                "pending_approval,draft"
              ]
            }
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count_only",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/approvals/client/{id}/approve": {
      "post": {
        "operationId": "approveAsClient",
        "summary": "Approve a reviewed post",
        "description": "Queues a job once and returns a conflict if the submitted version is stale.",
        "tags": [
          "Teams and approvals"
        ],
        "security": [
          {
            "ConnectLink": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "comment": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "version"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/approvals/client/{id}/reject": {
      "post": {
        "operationId": "rejectAsClient",
        "summary": "Reject a reviewed post",
        "description": "Records a reason and closes the item.",
        "tags": [
          "Teams and approvals"
        ],
        "security": [
          {
            "ConnectLink": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "comment"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/approvals/{id}": {
      "get": {
        "operationId": "getApproval",
        "summary": "Get an approval item",
        "description": "Returns the version and signed media previews to an author or reviewer.",
        "tags": [
          "Teams and approvals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "editApproval",
        "summary": "Edit an open approval item",
        "description": "Changes the content or scheduled date and increments the review version.",
        "tags": [
          "Teams and approvals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "caption": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "scheduled_date": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "withdrawApproval",
        "summary": "Withdraw an open approval item",
        "description": "Withdraws the item. Uploaded media follows the workspace’s shared storage lifecycle.",
        "tags": [
          "Teams and approvals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/approvals/{id}/approve": {
      "post": {
        "operationId": "approvePost",
        "summary": "Approve a reviewed post",
        "description": "Queues a job once and returns a conflict if the submitted version is stale.",
        "tags": [
          "Teams and approvals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "comment": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "publish_now": {
                    "type": "boolean"
                  },
                  "scheduled_date": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "version"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/approvals/{id}/reject": {
      "post": {
        "operationId": "rejectPost",
        "summary": "Reject a reviewed post",
        "description": "Records a reason and closes the item.",
        "tags": [
          "Teams and approvals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "comment"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/teams/audit": {
      "get": {
        "operationId": "getTeamAudit",
        "summary": "List team activity",
        "description": "Requires the owner or an unrestricted admin. A cursor resumes the newest-first results within the last 400 days.",
        "tags": [
          "Teams and approvals"
        ],
        "parameters": [
          {
            "name": "actor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_username",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/teams/members": {
      "get": {
        "operationId": "getTeamMembers",
        "summary": "List workspace members",
        "description": "Requires the account owner. Manage invitations and roles in the dashboard.",
        "tags": [
          "Teams and approvals"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/teams/roles": {
      "get": {
        "operationId": "getTeamRoles",
        "summary": "Get workspace role",
        "description": "Returns role names, permissions and the caller’s effective profile list.",
        "tags": [
          "Teams and approvals"
        ],
        "parameters": [
          {
            "name": "X-Act-As-User",
            "in": "header",
            "description": "Owner email of an accepted shared workspace.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/teams/shared-with-me": {
      "get": {
        "operationId": "getSharedWorkspaces",
        "summary": "List shared workspaces",
        "description": "Lists accepted workspaces for the API key holder.",
        "tags": [
          "Teams and approvals"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamSuccess"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/youtube/channel/banner": {
      "post": {
        "summary": "Set a YouTube channel banner",
        "description": "Upload one 16:9 JPEG or PNG of at least 2048 × 1152, up to 6 MiB. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "profile": {
                    "type": "string"
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/channel/watermark": {
      "post": {
        "summary": "Set a YouTube channel watermark",
        "description": "Upload one JPEG or PNG up to 10 MiB. Confirm watermark replacement. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image",
                  "confirm"
                ],
                "properties": {
                  "profile": {
                    "type": "string"
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "confirm": {
                    "type": "boolean"
                  },
                  "timing_type": {
                    "type": "string",
                    "enum": [
                      "offsetFromStart",
                      "offsetFromEnd"
                    ],
                    "default": "offsetFromStart"
                  },
                  "offset_ms": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "duration_ms": {
                    "type": "integer",
                    "minimum": 1000
                  },
                  "target_channel_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "Remove a YouTube channel watermark",
        "description": "Confirm removal with confirm=true. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/youtube/playlists/{id}/image": {
      "get": {
        "summary": "Get a YouTube playlist image",
        "description": "Return the image for a playlist owned by the connected channel. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "Set a YouTube playlist image",
        "description": "Upload one square JPEG or PNG up to 50 MiB to a playlist without an image. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "profile": {
                    "type": "string"
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "put": {
        "summary": "Replace a YouTube playlist image",
        "description": "Replace the current image with one square JPEG or PNG up to 50 MiB. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image",
                  "confirm"
                ],
                "properties": {
                  "profile": {
                    "type": "string"
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "confirm": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "Remove a YouTube playlist image",
        "description": "Confirm removal with confirm=true. Select the connected channel using profile, profile_username, or user.",
        "tags": [
          "YouTube management"
        ],
        "externalDocs": {
          "description": "Request fields and provider requirements",
          "url": "https://github.com/Sajgon/postguild/blob/main/docs/youtube-api.md"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/api/uploadposts/best-times": {
      "get": {
        "operationId": "getBestTimes",
        "summary": "Rank posting hours from recent owned YouTube observations",
        "description": "Uses cached views for public videos previously delivered by PostGuild. Makes no provider request. Returns empty rankings if the selected platform has no supported history or the sample is too small.",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "profile_username",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Owned profile slug. The user and profile aliases are also accepted."
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "x",
                "twitter",
                "youtube",
                "tiktok"
              ]
            },
            "required": true,
            "description": "Selected platform. Rankings currently require YouTube observations."
          },
          {
            "name": "timezone",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "IANA timezone. Defaults to the profile queue timezone or UTC."
          },
          {
            "name": "top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 24,
              "default": 5
            },
            "required": false,
            "description": "Maximum number of ranked hours."
          },
          {
            "name": "refresh",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Accepted for compatibility. Results always recompute from the existing snapshots."
          }
        ],
        "responses": {
          "200": {
            "description": "Observed rankings and sample coverage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "platform": {
                      "type": "string"
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "metric": {
                      "type": "string",
                      "const": "views_per_elapsed_day"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "postguild_history",
                        "none"
                      ]
                    },
                    "confidence": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "low",
                        null
                      ]
                    },
                    "best_times": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "hour",
                          "score",
                          "relative_engagement",
                          "posts"
                        ],
                        "properties": {
                          "hour": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 23
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "relative_engagement": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "posts": {
                            "type": "integer",
                            "minimum": 0
                          }
                        }
                      }
                    },
                    "by_hour": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "hour",
                          "score",
                          "relative_engagement",
                          "posts"
                        ],
                        "properties": {
                          "hour": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 23
                          },
                          "score": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "relative_engagement": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "posts": {
                            "type": "integer",
                            "minimum": 0
                          }
                        }
                      }
                    },
                    "sample": {
                      "type": "object"
                    },
                    "coverage": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/audience": {
      "get": {
        "operationId": "getOwnedAudienceInsights",
        "summary": "Get audience insights for an owned profile",
        "tags": [
          "Publishing"
        ],
        "description": "Reads YouTube Analytics viewer demographics when the current connection has the appropriate grant. Unsupported or unavailable metrics are reported explicitly.",
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Use the owned profile slug. The profile_username and profile aliases are accepted."
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "x",
                "twitter",
                "youtube",
                "tiktok"
              ]
            },
            "required": true
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "last_day",
                "last_week",
                "last_month",
                "last_3months",
                "last_year"
              ]
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "range": {
                      "type": "object",
                      "properties": {
                        "start_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "end_date": {
                          "type": "string",
                          "format": "date"
                        }
                      }
                    },
                    "status": {
                      "type": "string"
                    },
                    "source": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "audience": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "unavailable_metrics": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/suggestions": {
      "get": {
        "operationId": "getOwnedContentSuggestions",
        "summary": "Get historical keyword suggestions",
        "tags": [
          "Publishing"
        ],
        "description": "YouTube keywords come from the owned channel’s search referral history. Data availability depends on the Analytics grant and country filters. Unsupported platforms and types return an availability status.",
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Use the owned profile slug. The profile_username and profile aliases are accepted."
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "x",
                "twitter",
                "youtube",
                "tiktok"
              ]
            },
            "required": true
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "required": true
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hashtags",
                "keywords"
              ]
            },
            "required": false
          },
          {
            "name": "country_code",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "last_day",
                "last_week",
                "last_month",
                "last_3months",
                "last_year"
              ]
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "range": {
                      "type": "object",
                      "properties": {
                        "start_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "end_date": {
                          "type": "string",
                          "format": "date"
                        }
                      }
                    },
                    "status": {
                      "type": "string"
                    },
                    "source": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "keywords": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "keyword": {
                            "type": "string"
                          },
                          "views": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/total-impressions/{profile_username}": {
      "get": {
        "operationId": "getTrackedImpressions",
        "summary": "Get covered impressions and views by platform",
        "tags": [
          "Publishing"
        ],
        "description": "Uses connected YouTube Reporting thumbnail impressions when available. Facebook Page views and YouTube views are measured separately. Unavailable platforms and incomplete report periods are explicit.",
        "parameters": [
          {
            "name": "profile_username",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "metrics",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "breakdown",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "required": false
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "last_day",
                "last_week",
                "last_month",
                "last_3months",
                "last_year"
              ]
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "profile_username": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "end_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "total_impressions": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "impressions_coverage": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "per_platform": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/youtube/quota": {
      "get": {
        "operationId": "getYouTubeQuota",
        "summary": "Get PostGuild YouTube management allowances",
        "tags": [
          "YouTube management"
        ],
        "description": "Returns current account-level management quota consumption. Limits reset at Pacific midnight and are PostGuild’s controls.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "source": {
                      "type": "string",
                      "const": "postguild"
                    },
                    "plan": {
                      "type": "string",
                      "enum": [
                        "free",
                        "paid"
                      ]
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "retry_after": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "buckets": {
                      "type": "object",
                      "properties": {
                        "general": {
                          "type": "object",
                          "properties": {
                            "used": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "limit": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "unit": {
                              "type": "string"
                            },
                            "enabled": {
                              "type": "boolean"
                            }
                          }
                        },
                        "search": {
                          "type": "object",
                          "properties": {
                            "used": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "limit": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "unit": {
                              "type": "string"
                            },
                            "enabled": {
                              "type": "boolean"
                            }
                          }
                        },
                        "batch_stats": {
                          "type": "object",
                          "properties": {
                            "used": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "limit": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "unit": {
                              "type": "string"
                            },
                            "enabled": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/youtube/analytics/usage": {
      "get": {
        "operationId": "getYouTubeAnalyticsUsage",
        "summary": "Get PostGuild YouTube reporting usage",
        "tags": [
          "YouTube management"
        ],
        "description": "Returns Analytics and Reporting management request usage with Pacific-midnight reset.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "source": {
                      "type": "string",
                      "const": "postguild"
                    },
                    "plan": {
                      "type": "string",
                      "enum": [
                        "free",
                        "paid"
                      ]
                    },
                    "resets_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "retry_after": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "services": {
                      "type": "object",
                      "properties": {
                        "analytics": {
                          "type": "object",
                          "properties": {
                            "used": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "limit": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "unit": {
                              "type": "string"
                            },
                            "enabled": {
                              "type": "boolean"
                            }
                          }
                        },
                        "reporting": {
                          "type": "object",
                          "properties": {
                            "used": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "limit": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "unit": {
                              "type": "string"
                            },
                            "enabled": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/youtube/push": {
      "get": {
        "operationId": "youtubePushRead",
        "summary": "Read a YouTube push subscription",
        "tags": [
          "YouTube management"
        ],
        "description": "Controls push notifications for the connected YouTube channel. Requires feature enablement and, for registration, an active webhook subscription with an explicit YouTube event.",
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Use the owned profile slug. The profile_username and profile aliases are accepted."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "push": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "channel_id": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "active"
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "verified_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "expires_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "last_notification_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "youtube_video_published",
                              "youtube_video_updated"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "youtubePushCreate",
        "summary": "Register a YouTube push subscription",
        "tags": [
          "YouTube management"
        ],
        "description": "Controls push notifications for the connected YouTube channel. Requires feature enablement and, for registration, an active webhook subscription with an explicit YouTube event.",
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Use the owned profile slug. The profile_username and profile aliases are accepted."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "profile": {
                    "type": "string"
                  },
                  "profile_username": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "push": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "channel_id": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "active"
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "verified_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "expires_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "last_notification_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "youtube_video_published",
                              "youtube_video_updated"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "youtubePushDelete",
        "summary": "Unsubscribe a YouTube push subscription",
        "tags": [
          "YouTube management"
        ],
        "description": "Controls push notifications for the connected YouTube channel. Requires feature enablement and, for registration, an active webhook subscription with an explicit YouTube event.",
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Use the owned profile slug. The profile_username and profile aliases are accepted."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "profile": {
                    "type": "string"
                  },
                  "profile_username": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "push": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "channel_id": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "active"
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "verified_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "expires_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "last_notification_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "youtube_video_published",
                              "youtube_video_updated"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/grants/{grant_id}/advertisers": {
      "get": {
        "operationId": "listTikTokAdsGrantAdvertisers",
        "summary": "List authorized advertisers for a TikTok Ads grant",
        "tags": [
          "TikTok management"
        ],
        "description": "Reads the owner’s unexpired grant and checks the current TikTok authorization.",
        "parameters": [
          {
            "name": "grant_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "grant_id": {
                      "type": "string"
                    },
                    "advertisers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "advertiser_id": {
                            "type": "string",
                            "pattern": "^[0-9]{1,25}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "timezone": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "connected": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "next_page": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/creatives/videos": {
      "post": {
        "operationId": "uploadTikTokAdsvideo",
        "summary": "Upload a staged TikTok Ads video",
        "tags": [
          "TikTok management"
        ],
        "description": "Uploads a PostGuild-staged asset belonging to the caller. Requires TikTok Ads asset enablement and a public HTTPS storage origin.",
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,25}$"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "video_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "file_name": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "video_url"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "video_id": {
                      "type": "string"
                    },
                    "creative": {
                      "type": "object",
                      "properties": {
                        "video_id": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/creatives/images": {
      "post": {
        "operationId": "uploadTikTokAdsimage",
        "summary": "Upload a staged TikTok Ads image",
        "tags": [
          "TikTok management"
        ],
        "description": "Uploads a PostGuild-staged asset belonging to the caller. Requires TikTok Ads asset enablement and a public HTTPS storage origin.",
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,25}$"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "image_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "file_name": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "image_url"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "image_id": {
                      "type": "string"
                    },
                    "creative": {
                      "type": "object",
                      "properties": {
                        "image_id": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/audiences/lookalike": {
      "post": {
        "operationId": "createTikTokAdsLookalike",
        "summary": "Create a lookalike audience",
        "tags": [
          "TikTok management"
        ],
        "description": "Uses an eligible source audience on the selected advertiser and either TikTok location IDs or unambiguous ISO country codes.",
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,25}$"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "source_audience_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "location_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    }
                  },
                  "audience_size": {
                    "type": "string",
                    "enum": [
                      "NARROW",
                      "BALANCED",
                      "BROAD"
                    ]
                  },
                  "include_source": {
                    "type": "boolean"
                  },
                  "mobile_os": {
                    "type": "string",
                    "enum": [
                      "ALL",
                      "IOS",
                      "ANDROID"
                    ]
                  }
                },
                "required": [
                  "name",
                  "source_audience_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "custom_audience_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/audiences/customer-file": {
      "post": {
        "operationId": "createTikTokAdsCustomerAudience",
        "summary": "Create a TikTok customer-file audience",
        "tags": [
          "TikTok management"
        ],
        "description": "Hashes authorized first-party emails or E.164 telephone numbers in memory. Accepts SHA-256 input, up to 100,000 values and an 8 MiB request.",
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,25}$"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "identifier_type": {
                    "type": "string",
                    "enum": [
                      "email",
                      "phone"
                    ]
                  },
                  "identifiers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 100000
                  },
                  "retention_in_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  },
                  "confirm_authorized": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "name",
                  "identifier_type",
                  "identifiers",
                  "confirm_authorized"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "custom_audience_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "identifiers_uploaded": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/audiences/{audience_id}/delete": {
      "post": {
        "operationId": "deleteTikTokAdsAudience",
        "summary": "Delete a TikTok Ads audience",
        "tags": [
          "TikTok management"
        ],
        "description": "Requires confirmation and a connected advertiser with permission to delete the audience.",
        "parameters": [
          {
            "name": "audience_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "advertiser_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,25}$"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "confirm": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "custom_audience_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/interests": {
      "get": {
        "operationId": "getTikTokAdsInterests",
        "summary": "List interest categories for an advertiser",
        "tags": [
          "TikTok management"
        ],
        "description": "Reads TikTok’s targeting taxonomy for an authorized advertiser.",
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,25}$"
            },
            "required": false
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "zh",
                "ja",
                "de",
                "es",
                "fr",
                "id",
                "it",
                "ko",
                "ru",
                "th",
                "tr",
                "vi",
                "ar",
                "pt",
                "ms"
              ]
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "interest_categories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "interest_category_id": {
                            "type": "string",
                            "pattern": "^[0-9]{1,25}$"
                          },
                          "interest_category_name": {
                            "type": "string"
                          },
                          "level": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "sub_category_ids": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[0-9]{1,25}$"
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/spark/posts": {
      "get": {
        "operationId": "getTikTokAdsSparkPosts",
        "summary": "List videos eligible for Spark Ads",
        "tags": [
          "TikTok management"
        ],
        "description": "Use identity_id with cursor pagination for linked TikTok posts or page and page_size for posts authorized by code.",
        "parameters": [
          {
            "name": "advertiser_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,25}$"
            },
            "required": false
          },
          {
            "name": "identity_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "identity_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "TT_USER",
                "BC_AUTH_TT"
              ]
            },
            "required": false
          },
          {
            "name": "identity_authorized_bc_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,25}$"
            },
            "required": false
          },
          {
            "name": "item_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "VIDEO",
                "CAROUSEL"
              ]
            },
            "required": false
          },
          {
            "name": "count",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            },
            "required": false
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "exclude_adsonly",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "required": false
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "required": false
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "item_id": {
                            "type": "string",
                            "pattern": "^[0-9]{1,25}$"
                          },
                          "item_type": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "identity_id": {
                            "type": "string"
                          },
                          "identity_type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "page_info": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/ads/tiktok/boost": {
      "post": {
        "operationId": "boostTikTokPostPaused",
        "summary": "Create a disabled TikTok Traffic campaign, group, and Spark ad",
        "tags": [
          "TikTok management"
        ],
        "description": "Uses one lifetime budget, explicit start and end dates, an owned TikTok video and a stable request ID. Incomplete requests return available provider IDs for review and are never automatically recreated.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "advertiser_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "goal": {
                    "type": "string",
                    "const": "traffic"
                  },
                  "budget": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "lifetime"
                      },
                      "amount": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 1000000
                      }
                    },
                    "required": [
                      "type",
                      "amount"
                    ]
                  },
                  "targeting": {
                    "type": "object",
                    "properties": {
                      "location_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[0-9]{1,25}$"
                        }
                      }
                    },
                    "required": [
                      "location_ids"
                    ]
                  },
                  "schedule": {
                    "type": "object",
                    "properties": {
                      "start_date": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "end_date": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "start_date",
                      "end_date"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "const": "paused"
                  },
                  "request_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,19}$"
                  },
                  "identity_id": {
                    "type": "string"
                  },
                  "identity_type": {
                    "type": "string",
                    "const": "TT_USER"
                  },
                  "post_id": {
                    "type": "string",
                    "pattern": "^[0-9]{1,25}$"
                  },
                  "landing_page_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "call_to_action": {
                    "type": "string",
                    "enum": [
                      "LEARN_MORE",
                      "SHOP_NOW",
                      "SIGN_UP"
                    ]
                  }
                },
                "required": [
                  "advertiser_id",
                  "name",
                  "goal",
                  "budget",
                  "targeting",
                  "schedule",
                  "identity_id",
                  "post_id",
                  "landing_page_url",
                  "request_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed retry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "complete"
                      ]
                    },
                    "campaign_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "adgroup_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "ad_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "complete"
                      ]
                    },
                    "campaign_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "adgroup_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "ad_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "description": "Request in progress or needing review",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "in_progress",
                        "needs_review"
                      ]
                    },
                    "campaign_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "adgroup_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "ad_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "description": "Request in progress or needing review",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "in_progress",
                        "needs_review"
                      ]
                    },
                    "campaign_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "adgroup_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "ad_id": {
                      "type": "string",
                      "pattern": "^[0-9]{1,25}$"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/uploadposts/tiktok/music/trending": {
      "get": {
        "operationId": "getTikTokCommercialMusicTrends",
        "summary": "Get a TikTok Commercial Music Library chart",
        "tags": [
          "TikTok management"
        ],
        "description": "Uses an approved Business Organic discovery grant for the owned profile. PostGuild reports null for TikTok playback sound IDs that TikTok does not provide.",
        "parameters": [
          {
            "name": "profile",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "genre",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "country_code",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "date_range",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1DAY",
                "7DAY",
                "30DAY",
                "90DAY"
              ]
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "genre": {
                      "type": "string"
                    },
                    "country_code": {
                      "type": "string"
                    },
                    "date_range": {
                      "type": "string"
                    },
                    "tracks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "commercial_music_id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "artist": {
                            "type": "string"
                          },
                          "duration": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "rank": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "genres": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "cover_url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "preview_url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer <PostGuild API key>"
      },
      "Apikey": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Authorization: Apikey <PostGuild API key>"
      },
      "ConnectLink": {
        "type": "http",
        "scheme": "bearer",
        "description": "Token from a PostGuild hosted connection URL."
      },
      "TemporaryMediaToken": {
        "type": "apiKey",
        "in": "query",
        "name": "token",
        "description": "Token from the temporary media_url."
      }
    },
    "responses": {
      "Error": {
        "description": "Request rejected",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "success",
                "error"
              ],
              "properties": {
                "success": {
                  "type": "boolean",
                  "const": false
                },
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "TeamSuccess": {
        "description": "Success",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "success"
              ],
              "properties": {
                "success": {
                  "type": "boolean",
                  "const": true
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Subscription": {
        "type": "object",
        "required": [
          "id",
          "url",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "required": [
          "id",
          "endpointId",
          "attempts",
          "sentAt",
          "dueAt",
          "createdAt",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "endpointId": {
            "type": "string",
            "format": "uuid"
          },
          "attempts": {
            "type": "integer"
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dueAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed"
            ]
          }
        }
      },
      "Platform": {
        "type": "string",
        "enum": [
          "facebook",
          "instagram",
          "x",
          "youtube",
          "tiktok"
        ]
      },
      "AcceptedPost": {
        "type": "object",
        "required": [
          "success",
          "request_id",
          "job_id",
          "total_platforms",
          "scheduled_date"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "total_platforms": {
            "type": "integer"
          },
          "scheduled_date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Post": {
        "type": "object",
        "required": [
          "request_id",
          "job_id",
          "external_id",
          "profile_username",
          "title",
          "text",
          "scheduled_date",
          "created_at",
          "status",
          "results"
        ],
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "profile_username": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "text": {
            "type": "string"
          },
          "scheduled_date": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "needs_review",
              "completed",
              "partial",
              "cancelled",
              "failed"
            ]
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinationResult"
            }
          }
        }
      },
      "DestinationResult": {
        "type": "object",
        "required": [
          "platform",
          "status",
          "success",
          "post_id",
          "post_url",
          "error"
        ],
        "properties": {
          "platform": {
            "$ref": "#/components/schemas/Platform"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "sending",
              "pending",
              "published",
              "failed",
              "uncertain",
              "cancelled"
            ]
          },
          "success": {
            "type": "boolean"
          },
          "post_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "post_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Profile": {
        "type": "object",
        "required": [
          "username",
          "display_name",
          "social_accounts"
        ],
        "properties": {
          "username": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "social_accounts": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "required": [
                "username",
                "id"
              ],
              "properties": {
                "username": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
