{
  "openapi": "3.1.1",
  "info": {
    "title": "PostLayer API",
    "description": "One API for every social channel. Authenticate with an API key: `Authorization: Bearer sk_test_...`.",
    "contact": {
      "name": "PostLayer",
      "url": "https://postlayer.org"
    },
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.postlayer.quanlylophoc.online"
    }
  ],
  "paths": {
    "/v1/accounts": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List accounts",
        "description": "Returns connected social accounts. Disconnected accounts are only returned when filtering by `status=disconnected`.",
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Platform"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/SocialAccountStatus"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOfSocialAccountDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/accounts/{id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Retrieve an account",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialAccountDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Accounts"
        ],
        "summary": "Disconnect an account",
        "description": "Revokes and deletes stored credentials. Scheduled posts targeting the account will fail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialAccountDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/accounts/{id}/feed": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Read an account's feed",
        "description": "Paid plans. Posts on the account's timeline as returned by the platform, newest first, including posts not\npublished through PostLayer, with the engagement the platform reports (`null` when it doesn't provide a\nmetric). Items published through PostLayer carry `post_id`. Pages are cached for one minute. Supported for\nFacebook Pages, Instagram, X, YouTube and TikTok (with `video.list`); not for LinkedIn. Sandbox accounts\nreturn their sandbox posts with simulated metrics (`simulated: true`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedPageDto"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/accounts/sandbox": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Create a sandbox account",
        "description": "Creates a simulated account for testing. Sandbox accounts never contact the platform; publishing is simulated\nwhile enforcing the platform's content rules. Include `#sandbox-fail` in a post to simulate a rejection.\nRequires a test API key or the dashboard. Supports `Idempotency-Key`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A unique key (up to 255 characters) that makes retries safe. Responses are replayed for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSandboxAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSandboxAccountRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSandboxAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialAccountDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/accounts/connect": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Start connecting an account",
        "description": "Dashboard only. Returns the platform authorization URL to redirect the user to. After consent the platform\nredirects back to PostLayer, which stores the account and redirects to the dashboard. When the platform returns\nseveral accounts (e.g. every Facebook Page the user manages), the dashboard first asks which ones to add.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectAccountRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectAccountResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/accounts/selections/{id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get accounts to choose from",
        "description": "Dashboard only. After connecting a platform that returned several accounts, lists them so the user can choose\nwhich to add. Available to the user who connected, for 15 minutes.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSelectionDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Connect the chosen accounts",
        "description": "Dashboard only. Connects the chosen accounts; the others are discarded along with their authorization. Accounts\nthat were already connected and aren't chosen stay connected.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteSelectionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteSelectionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteSelectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SocialAccountDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/accounts/{id}/youtube/playlists": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List a YouTube channel's playlists",
        "description": "The channel's own playlists, to choose where a new video goes (`platform_options.youtube.playlist_id`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlaylistInfo"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/platforms": {
      "get": {
        "tags": [
          "Platforms"
        ],
        "summary": "List platforms",
        "description": "Supported platforms, whether a live connector is available and configured, and the content capabilities\nPostLayer enforces for each. No authentication required; when authenticated, the organization's own platform\napps are taken into account (`organization_app_configured`).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlatformDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/api-keys": {
      "get": {
        "tags": [
          "API Keys"
        ],
        "summary": "List API keys",
        "description": "Returns key metadata and prefixes. Full keys are never returned after creation.",
        "parameters": [
          {
            "name": "include_revoked",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOfApiKeyDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "API Keys"
        ],
        "summary": "Create an API key",
        "description": "Dashboard only. The full `key` is returned once in this response and cannot be retrieved again.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreatedDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/api-keys/{id}": {
      "delete": {
        "tags": [
          "API Keys"
        ],
        "summary": "Revoke an API key",
        "description": "Dashboard only. Requests using the key are rejected immediately.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/analytics/overview": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Get an overview",
        "description": "Publishing and API usage metrics computed from PostLayer's own records (posts, publish results and API requests).\nPlatform engagement metrics are not included.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverviewDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Account settings"
        ],
        "summary": "Get the current user",
        "description": "Dashboard only. Returns the signed-in user and their organization.",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Account settings"
        ],
        "summary": "Update profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/me/organizations": {
      "get": {
        "tags": [
          "Account settings"
        ],
        "summary": "List your organizations",
        "description": "Dashboard only. The organizations the signed-in user belongs to, with their role in each.",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/me/organization": {
      "post": {
        "tags": [
          "Account settings"
        ],
        "summary": "Switch organization",
        "description": "Dashboard only. Makes another of your organizations the one this session works in.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchOrganizationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchOrganizationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/billing": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Get plan and usage",
        "description": "The organization's plan, subscription status and post usage for the current period. A post is one publish\ntarget on a non-sandbox account; usage resets at `period_end`.",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Start a checkout",
        "description": "Dashboard only; owners and admins. Returns a Stripe Checkout URL for a monthly subscription to a paid plan.\nOrganizations that already have a subscription change plans through the billing portal instead.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSessionResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/billing/portal": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Open the billing portal",
        "description": "Dashboard only; owners and admins. Returns a Stripe Customer Portal URL to change plan, cancel, update the\npayment method or download invoices.",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSessionResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/media": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Upload media",
        "description": "Upload an image (JPEG, PNG, GIF, WebP; up to 10 MB) or video (MP4, MOV; up to 250 MB) as\n`multipart/form-data` with a `file` field. The file type is detected from its content.\nThe returned `url` is a short-lived preview link.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "List media",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOfMediaDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/media/uploads": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Start a direct upload",
        "description": "Returns a pre-signed URL for sending the file straight to PostLayer's object storage, which is faster for large\nvideos. `PUT` the file to `upload.url` with the `Content-Type` header set to `upload.content_type`, then call\n`POST /v1/media/{id}/complete`. Until then the media has status `pending` and can't be attached to\nposts; uploads that are never completed are removed after 24 hours. Servers without object storage return\n`409 DIRECT_UPLOAD_UNAVAILABLE`; use `POST /v1/media` there.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMediaUploadRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMediaUploadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMediaUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUploadDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/media/{id}/complete": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Complete a direct upload",
        "description": "Checks the uploaded file (type detected from its content, size limits) and marks the media `ready`. A file\nthat fails the checks is deleted. Returns 409 if the file hasn't been uploaded yet. Completing a ready upload\nagain returns it unchanged.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/media/{id}": {
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "Retrieve media",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Media"
        ],
        "summary": "Delete media",
        "description": "Fails with 409 while the media is attached to a post that has not finished publishing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/members": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "List members",
        "description": "Dashboard only. Everyone in the organization with their role.",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MemberDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/members/{id}": {
      "patch": {
        "tags": [
          "Team"
        ],
        "summary": "Change a member's role",
        "description": "Dashboard only; owners and admins. Only owners can grant or remove the `owner` role, and the last owner\ncan't be demoted.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Team"
        ],
        "summary": "Remove a member",
        "description": "Dashboard only. Owners and admins can remove members (only owners can remove an owner); anyone can remove\nthemselves to leave. The last owner can't leave. Someone removed from their only organization gets a new,\nempty workspace.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invitations": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "List pending invitations",
        "description": "Dashboard only; owners and admins.",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationDto"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Invite a member",
        "description": "Dashboard only; owners and admins. Returns an `accept_url` to send to the invitee; it is shown once, expires\nafter 7 days, and can only be accepted by someone signed in with that email address. PostLayer doesn't send the\nemail itself. Inviting the same address again replaces the previous link.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteMemberRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteMemberRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/InviteMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationCreatedDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invitations/{id}": {
      "delete": {
        "tags": [
          "Team"
        ],
        "summary": "Revoke an invitation",
        "description": "Dashboard only; owners and admins. The link stops working immediately.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invitations/preview": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Look up an invitation",
        "description": "Dashboard only. Shows the organization and role an invitation link is for.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationPreviewDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invitations/accept": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Accept an invitation",
        "description": "Dashboard only. The signed-in user must have the invited email address. Joins the organization and switches the\nsession to it.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/platform-apps": {
      "get": {
        "tags": [
          "Platform apps"
        ],
        "summary": "List platform apps",
        "description": "The organization's own OAuth apps (\"bring your own credentials\"). Client secrets are never returned; register\neach `redirect_uri` in the platform's developer console.",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlatformAppDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Platform apps"
        ],
        "summary": "Add a platform app",
        "description": "Dashboard only; owners and admins; paid plans. Stores your app's client ID and encrypted client secret so\naccounts can be connected through your own app (`app_source: \"organization\"`). One app per platform.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlatformAppRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlatformAppRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlatformAppRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformAppDto"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/platform-apps/{id}": {
      "patch": {
        "tags": [
          "Platform apps"
        ],
        "summary": "Rotate a platform app secret",
        "description": "Dashboard only; owners and admins. The client ID can't change because connected accounts' tokens were issued to it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePlatformAppRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePlatformAppRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePlatformAppRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformAppDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Platform apps"
        ],
        "summary": "Delete a platform app",
        "description": "Dashboard only; owners and admins. Fails with 409 while connected accounts use the app.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/posts/{id}/analytics": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Get post analytics",
        "description": "Paid plans. Engagement for each published target, as reported by the platform. Metrics a platform doesn't\nprovide are `null`, never 0. Results are snapshots reused for up to 15 minutes; `refresh=true`\nre-reads snapshots older than a minute. Each target has a `status` explaining missing metrics\n(`unsupported`, `reconnect_required`, `not_published`, `error`). Sandbox targets return\nsimulated metrics (`simulated: true`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostAnalyticsDto"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/posts": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Create a post",
        "description": "Creates a post for one or more connected accounts. Without `scheduled_at` the post is queued for immediate\npublishing; with a future `scheduled_at` it is scheduled; with `draft: true` it is saved as a draft.\nPublishing happens asynchronously: follow progress with `GET /v1/posts/{id}` or webhooks.\nEach non-sandbox target account uses one post from the plan's allowance for the period (drafts use none);\nwhen the allowance is used up the request fails with `402 QUOTA_EXCEEDED`.\nSupports `Idempotency-Key`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A unique key (up to 255 characters) that makes retries safe. Responses are replayed for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "List posts",
        "description": "Returns posts newest first. `from`/`to` filter on the post's effective date: its scheduled time,\notherwise its publish time, otherwise its creation time.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PostStatus"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": [
                "null",
                "string"
              ],
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": [
                "null",
                "string"
              ],
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOfPostDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/posts/{id}": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Retrieve a post",
        "description": "Includes the per-account publishing status, platform post IDs and URLs, and failure reasons.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Posts"
        ],
        "summary": "Update a post",
        "description": "Replaces the content, accounts, media and schedule of a draft or scheduled post.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Posts"
        ],
        "summary": "Cancel a post",
        "description": "Cancels a draft, scheduled or queued post that has not started publishing. Content that was already\npublished is not removed from the platforms. Returns the cancelled post.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A unique key (up to 255 characters) that makes retries safe. Responses are replayed for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/posts/{id}/publish": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Publish a draft",
        "description": "Publishes a draft immediately, or schedules it when `scheduled_at` is provided. Supports `Idempotency-Key`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A unique key (up to 255 characters) that makes retries safe. Responses are replayed for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PublishPostRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PublishPostRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PublishPostRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/posts/{id}/targets/{targetId}/content": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Get a published post's content",
        "description": "The text (and title, for Facebook videos) of a post PostLayer published, as the platform has it now. Available\nfor Facebook Page posts and videos and LinkedIn posts; YouTube videos use the `/youtube` endpoints.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishedContentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Posts"
        ],
        "summary": "Edit a published post",
        "description": "Changes the text of a Facebook Page post or LinkedIn post that PostLayer published, or the title and description\nof a Facebook video. The change is made on the platform; the post in PostLayer keeps what was published.\nInstagram, X and TikTok don't allow editing through their APIs.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePublishedContentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePublishedContentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePublishedContentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishedContentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/posts/{id}/targets/{targetId}/youtube": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Get a published YouTube video",
        "description": "The video's current settings on YouTube (title, description, tags, category, visibility, thumbnail…) for a\ntarget that PostLayer published. Reads live from YouTube.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Posts"
        ],
        "summary": "Edit a published YouTube video",
        "description": "Changes the title, description, tags, category, visibility, scheduled publish time, audience, license,\nembedding, language or thumbnail of a video PostLayer published. Fields left out stay as they are. The post\nitself in PostLayer is not changed. Needs a channel connected with edit permission: channels connected before\nediting was available get `400 SOCIAL_AUTH_ERROR` and must reconnect.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateYoutubeVideoRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateYoutubeVideoRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateYoutubeVideoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook endpoints",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOfWebhookDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook endpoint",
        "description": "The signing `secret` is only returned in this response (and when rotated). Endpoints must use HTTPS and be\npublicly reachable. Supports `Idempotency-Key`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A unique key (up to 255 characters) that makes retries safe. Responses are replayed for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecretDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/webhooks/events": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List event types",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Retrieve a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook endpoint",
        "description": "Only the provided fields are changed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook endpoint",
        "description": "Pending deliveries to this endpoint are cancelled.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate the signing secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecretDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test event",
        "description": "Queues a `webhook.test` event to the endpoint. Check the delivery list for the result.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/WebhookDeliveryStatus"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOfWebhookDeliveryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/webhooks/{id}/deliveries/{deliveryId}/retry": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Retry a delivery",
        "description": "Re-sends a delivered or failed event with the same event ID so receivers can de-duplicate it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountCandidateDto": {
        "required": [
          "external_id",
          "display_name",
          "username",
          "avatar_url",
          "already_connected"
        ],
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "username": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatar_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "already_connected": {
            "type": "boolean",
            "description": "The account is already connected to this organization; choosing it refreshes its authorization."
          }
        }
      },
      "AccountSelectionDto": {
        "required": [
          "id",
          "platform",
          "candidates",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/Platform"
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountCandidateDto"
            }
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiKeyCreatedDto": {
        "required": [
          "api_key",
          "key"
        ],
        "type": "object",
        "properties": {
          "api_key": {
            "$ref": "#/components/schemas/ApiKeyDto"
          },
          "key": {
            "type": "string"
          }
        },
        "description": "Returned once, on creation. The raw key cannot be retrieved again."
      },
      "ApiKeyDto": {
        "required": [
          "id",
          "name",
          "prefix",
          "environment",
          "last_used_at",
          "created_at",
          "revoked_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "environment": {
            "$ref": "#/components/schemas/ApiKeyEnvironment"
          },
          "last_used_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ApiKeyEnvironment": {
        "enum": [
          "test",
          "live"
        ]
      },
      "BillingDto": {
        "required": [
          "plan",
          "plan_name",
          "subscription_status",
          "post_limit",
          "posts_used",
          "period_start",
          "period_end",
          "cancel_at_period_end",
          "features",
          "can_manage",
          "billing_enabled",
          "has_billing_account",
          "plan_source",
          "manual_plan_expires_at"
        ],
        "type": "object",
        "properties": {
          "plan": {
            "type": "string",
            "description": "The plan in effect (`free`, `pro_1000`, …)."
          },
          "plan_name": {
            "type": "string",
            "description": "Display name of the plan."
          },
          "subscription_status": {
            "description": "Stripe subscription status; `none` when the organization never subscribed.",
            "$ref": "#/components/schemas/SubscriptionStatus"
          },
          "post_limit": {
            "type": "integer",
            "description": "Posts (publish targets to non-sandbox accounts) included per period.",
            "format": "int64"
          },
          "posts_used": {
            "type": "integer",
            "description": "Posts charged in the current period.",
            "format": "int64"
          },
          "period_start": {
            "type": "string",
            "description": "Start of the current usage period.",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "description": "When usage resets.",
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean",
            "description": "The subscription ends at `period_end` and the organization returns to the free plan."
          },
          "features": {
            "description": "Paid features included in the plan.",
            "$ref": "#/components/schemas/PlanFeatures"
          },
          "can_manage": {
            "type": "boolean",
            "description": "Whether the signed-in user may change the plan (owners and admins)."
          },
          "billing_enabled": {
            "type": "boolean",
            "description": "Whether paid plans can be purchased on this server."
          },
          "has_billing_account": {
            "type": "boolean",
            "description": "Whether the billing portal is available for this organization."
          },
          "plan_source": {
            "description": "Where the plan in effect comes from: `free`, a `stripe` subscription, or `manual` (granted by PostLayer).",
            "$ref": "#/components/schemas/PlanSource"
          },
          "manual_plan_expires_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When a manually granted plan ends; null when it doesn't expire or no manual plan is in effect.",
            "format": "date-time"
          }
        },
        "description": "The organization's plan, subscription and post usage for the current period."
      },
      "BillingSessionResponse": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The hosted Stripe page to redirect the browser to.",
            "format": "uri"
          }
        }
      },
      "CheckoutRequest": {
        "required": [
          "plan"
        ],
        "type": "object",
        "properties": {
          "plan": {
            "type": "string",
            "description": "The paid plan to subscribe to, e.g. `pro_1000`."
          }
        }
      },
      "CompleteSelectionRequest": {
        "type": "object",
        "properties": {
          "external_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Platform IDs (`external_id`) of the candidates to connect."
          }
        }
      },
      "ConnectAccountRequest": {
        "required": [
          "platform"
        ],
        "type": "object",
        "properties": {
          "platform": {
            "description": "The platform to connect. It must have a live connector configured on the server.",
            "$ref": "#/components/schemas/Platform"
          },
          "app_source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Which OAuth app to connect through: `postlayer` (PostLayer's app) or `organization` (your own app\nfrom `/v1/platform-apps`, paid plans). Defaults to your own app when one is configured and your plan\nincludes it, otherwise PostLayer's app.",
                "$ref": "#/components/schemas/PlatformAppSource"
              }
            ]
          }
        }
      },
      "ConnectAccountResponse": {
        "required": [
          "authorization_url",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "authorization_url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConnectorCapabilities": {
        "required": [
          "supports_text",
          "supports_image",
          "supports_video",
          "supports_carousel",
          "supports_schedule",
          "supports_comments",
          "supports_webhooks",
          "requires_media",
          "max_text_length",
          "max_media_items"
        ],
        "type": "object",
        "properties": {
          "supports_text": {
            "type": "boolean"
          },
          "supports_image": {
            "type": "boolean"
          },
          "supports_video": {
            "type": "boolean"
          },
          "supports_carousel": {
            "type": "boolean"
          },
          "supports_schedule": {
            "type": "boolean"
          },
          "supports_comments": {
            "type": "boolean"
          },
          "supports_webhooks": {
            "type": "boolean"
          },
          "requires_media": {
            "type": "boolean"
          },
          "max_text_length": {
            "type": "integer",
            "format": "int32"
          },
          "max_media_items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "description": "What PostLayer can do on a platform through a given connector."
      },
      "CountWithTrend": {
        "required": [
          "total",
          "last7_days",
          "previous7_days"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "last7_days": {
            "type": "integer",
            "format": "int64"
          },
          "previous7_days": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CreateApiKeyRequest": {
        "required": [
          "name",
          "environment"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "A label to recognize the key, e.g. \"Production server\"."
          },
          "environment": {
            "description": "`test` keys only publish to sandbox accounts; `live` keys only to real accounts.",
            "$ref": "#/components/schemas/ApiKeyEnvironment"
          }
        }
      },
      "CreateMediaUploadRequest": {
        "type": "object",
        "properties": {
          "file_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Original file name, kept for display."
          },
          "content_type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file's type: `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `video/mp4` or `video/quicktime`."
          },
          "size_bytes": {
            "type": "integer",
            "description": "File size in bytes (images up to 10 MB, videos up to 250 MB).",
            "format": "int64"
          }
        }
      },
      "CreatePlatformAppRequest": {
        "required": [
          "platform",
          "client_id",
          "client_secret"
        ],
        "type": "object",
        "properties": {
          "platform": {
            "$ref": "#/components/schemas/Platform"
          },
          "client_id": {
            "type": "string",
            "description": "The app's client ID (Facebook/Instagram app ID, TikTok client key, OAuth 2.0 client ID)."
          },
          "client_secret": {
            "type": "string",
            "description": "The app's client secret. Stored encrypted and never returned."
          }
        }
      },
      "CreatePostRequest": {
        "type": "object",
        "properties": {
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "The post text. Optional when media is attached."
          },
          "account_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "IDs of the accounts to publish to. Required unless `draft` is true."
          },
          "media_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "IDs of uploaded media, in display order."
          },
          "scheduled_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When to publish, as ISO-8601 with a UTC offset. Omit to publish immediately.",
            "format": "date-time"
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ],
            "description": "IANA timezone the post was scheduled in (e.g. `Europe/Paris`), kept for display."
          },
          "draft": {
            "type": "boolean",
            "description": "Save as a draft instead of publishing."
          },
          "platform_options": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Settings for specific platforms, e.g. `{\"youtube\": {\"title\": \"…\", \"privacy_status\": \"unlisted\"}}`.",
                "$ref": "#/components/schemas/PlatformOptions"
              }
            ]
          }
        }
      },
      "CreateSandboxAccountRequest": {
        "required": [
          "platform"
        ],
        "type": "object",
        "properties": {
          "platform": {
            "description": "The platform whose rules the sandbox account enforces.",
            "$ref": "#/components/schemas/Platform"
          },
          "display_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional display name. Defaults to \"Sandbox {Platform}\"."
          }
        }
      },
      "CreateWebhookRequest": {
        "required": [
          "url",
          "events"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "HTTPS URL that receives events."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Event types to subscribe to. See `GET /v1/webhooks/events`."
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DailyPoint": {
        "required": [
          "date",
          "published",
          "failed",
          "api_requests"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "published": {
            "type": "integer",
            "format": "int64"
          },
          "failed": {
            "type": "integer",
            "format": "int64"
          },
          "api_requests": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ErrorBody": {
        "required": [
          "code",
          "message",
          "details"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          }
        }
      },
      "ErrorDetail": {
        "required": [
          "field",
          "message"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "required": [
          "error",
          "request_id"
        ],
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          },
          "request_id": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "The standard error envelope returned by every PostLayer endpoint."
      },
      "FeedItemDto": {
        "required": [
          "platform_post_id",
          "text",
          "created_at",
          "url",
          "media_type",
          "thumbnail_url",
          "metrics",
          "post_id"
        ],
        "type": "object",
        "properties": {
          "platform_post_id": {
            "type": "string"
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "created_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "media_type": {
            "type": [
              "null",
              "string"
            ]
          },
          "thumbnail_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "metrics": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Engagement as reported by the platform (simulated for sandbox accounts).",
                "$ref": "#/components/schemas/MetricsDto"
              }
            ]
          },
          "post_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The PostLayer post this item was published from, when it was published through PostLayer."
          }
        }
      },
      "FeedPageDto": {
        "required": [
          "data",
          "next_cursor",
          "has_more",
          "simulated",
          "fetched_at"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeedItemDto"
            }
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Pass as `cursor` to get the next page."
          },
          "has_more": {
            "type": "boolean"
          },
          "simulated": {
            "type": "boolean",
            "description": "True for sandbox accounts: items are PostLayer's own sandbox posts and metrics are simulated."
          },
          "fetched_at": {
            "type": "string",
            "description": "When the page was read from the platform (pages are cached for a minute).",
            "format": "date-time"
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "InvitationCreatedDto": {
        "required": [
          "invitation",
          "accept_url"
        ],
        "type": "object",
        "properties": {
          "invitation": {
            "$ref": "#/components/schemas/InvitationDto"
          },
          "accept_url": {
            "type": "string",
            "description": "Link to send to the invitee. Shown once; only the invited email address can accept it."
          }
        }
      },
      "InvitationDto": {
        "required": [
          "id",
          "email",
          "role",
          "invited_by",
          "expires_at",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/MemberRole"
          },
          "invited_by": {
            "type": [
              "null",
              "string"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InvitationPreviewDto": {
        "required": [
          "organization_name",
          "email",
          "role",
          "invited_by",
          "expires_at",
          "email_matches",
          "already_member"
        ],
        "type": "object",
        "properties": {
          "organization_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/MemberRole"
          },
          "invited_by": {
            "type": [
              "null",
              "string"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "email_matches": {
            "type": "boolean",
            "description": "Whether the signed-in user can accept (their email is the invited one)."
          },
          "already_member": {
            "type": "boolean"
          }
        }
      },
      "InvitationTokenRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": [
              "null",
              "string"
            ],
            "description": "The token from the invitation link."
          }
        }
      },
      "InviteMemberRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email address of the Google account that may accept the invitation."
          },
          "role": {
            "description": "`admin` or `member`.",
            "$ref": "#/components/schemas/MemberRole"
          }
        }
      },
      "MediaDto": {
        "required": [
          "id",
          "file_name",
          "content_type",
          "size_bytes",
          "kind",
          "status",
          "url",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "kind": {
            "$ref": "#/components/schemas/MediaKind"
          },
          "status": {
            "$ref": "#/components/schemas/MediaStatus"
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MediaKind": {
        "enum": [
          "image",
          "video"
        ]
      },
      "MediaStatus": {
        "enum": [
          "pending",
          "ready",
          "deleted"
        ],
        "description": "MediaStatus.Pending: a direct upload was started but not completed. MediaStatus.Deleted: the stored file was removed; the row is kept for post history."
      },
      "MediaUploadDto": {
        "required": [
          "media",
          "upload"
        ],
        "type": "object",
        "properties": {
          "media": {
            "description": "The media record, with status `pending` until the upload is completed.",
            "$ref": "#/components/schemas/MediaDto"
          },
          "upload": {
            "description": "Where and how to send the file.",
            "$ref": "#/components/schemas/UploadInstructionsDto"
          }
        }
      },
      "MeDto": {
        "required": [
          "user",
          "organization",
          "is_platform_admin"
        ],
        "type": "object",
        "properties": {
          "user": {
            "$ref": "#/components/schemas/UserDto"
          },
          "organization": {
            "$ref": "#/components/schemas/OrganizationDto"
          },
          "is_platform_admin": {
            "type": "boolean",
            "description": "True for PostLayer operators (PLATFORM_ADMIN_EMAILS), who can open the admin pages."
          }
        }
      },
      "MemberDto": {
        "required": [
          "id",
          "user_id",
          "email",
          "name",
          "avatar_url",
          "role",
          "joined_at",
          "is_current_user"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatar_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "$ref": "#/components/schemas/MemberRole"
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          },
          "is_current_user": {
            "type": "boolean",
            "description": "True for the signed-in user's own membership."
          }
        }
      },
      "MemberRole": {
        "enum": [
          "owner",
          "admin",
          "member"
        ]
      },
      "MetricsDto": {
        "required": [
          "views",
          "impressions",
          "likes",
          "comments",
          "shares",
          "saves"
        ],
        "type": "object",
        "properties": {
          "views": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "impressions": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "likes": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "comments": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "shares": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "saves": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        },
        "description": "Engagement reported by the platform. Null means the platform doesn't provide the metric; it is never shown as 0."
      },
      "MetricsStatus": {
        "enum": [
          "available",
          "unsupported",
          "reconnect_required",
          "not_published",
          "error"
        ],
        "description": "Whether platform metrics could be read for a published post target."
      },
      "OrganizationDto": {
        "required": [
          "id",
          "name",
          "plan",
          "role"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/MemberRole"
          }
        }
      },
      "OverviewDto": {
        "required": [
          "posts",
          "published",
          "failed",
          "scheduled",
          "drafts",
          "connected_accounts",
          "success_rate",
          "usage",
          "daily"
        ],
        "type": "object",
        "properties": {
          "posts": {
            "$ref": "#/components/schemas/CountWithTrend"
          },
          "published": {
            "$ref": "#/components/schemas/CountWithTrend"
          },
          "failed": {
            "$ref": "#/components/schemas/CountWithTrend"
          },
          "scheduled": {
            "type": "integer",
            "format": "int64"
          },
          "drafts": {
            "type": "integer",
            "format": "int64"
          },
          "connected_accounts": {
            "type": "integer",
            "format": "int64"
          },
          "success_rate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageDto"
          },
          "daily": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DailyPoint"
            }
          }
        },
        "description": "Numbers here are computed from PostLayer's own records only; no platform engagement data is implied."
      },
      "PageOfApiKeyDto": {
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyDto"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PageOfMediaDto": {
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaDto"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PageOfPostDto": {
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostDto"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PageOfSocialAccountDto": {
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialAccountDto"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PageOfWebhookDeliveryDto": {
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryDto"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PageOfWebhookDto": {
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDto"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PlanFeatures": {
        "required": [
          "byo_credentials",
          "feeds",
          "analytics"
        ],
        "type": "object",
        "properties": {
          "byo_credentials": {
            "type": "boolean"
          },
          "feeds": {
            "type": "boolean"
          },
          "analytics": {
            "type": "boolean"
          }
        },
        "description": "Paid-plan features. Each flag gates an API surface; see the Billing documentation."
      },
      "PlanSource": {
        "enum": [
          "free",
          "stripe",
          "manual"
        ],
        "description": "Where an organization's current plan comes from."
      },
      "Platform": {
        "enum": [
          "facebook",
          "instagram",
          "tiktok",
          "linkedin",
          "x",
          "youtube"
        ]
      },
      "PlatformAppDto": {
        "required": [
          "id",
          "platform",
          "client_id",
          "client_secret_hint",
          "redirect_uri",
          "connected_accounts",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/Platform"
          },
          "client_id": {
            "type": "string"
          },
          "client_secret_hint": {
            "type": "string",
            "description": "The last characters of the stored secret. The secret itself is never returned."
          },
          "redirect_uri": {
            "type": "string",
            "description": "Register this redirect/callback URL in the platform's developer console.",
            "format": "uri"
          },
          "connected_accounts": {
            "type": "integer",
            "description": "Connected accounts using this app. The app can't be deleted while this is above zero.",
            "format": "int32"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "An organization's own OAuth app for a platform. The client secret is write-only."
      },
      "PlatformAppSource": {
        "enum": [
          "postlayer",
          "organization",
          null
        ]
      },
      "PlatformDto": {
        "required": [
          "id",
          "name",
          "live_available",
          "live_configured",
          "sandbox_available",
          "capabilities",
          "postlayer_app_configured",
          "organization_app_configured",
          "own_app_allowed"
        ],
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Platform"
          },
          "name": {
            "type": "string"
          },
          "live_available": {
            "type": "boolean",
            "description": "PostLayer implements a live connector for the platform."
          },
          "live_configured": {
            "type": "boolean",
            "description": "Accounts can be connected: PostLayer's app is configured on this server, or (for an authenticated caller) the organization has its own app and its plan includes it."
          },
          "sandbox_available": {
            "type": "boolean"
          },
          "capabilities": {
            "$ref": "#/components/schemas/ConnectorCapabilities"
          },
          "postlayer_app_configured": {
            "type": "boolean",
            "description": "PostLayer's own app credentials are configured on this server."
          },
          "organization_app_configured": {
            "type": "boolean",
            "description": "The caller's organization has its own app for this platform and its plan includes bring-your-own credentials. Always false without authentication."
          },
          "own_app_allowed": {
            "type": "boolean",
            "description": "Whether the organization's plan lets it add its own app for this platform (all plans for X; paid plans for the others). Without authentication, what the free plan allows."
          }
        }
      },
      "PlatformOptions": {
        "type": "object",
        "properties": {
          "youtube": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/YoutubeOptions"
              }
            ]
          }
        },
        "description": "Publishing options for specific platforms, set per post. Platforms without options ignore them."
      },
      "PlaylistInfo": {
        "required": [
          "id",
          "title",
          "item_count",
          "privacy"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "item_count": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "privacy": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PostAnalyticsDto": {
        "required": [
          "post_id",
          "targets"
        ],
        "type": "object",
        "properties": {
          "post_id": {
            "type": "string"
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TargetAnalyticsDto"
            }
          }
        }
      },
      "PostDto": {
        "required": [
          "id",
          "content",
          "status",
          "scheduled_at",
          "timezone",
          "published_at",
          "cancelled_at",
          "media_ids",
          "targets",
          "created_at",
          "updated_at",
          "platform_options"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PostStatus"
          },
          "scheduled_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ]
          },
          "published_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "cancelled_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "media_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostTargetDto"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "platform_options": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PlatformOptions"
              }
            ]
          }
        }
      },
      "PostStatus": {
        "enum": [
          "draft",
          "scheduled",
          "queued",
          "publishing",
          "published",
          "failed",
          "cancelled"
        ]
      },
      "PostTargetDto": {
        "required": [
          "id",
          "account_id",
          "platform",
          "account_name",
          "status",
          "platform_post_id",
          "url",
          "error",
          "published_at",
          "warning"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "account_id": {
            "type": "string"
          },
          "platform": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Platform"
              }
            ]
          },
          "account_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/PostTargetStatus"
          },
          "platform_post_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TargetErrorDto"
              }
            ]
          },
          "published_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "warning": {
            "type": [
              "null",
              "string"
            ],
            "description": "A non-fatal problem after publishing, e.g. a YouTube thumbnail or playlist that couldn't be applied."
          }
        }
      },
      "PostTargetStatus": {
        "enum": [
          "pending",
          "publishing",
          "published",
          "failed",
          "cancelled"
        ]
      },
      "PublishedContentDto": {
        "required": [
          "platform",
          "text",
          "title",
          "has_title",
          "url",
          "max_text_length"
        ],
        "type": "object",
        "properties": {
          "platform": {
            "$ref": "#/components/schemas/Platform"
          },
          "text": {
            "type": "string"
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "The title, for posts that have one (Facebook videos)."
          },
          "has_title": {
            "type": "boolean",
            "description": "Whether the post has a title that can be edited."
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "max_text_length": {
            "type": "integer",
            "description": "The platform's limit for the text.",
            "format": "int32"
          }
        }
      },
      "PublishPostRequest": {
        "type": "object",
        "properties": {
          "scheduled_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "Schedule instead of publishing now. ISO-8601 with a UTC offset.",
            "format": "date-time"
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ],
            "description": "IANA timezone the post was scheduled in."
          }
        }
      },
      "SocialAccountDto": {
        "required": [
          "id",
          "platform",
          "display_name",
          "username",
          "avatar_url",
          "status",
          "sandbox",
          "connected_at",
          "disconnected_at",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/Platform"
          },
          "display_name": {
            "type": "string"
          },
          "username": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatar_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/SocialAccountStatus"
          },
          "sandbox": {
            "type": "boolean"
          },
          "connected_at": {
            "type": "string",
            "format": "date-time"
          },
          "disconnected_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SocialAccountStatus": {
        "enum": [
          "connected",
          "token_expired",
          "disconnected",
          "error"
        ]
      },
      "SubscriptionStatus": {
        "enum": [
          "none",
          "incomplete",
          "incomplete_expired",
          "trialing",
          "active",
          "past_due",
          "unpaid",
          "canceled",
          "paused"
        ],
        "description": "Mirrors Stripe's subscription status. SubscriptionStatus.None means the organization never subscribed."
      },
      "SwitchOrganizationRequest": {
        "type": "object",
        "properties": {
          "organization_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID of an organization you belong to."
          }
        }
      },
      "TargetAnalyticsDto": {
        "required": [
          "target_id",
          "account_id",
          "platform",
          "platform_post_id",
          "status",
          "metrics",
          "fetched_at",
          "simulated",
          "message"
        ],
        "type": "object",
        "properties": {
          "target_id": {
            "type": "string"
          },
          "account_id": {
            "type": "string"
          },
          "platform": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Platform"
              }
            ]
          },
          "platform_post_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "description": "`available`: metrics were read; `unsupported`: the platform doesn't expose them to PostLayer;\n        `reconnect_required`: the account must be reconnected (expired token or missing read permission);\n        `not_published`: the target isn't published; `error`: the platform returned an error (see `message`).",
            "$ref": "#/components/schemas/MetricsStatus"
          },
          "metrics": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MetricsDto"
              }
            ]
          },
          "fetched_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the metrics were read from the platform. Snapshots are reused for up to 15 minutes.",
            "format": "date-time"
          },
          "simulated": {
            "type": "boolean",
            "description": "True for sandbox accounts, whose metrics are generated for testing."
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TargetErrorDto": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "UpdateMemberRequest": {
        "type": "object",
        "properties": {
          "role": {
            "description": "`owner`, `admin` or `member`. Only owners can grant or remove the owner role.",
            "$ref": "#/components/schemas/MemberRole"
          }
        }
      },
      "UpdatePlatformAppRequest": {
        "required": [
          "client_secret"
        ],
        "type": "object",
        "properties": {
          "client_secret": {
            "type": "string",
            "description": "A new client secret, e.g. after rotating it in the platform's console."
          }
        }
      },
      "UpdateProfileRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "organization_name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdatePublishedContentRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The new text of the post (for Facebook videos, the description)."
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "The new title, for posts that have one (Facebook videos)."
          }
        }
      },
      "UpdateWebhookRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "events": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "enabled": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Disabled endpoints receive no deliveries."
          }
        }
      },
      "UpdateYoutubeVideoRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "New title, up to 100 characters, without `&lt;` or `&gt;`."
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "New description, up to 5,000 characters."
          },
          "tags": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Replaces all tags. Send an empty list to remove them."
          },
          "category_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "privacy_status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/YoutubePrivacy"
              }
            ]
          },
          "publish_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "Make a private video public at this time. Only for videos that haven't been public yet.",
            "format": "date-time"
          },
          "made_for_kids": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "contains_synthetic_media": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "license": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/YoutubeLicense"
              }
            ]
          },
          "embeddable": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "default_language": {
            "type": [
              "null",
              "string"
            ]
          },
          "thumbnail_media_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID of an uploaded JPEG or PNG image (up to 2 MB) to use as the new thumbnail."
          }
        },
        "description": "Changes to a video that PostLayer published. Fields left out stay as they are on YouTube."
      },
      "UploadInstructionsDto": {
        "required": [
          "url",
          "method",
          "content_type",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Pre-signed URL to send the file to."
          },
          "method": {
            "type": "string",
            "description": "Always `PUT`."
          },
          "content_type": {
            "type": "string",
            "description": "Send this exact value as the request's `Content-Type` header; it is part of the signature."
          },
          "expires_at": {
            "type": "string",
            "description": "The upload must start before this time.",
            "format": "date-time"
          }
        },
        "description": "How to send the file for a direct upload."
      },
      "UsageDto": {
        "required": [
          "requests_this_month",
          "posts_this_period",
          "post_limit",
          "plan",
          "period_start",
          "period_end"
        ],
        "type": "object",
        "properties": {
          "requests_this_month": {
            "type": "integer",
            "description": "API-key requests this calendar month (UTC). Informational; requests are limited only by rate limits.",
            "format": "int64"
          },
          "posts_this_period": {
            "type": "integer",
            "description": "Posts (publish targets to non-sandbox accounts) charged in the current plan period.",
            "format": "int64"
          },
          "post_limit": {
            "type": "integer",
            "description": "Posts included in the plan per period.",
            "format": "int64"
          },
          "plan": {
            "type": "string",
            "description": "The plan in effect."
          },
          "period_start": {
            "type": "string",
            "description": "Start of the current plan period.",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "description": "When post usage resets.",
            "format": "date-time"
          }
        }
      },
      "UserDto": {
        "required": [
          "id",
          "email",
          "name",
          "avatar_url",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatar_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "VideoDetails": {
        "required": [
          "id",
          "title",
          "description",
          "tags",
          "category_id",
          "privacy_status",
          "publish_at",
          "made_for_kids",
          "contains_synthetic_media",
          "license",
          "embeddable",
          "default_language",
          "thumbnail_url",
          "url"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "privacy_status": {
            "$ref": "#/components/schemas/YoutubePrivacy"
          },
          "publish_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "made_for_kids": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "contains_synthetic_media": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "license": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/YoutubeLicense"
              }
            ]
          },
          "embeddable": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "default_language": {
            "type": [
              "null",
              "string"
            ]
          },
          "thumbnail_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "description": "A video's current settings on YouTube."
      },
      "WebhookDeliveryDto": {
        "required": [
          "id",
          "webhook_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "response_status",
          "response_body",
          "error",
          "duration_ms",
          "payload",
          "created_at",
          "last_attempt_at",
          "next_attempt_at",
          "delivered_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "webhook_id": {
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/WebhookDeliveryStatus"
          },
          "attempts": {
            "type": "integer",
            "format": "int32"
          },
          "response_status": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "response_body": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration_ms": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "payload": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_attempt_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "next_attempt_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "delivered_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "WebhookDeliveryStatus": {
        "enum": [
          "pending",
          "delivered",
          "failed"
        ]
      },
      "WebhookDto": {
        "required": [
          "id",
          "url",
          "description",
          "events",
          "enabled",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookWithSecretDto": {
        "required": [
          "webhook",
          "secret"
        ],
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/WebhookDto"
          },
          "secret": {
            "type": "string"
          }
        },
        "description": "Returned on creation and secret rotation only."
      },
      "YoutubeLicense": {
        "enum": [
          "youtube",
          "creative_common",
          null
        ]
      },
      "YoutubeOptions": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "Video title, up to 100 characters, without `&lt;` or `&gt;`. Defaults to the first line of the post."
          },
          "tags": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Tags (keywords). YouTube allows about 500 characters in total."
          },
          "category_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "YouTube category ID, e.g. `22` (People &amp; Blogs), `27` (Education), `28` (Science &amp; Technology)."
          },
          "privacy_status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "`public`, `unlisted` or `private`. Defaults to the server's setting.",
                "$ref": "#/components/schemas/YoutubePrivacy"
              }
            ]
          },
          "publish_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "Upload as private and let YouTube make the video public at this time (ISO-8601 with an offset).",
            "format": "date-time"
          },
          "made_for_kids": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the video is made for kids (required by COPPA). Defaults to false."
          },
          "contains_synthetic_media": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the video contains realistic altered or synthetic (e.g. AI-generated) content."
          },
          "notify_subscribers": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether YouTube notifies subscribers about the new video. Defaults to true."
          },
          "playlist_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID of one of the channel's playlists to add the video to."
          },
          "thumbnail_media_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID of an uploaded JPEG or PNG image (up to 2 MB) to use as the custom thumbnail."
          },
          "license": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "`youtube` (standard license) or `creative_common` (Creative Commons Attribution).",
                "$ref": "#/components/schemas/YoutubeLicense"
              }
            ]
          },
          "embeddable": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the video can be embedded on other websites. Defaults to true."
          },
          "default_language": {
            "type": [
              "null",
              "string"
            ],
            "description": "Language of the title and description, e.g. `vi` or `en`."
          }
        },
        "description": "YouTube video settings. Anything left out uses the default: the first line of the post as the title, the full post\nas the description, category People &amp; Blogs, the server's default visibility, not made for kids."
      },
      "YoutubePrivacy": {
        "enum": [
          "public",
          "unlisted",
          "private",
          null
        ]
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "description": "API keys are created in the dashboard. Test keys only publish to sandbox accounts.",
        "scheme": "bearer",
        "bearerFormat": "sk_test_... or sk_live_..."
      }
    }
  },
  "tags": [
    {
      "name": "Accounts"
    },
    {
      "name": "Platforms"
    },
    {
      "name": "API Keys"
    },
    {
      "name": "Analytics"
    },
    {
      "name": "Account settings"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Media"
    },
    {
      "name": "Team"
    },
    {
      "name": "Platform apps"
    },
    {
      "name": "Posts"
    },
    {
      "name": "Webhooks"
    }
  ]
}