{
  "openapi": "3.1.0",
  "info": {
    "title": "Relay Port API",
    "version": "2026-12-01",
    "description": "Relay Port is the publishing rail that sends every post once and always tells you what happened."
  },
  "servers": [
    {
      "url": "https://api.relayport.dev"
    }
  ],
  "tags": [
    {
      "name": "Accounts",
      "description": "Connected social accounts: connect, read, check, move between brands and disconnect."
    },
    {
      "name": "Connect links",
      "description": "Hosted pages your customers open to connect their own accounts without a Dashboard login."
    },
    {
      "name": "Brands",
      "description": "Brands group accounts, posts, queues and media. A brand-restricted key sees only its brands."
    },
    {
      "name": "Posts",
      "description": "Create, schedule, publish and follow posts, one target per connected account."
    },
    {
      "name": "Queues",
      "description": "Weekly posting times in one time zone; mode queue takes the earliest free slot."
    },
    {
      "name": "Media",
      "description": "Images and videos to attach to posts: direct upload, presigned upload or import from a URL."
    },
    {
      "name": "Platforms",
      "description": "The platforms, their publishing rules and capabilities, and the planned platforms."
    },
    {
      "name": "Webhooks",
      "description": "Signed Standard Webhooks deliveries of the public events to your endpoints."
    },
    {
      "name": "Events",
      "description": "The public event log, the same events the webhooks deliver."
    },
    {
      "name": "Usage",
      "description": "The workspace's meters against its plan."
    },
    {
      "name": "API keys",
      "description": "Scoped rp_live_ and rp_test_ keys and the log of the requests made to the workspace, managed from a signed-in session."
    },
    {
      "name": "Workspaces",
      "description": "The workspaces a signed-in user belongs to and their product modules."
    },
    {
      "name": "Members",
      "description": "The people in a workspace and their roles."
    },
    {
      "name": "Invites",
      "description": "Email invites into a workspace."
    },
    {
      "name": "Billing",
      "description": "The plans and their prices."
    },
    {
      "name": "Feedback",
      "description": "Votes for planned platforms and modules."
    }
  ],
  "paths": {
    "/accounts": {
      "get": {
        "operationId": "listAccounts",
        "summary": "List connected social accounts",
        "description": "A brand-restricted key sees only its brands' accounts; a test key sees only test accounts and a live key never sees them.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SocialAccount"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/accounts/{id}": {
      "get": {
        "operationId": "getAccount",
        "summary": "Get a social account",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialAccount"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "patch": {
        "operationId": "moveAccount",
        "summary": "Move an account to another brand",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "brandId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialAccount"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "delete": {
        "operationId": "disconnectAccount",
        "summary": "Disconnect an account",
        "description": "Deletes the stored credentials and keeps the account record with status disconnected.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialAccount"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/accounts/{id}/capabilities": {
      "get": {
        "operationId": "getAccountCapabilities",
        "summary": "List what an account can do",
        "description": "One entry per capability key with its state (available, reconnect_required, requires_variant, plan_upgrade, coming_soon, unsupported ...), a reason and the action URL when one applies.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountCapabilities"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/accounts/{id}/check": {
      "post": {
        "operationId": "checkAccount",
        "summary": "Check an account's connection with the platform",
        "description": "Reads the profile from the platform and updates the account's status (active, action_required or reconnect_required).",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialAccount"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/AccountDisconnectedOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/accounts/{id}/limits": {
      "get": {
        "operationId": "getAccountLimits",
        "summary": "Get an account's publishing budgets",
        "description": "The platform quota and the rolling-window budgets of the account's publish and prepare lanes, with the last rate pressure the platform reported.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountLimits"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/accounts/connect": {
      "post": {
        "operationId": "connectAccount",
        "summary": "Start connecting a social account",
        "description": "Sessions can connect any live platform. API keys: test keys only, for test platforms such as sandbox, which connect at once; connect a real account through a connect link (POST /connect-links). Send redirectUri (and state) to end an OAuth connect on your own page with status, accountIds, brandId, state and error. A planned platform is 422 CapabilityUnavailable with details { platform, availability, release, interestKey, interestUrl }.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "authVariant": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "brandId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "accountId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The account being reconnected; reconnecting an account already counted is allowed at the plan's account limit"
                  },
                  "returnTo": {
                    "type": "string",
                    "maxLength": 512,
                    "pattern": "^\\/(?![/\\\\])[^\\\\]*$"
                  },
                  "redirectUri": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "state": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "platform"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. An OAuth platform: open authUrl in the browser before expiresAt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ConnectStart"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Created. A platform with a direct connect (sandbox): the connected account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialAccount"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredOrPlanLimitReached"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgressOrWorkspaceDeletionInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/CapabilityUnavailableOrIdempotencyKeyReusedOrUnsupportedAuthVariantOrUnsupportedPlatformOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-key-modes": [
          "test"
        ],
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/api-keys": {
      "get": {
        "operationId": "listApiKeys",
        "summary": "List API keys",
        "description": "Newest first, revoked and expired keys included. The secret is never shown again.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "developer",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "createApiKey",
        "summary": "Create an API key",
        "description": "The response carries the secret (rp_live_... or rp_test_...) once; store it. A test key reaches only test platforms such as sandbox. Scopes must be available to the workspace: unknown or unavailable scopes are 422 with details.unknown and details.unavailable. brandIds restricts the key to those brands.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ConcurrencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "live",
                      "test"
                    ]
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 50
                  },
                  "brandIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "name",
                  "mode",
                  "scopes"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IssuedApiKey"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "developer",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/api-keys/{id}": {
      "patch": {
        "operationId": "updateApiKey",
        "summary": "Update an API key's name, scopes, brands or expiry",
        "description": "A revoked, replaced or expired key cannot change: 409 Conflict with details.reason.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 50
                  },
                  "brandIds": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "minItems": 1,
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "expiresAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiKey"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "developer",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      },
      "delete": {
        "operationId": "revokeApiKey",
        "summary": "Revoke an API key",
        "description": "The key stops working at once, and so do the connect links it created.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "developer",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/api-keys/{id}/rotate": {
      "post": {
        "operationId": "rotateApiKey",
        "summary": "Rotate an API key",
        "description": "Issues a new key with the same scopes and brands and returns its secret once. The old key keeps working for overlapHours (default 24, at most 168); when the overlap ends it stops, together with the connect links it created.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ConcurrencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "overlapHours": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 168,
                    "default": 24
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IssuedApiKey"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "developer",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/api-keys/scopes": {
      "get": {
        "operationId": "listApiKeyScopes",
        "summary": "List the scopes a key can hold",
        "description": "Grouped by module. A scope of a planned module, or of a module the plan does not include, is listed with available false.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ScopeListing"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "developer",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/brands": {
      "get": {
        "operationId": "listBrands",
        "summary": "List brands",
        "description": "Brands group accounts, posts, queues and media; filter by your own externalRef. A brand-restricted key sees only its brands.",
        "tags": [
          "Brands"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "externalRef",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Brand"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "createBrand",
        "summary": "Create a brand",
        "description": "A brand-restricted key cannot create brands (403 Forbidden).",
        "tags": [
          "Brands"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "externalRef": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "branding": {
                    "type": "object",
                    "properties": {
                      "displayName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "logoUrl": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 2048
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "accentColor": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^#[0-9a-fA-F]{6}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Brand"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/brands/{id}": {
      "get": {
        "operationId": "getBrand",
        "summary": "Get a brand",
        "tags": [
          "Brands"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Brand"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "patch": {
        "operationId": "updateBrand",
        "summary": "Update a brand",
        "tags": [
          "Brands"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "externalRef": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "branding": {
                    "type": "object",
                    "properties": {
                      "displayName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "logoUrl": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 2048
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "accentColor": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^#[0-9a-fA-F]{6}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Brand"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "delete": {
        "operationId": "deleteBrand",
        "summary": "Delete a brand",
        "description": "Refused with 409 Conflict (details.reason default_brand, has_accounts or has_scheduled_posts) while the brand is the default, still holds accounts or has scheduled posts.",
        "tags": [
          "Brands"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/connect-links": {
      "post": {
        "operationId": "createConnectLink",
        "summary": "Create a hosted connect link",
        "description": "A link your customer opens to connect (or, with purpose reconnect and accountId, reconnect) their own accounts into one brand, without a Dashboard login. Send redirectUri (and state) to end on your page with status, accountIds, brandId, state and error; without one the link ends on the connect host's result page (/done?connect=<result>&platform=<platform>, with connected and skipped counts on success). A reconnect link signed in with a different account ends with account_mismatch and stays usable. A link stops working when it expires, is revoked, or its creator loses the connect right: a member removed or demoted, or a key revoked, expired or past its rotation overlap. The url carries the link token once; there is no list endpoint, so keep the id to revoke it.",
        "tags": [
          "Connect links"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ConcurrencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "minItems": 1,
                    "maxItems": 10
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "connect",
                      "reconnect"
                    ]
                  },
                  "accountId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "redirectUri": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "state": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "expiresInDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "default": 7
                  }
                },
                "required": [
                  "brandId",
                  "platforms",
                  "purpose"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ConnectLinkIssued"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/CapabilityUnavailableOrIdempotencyKeyReusedOrUnsupportedPlatformOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/connect-links/{id}": {
      "delete": {
        "operationId": "revokeConnectLink",
        "summary": "Revoke a connect link",
        "description": "A sign-in already in flight on the link ends with invalid_state.",
        "tags": [
          "Connect links"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:manage",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/connect-sessions/{id}": {
      "get": {
        "operationId": "getConnectSession",
        "summary": "Get the outcome of a connect",
        "description": "The connectSessionId from POST /accounts/connect. status is pending until the platform sign-in returns, then completed (accountId set) or failed (error is the connect result code).",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ConnectSession"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "accounts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/event-types": {
      "get": {
        "operationId": "listEventTypes",
        "summary": "List the event types",
        "description": "Every public event type with its module, description and the module's stage; subscribe a webhook endpoint to a type, a prefix ending in .* or *.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicEventType"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "List public events",
        "description": "Newest first, in the credential's mode and brands. type takes an event type, a prefix ending in .* or *. Each event's data has the payload shape of its type in the event catalog.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^(\\*|[a-z_]+(\\.[a-z_]+)*(\\.\\*)?)$"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicEvent"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:read",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/events/{id}": {
      "get": {
        "operationId": "getEvent",
        "summary": "Get a public event",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PublicEvent"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:read",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/interest": {
      "get": {
        "operationId": "listInterest",
        "summary": "List the planned platforms and modules you voted for",
        "description": "Your votes in this workspace, as interest keys (platform:<type> or module:<id>).",
        "tags": [
          "Feedback"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterestKeys"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "view",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "recordInterest",
        "summary": "Vote for a planned platform or module",
        "description": "key is the interestKey of a planned platform from GET /platforms, or module:<id> of a planned module. A repeat vote answers 200 with recorded false. A key that is not planned is 422 with details.reason.",
        "tags": [
          "Feedback"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "maxLength": 50
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A repeat vote: nothing changed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterestRecord"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Created. A new vote",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterestRecord"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "view",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": true
      }
    },
    "/invites": {
      "get": {
        "operationId": "listInvites",
        "summary": "List pending invites",
        "tags": [
          "Invites"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Invite"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "manageWorkspace",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "createInvite",
        "summary": "Invite someone by email",
        "description": "Sends the invite email; the invite expires after 7 days.",
        "tags": [
          "Invites"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 200
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "developer",
                      "editor",
                      "viewer"
                    ]
                  }
                },
                "required": [
                  "email",
                  "role"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invite"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "manageWorkspace",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": true
      }
    },
    "/invites/{id}": {
      "delete": {
        "operationId": "revokeInvite",
        "summary": "Revoke a pending invite",
        "tags": [
          "Invites"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "manageWorkspace",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/invites/accept": {
      "post": {
        "operationId": "acceptInvite",
        "summary": "Accept a workspace invite",
        "description": "The signed-in user's verified email must match the invite.",
        "tags": [
          "Invites"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "token"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkspaceMembership"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJson"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrInviteEmailMismatchOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/InviteInvalid"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        },
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/media": {
      "get": {
        "operationId": "listMedia",
        "summary": "List media files",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Media"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "uploadMedia",
        "summary": "Upload a media file in the request body",
        "description": "The raw file is the body, with its Content-Type. Videos up to 50 MB; for bigger videos (up to 300 MB) use POST /media/uploads. A key with several brands must pass brandId.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Filename",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The file name to keep with the media"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "video/mp4": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "video/quicktime": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Media"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PlanLimitReached"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/MediaTooLargeOrPayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrMediaRejectedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "media:write",
        "x-relayport-action": "compose",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/media/{id}": {
      "get": {
        "operationId": "getMedia",
        "summary": "Get a media file",
        "description": "previewUrl is a signed link valid for 60 minutes, issued only for ready media (null otherwise).",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Media"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "patch": {
        "operationId": "updateMedia",
        "summary": "Update a media file's alt text or file name",
        "description": "Alt text applies to images only, up to the longest alt text a connected platform accepts.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "altText": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Media"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "media:write",
        "x-relayport-action": "compose",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "delete": {
        "operationId": "deleteMedia",
        "summary": "Delete a media file",
        "description": "Refused with 409 MediaInUse while a post uses it.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaDeleted"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrMediaInUse"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "media:write",
        "x-relayport-action": "compose",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/media/{id}/complete": {
      "post": {
        "operationId": "completeMediaUpload",
        "summary": "Finish a presigned upload",
        "description": "Checks the uploaded object and settles the media ready or failed. 409 Conflict with details.reason upload_missing when nothing was uploaded. Calling it again returns the settled media.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Media"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PlanLimitReached"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "media:write",
        "x-relayport-action": "compose",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/media/imports": {
      "post": {
        "operationId": "importMedia",
        "summary": "Import a media file from a public HTTPS URL",
        "description": "Answers at once with a media in status processing; it becomes ready or failed (media.ready or media.failed event). Redirects are not followed, private and loopback hosts are refused, and the fetch stops after 60 seconds.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "brandId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "url"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Media"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "media:write",
        "x-relayport-action": "compose",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/media/storage": {
      "get": {
        "operationId": "getMediaStorage",
        "summary": "Get the storage meter",
        "description": "Bytes used by ready media against the plan's storage limit (null means no limit).",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaStorage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/media/uploads": {
      "post": {
        "operationId": "createMediaUpload",
        "summary": "Get a presigned upload URL",
        "description": "Returns a media id and a URL to PUT the file to directly, with the given Content-Type and exactly the declared bytes, before expiresAt (15 minutes). Then call POST /media/{id}/complete. Videos up to 300 MB.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "contentType": {
                    "type": "string",
                    "enum": [
                      "image/jpeg",
                      "video/mp4",
                      "video/quicktime"
                    ]
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "brandId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "filename",
                  "contentType",
                  "bytes"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaUploadTicket"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrMediaRejectedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "media:write",
        "x-relayport-action": "compose",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/members": {
      "get": {
        "operationId": "listMembers",
        "summary": "List workspace members",
        "description": "email and name are null for a member whose account was deleted.",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Member"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "manageWorkspace",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/members/{userId}": {
      "patch": {
        "operationId": "changeMemberRole",
        "summary": "Change a member's role",
        "description": "Only a higher role may change a member, and the last owner cannot be demoted.",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "admin",
                      "developer",
                      "editor",
                      "viewer"
                    ]
                  }
                },
                "required": [
                  "role"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Member"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "manageWorkspace",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      },
      "delete": {
        "operationId": "removeMember",
        "summary": "Remove a member, or leave the workspace",
        "description": "Any member may remove themselves; removing someone else needs the manageWorkspace role. The last owner cannot leave.",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "view",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/modules": {
      "get": {
        "operationId": "listModules",
        "summary": "List the product modules and whether they are on",
        "description": "A module is on when its stage is ga (or beta) and the workspace's plan includes it; a key's scopes of a module that is off answer 403 ModuleNotAvailable.",
        "tags": [
          "Workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ModuleState"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/plans": {
      "get": {
        "operationId": "listPlans",
        "summary": "List the plans and their prices",
        "description": "Each plan's features, limits and prices per billing interval in USD cents, with the extra-account bands. No credentials needed.",
        "tags": [
          "Billing"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicPlan"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        },
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/platforms": {
      "get": {
        "operationId": "listPlatforms",
        "summary": "List the platforms",
        "description": "Live platforms with their publishing rules and capabilities, and planned platforms (availability planned, with the release they are planned for and the interest key to vote with). No credentials needed.",
        "tags": [
          "Platforms"
        ],
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Platform"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        },
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/platforms/{platform}": {
      "get": {
        "operationId": "getPlatform",
        "summary": "Get a platform",
        "tags": [
          "Platforms"
        ],
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Platform"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/posts": {
      "get": {
        "operationId": "listPosts",
        "summary": "List posts",
        "description": "Newest first. Filter by status, brandId, accountId, platform, source and a created time range.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "scheduled",
                "publishing",
                "published",
                "partial",
                "failed",
                "unconfirmed",
                "cancelled"
              ]
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "dashboard",
                "api"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Post"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "createPost",
        "summary": "Create a post",
        "description": "One post with 1 to 20 targets, one per connected account, all in one brand. mode is explicit: draft (saved, not scheduled), schedule (scheduledAt, or a scheduledAt on every target), publish_now (answers 202; the key also needs posts:publish) or queue (queueId, a queue id or default; the chosen slot comes back in scheduledAt). Post-level platformData is keyed by platform and carries each platform's contentType and options; a target's platformData is flat and wins. An identical post to the same account within 24 hours is 409 DuplicateContent unless allowDuplicate is true. A blocked workspace (unpaid) cannot create posts, drafts included.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "schedule",
                      "publish_now",
                      "queue"
                    ]
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "queueId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "default"
                      },
                      {
                        "type": "string",
                        "format": "uuid"
                      }
                    ]
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000,
                    "default": ""
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "media": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "mediaId": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "mediaId"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 50,
                    "default": []
                  },
                  "platformData": {
                    "type": "object",
                    "properties": {
                      "instagram": {
                        "type": "object",
                        "properties": {
                          "contentType": {
                            "type": "string",
                            "enum": [
                              "image",
                              "carousel",
                              "reel"
                            ]
                          },
                          "collaborators": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9._]{1,30}$"
                            },
                            "minItems": 1,
                            "maxItems": 3
                          },
                          "aiGenerated": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "contentType"
                        ],
                        "additionalProperties": false
                      },
                      "sandbox": {
                        "type": "object",
                        "properties": {
                          "contentType": {
                            "type": "string",
                            "enum": [
                              "image",
                              "carousel"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "published",
                              "failed",
                              "unconfirmed"
                            ]
                          },
                          "failureCode": {
                            "type": "string",
                            "pattern": "^[a-z_]{3,40}$"
                          }
                        },
                        "required": [
                          "contentType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false,
                    "description": "Keyed by platform: each platform's contentType and options",
                    "default": {}
                  },
                  "firstComment": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "targets": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "accountId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "scheduledAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "media": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mediaId": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "required": [
                              "mediaId"
                            ],
                            "additionalProperties": false
                          },
                          "maxItems": 50
                        },
                        "firstComment": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "platformData": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "contentType": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "carousel",
                                    "reel"
                                  ]
                                },
                                "collaborators": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z0-9._]{1,30}$"
                                  },
                                  "minItems": 1,
                                  "maxItems": 3
                                },
                                "aiGenerated": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "contentType": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "carousel"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "published",
                                    "failed",
                                    "unconfirmed"
                                  ]
                                },
                                "failureCode": {
                                  "type": "string",
                                  "pattern": "^[a-z_]{3,40}$"
                                }
                              },
                              "additionalProperties": false
                            }
                          ],
                          "description": "Flat: the options of the target's own platform, and its contentType when it differs from the post's"
                        }
                      },
                      "required": [
                        "accountId"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 20
                  },
                  "stagger": {
                    "type": "object",
                    "properties": {
                      "minSeconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      },
                      "maxSeconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      }
                    },
                    "required": [
                      "minSeconds",
                      "maxSeconds"
                    ],
                    "additionalProperties": false
                  },
                  "allowDuplicate": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": {
                      "type": [
                        "string",
                        "number",
                        "boolean",
                        "null"
                      ]
                    },
                    "propertyNames": {
                      "minLength": 1,
                      "maxLength": 64
                    }
                  }
                },
                "required": [
                  "mode",
                  "targets"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. draft, schedule and queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted. publish_now: the targets start publishing; follow them with GET /posts/{id} or the post.* events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredOrPlanLimitReached"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrDuplicateContentOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrPostValidationFailedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:write",
        "x-relayport-action": "publish",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/posts/{id}": {
      "get": {
        "operationId": "getPost",
        "summary": "Get a post with the state of every target",
        "description": "Each target carries its status (draft, scheduled, publishing, published, failed, unconfirmed or cancelled), the platform post id and permalink once published, and the error with the action to take when it failed.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "patch": {
        "operationId": "updatePost",
        "summary": "Update a draft or scheduled post",
        "description": "A draft can be promoted by setting mode schedule or queue. A post whose targets already started publishing is 409 PostStateConflict; an edit never re-sends a target that may have been sent.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "schedule",
                      "queue"
                    ]
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "queueId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "default"
                      },
                      {
                        "type": "string",
                        "format": "uuid"
                      }
                    ]
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "title": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "media": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "mediaId": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "mediaId"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 50
                  },
                  "platformData": {
                    "type": "object",
                    "properties": {
                      "instagram": {
                        "type": "object",
                        "properties": {
                          "contentType": {
                            "type": "string",
                            "enum": [
                              "image",
                              "carousel",
                              "reel"
                            ]
                          },
                          "collaborators": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9._]{1,30}$"
                            },
                            "minItems": 1,
                            "maxItems": 3
                          },
                          "aiGenerated": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "contentType"
                        ],
                        "additionalProperties": false
                      },
                      "sandbox": {
                        "type": "object",
                        "properties": {
                          "contentType": {
                            "type": "string",
                            "enum": [
                              "image",
                              "carousel"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "published",
                              "failed",
                              "unconfirmed"
                            ]
                          },
                          "failureCode": {
                            "type": "string",
                            "pattern": "^[a-z_]{3,40}$"
                          }
                        },
                        "required": [
                          "contentType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false,
                    "description": "Keyed by platform: each platform's contentType and options"
                  },
                  "firstComment": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 20000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "targets": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "accountId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "scheduledAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "media": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mediaId": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "required": [
                              "mediaId"
                            ],
                            "additionalProperties": false
                          },
                          "maxItems": 50
                        },
                        "firstComment": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "platformData": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "contentType": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "carousel",
                                    "reel"
                                  ]
                                },
                                "collaborators": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z0-9._]{1,30}$"
                                  },
                                  "minItems": 1,
                                  "maxItems": 3
                                },
                                "aiGenerated": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "contentType": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "carousel"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "published",
                                    "failed",
                                    "unconfirmed"
                                  ]
                                },
                                "failureCode": {
                                  "type": "string",
                                  "pattern": "^[a-z_]{3,40}$"
                                }
                              },
                              "additionalProperties": false
                            }
                          ],
                          "description": "Flat: the options of the target's own platform, and its contentType when it differs from the post's"
                        }
                      },
                      "required": [
                        "accountId"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 20
                  },
                  "stagger": {
                    "type": "object",
                    "properties": {
                      "minSeconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      },
                      "maxSeconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      }
                    },
                    "required": [
                      "minSeconds",
                      "maxSeconds"
                    ],
                    "additionalProperties": false
                  },
                  "allowDuplicate": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": {
                      "type": [
                        "string",
                        "number",
                        "boolean",
                        "null"
                      ]
                    },
                    "propertyNames": {
                      "minLength": 1,
                      "maxLength": 64
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredOrPlanLimitReached"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrDuplicateContentOrPostStateConflict"
          },
          "422": {
            "$ref": "#/components/responses/PostValidationFailedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:write",
        "x-relayport-action": "compose",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "delete": {
        "operationId": "cancelPost",
        "summary": "Cancel a draft or scheduled post",
        "description": "Allowed until a target starts publishing; the post stays readable with status cancelled.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/PostStateConflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:write",
        "x-relayport-action": "publish",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/posts/{id}/events": {
      "get": {
        "operationId": "listPostEvents",
        "summary": "List a post's publishing timeline",
        "description": "Every step each target went through (prepare, send, reconcile ...), oldest first.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PostEvent"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/posts/{id}/publish": {
      "post": {
        "operationId": "publishPost",
        "summary": "Publish a draft or scheduled post now",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "allowDuplicate": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredOrPlanLimitReached"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrDuplicateContentOrIdempotencyInProgressOrPostStateConflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrPostValidationFailedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:publish",
        "x-relayport-action": "publish",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/posts/{id}/retry": {
      "post": {
        "operationId": "retryPost",
        "summary": "Retry the failed targets of a post",
        "description": "Re-arms failed targets. An unconfirmed target may already be live on the platform, so it is retried only with includeUnconfirmed: true; check the account first.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "includeUnconfirmed": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgressOrPostStateConflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:publish",
        "x-relayport-action": "publish",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/posts/{id}/targets/{targetId}/resolve": {
      "post": {
        "operationId": "resolvePostTarget",
        "summary": "Settle an unconfirmed target by hand",
        "description": "After checking the account on the platform, mark an unconfirmed target published (with its permalink when known) or failed.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "outcome": {
                        "type": "string",
                        "const": "published"
                      },
                      "permalink": {
                        "type": "string",
                        "maxLength": 500,
                        "format": "uri"
                      }
                    },
                    "required": [
                      "outcome"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "outcome": {
                        "type": "string",
                        "const": "failed"
                      }
                    },
                    "required": [
                      "outcome"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgressOrPostStateConflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:publish",
        "x-relayport-action": "publish",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/posts/{id}/unpublish": {
      "post": {
        "operationId": "unpublishPost",
        "summary": "Delete a published post from its platforms",
        "description": "No platform offers deletion yet, so this answers 501 NotSupported with details { capability: publishing.delete, targets: [{ targetId, accountId, platform, state, requiredVariant? }] } naming why each published target cannot be deleted. A post with no published target (a scheduled sandbox post included) is 409 PostStateConflict.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. Not answered while no platform supports deletion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgressOrPostStateConflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "501": {
            "$ref": "#/components/responses/NotSupported"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:publish",
        "x-relayport-action": "publish",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/posts/validate": {
      "post": {
        "operationId": "validatePost",
        "summary": "Check a post against its platforms' rules without saving it",
        "description": "Takes the same body as POST /posts and answers the issues (errors) and warnings each target would get. Nothing is created.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "schedule",
                      "publish_now",
                      "queue"
                    ]
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "queueId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "default"
                      },
                      {
                        "type": "string",
                        "format": "uuid"
                      }
                    ]
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000,
                    "default": ""
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "media": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "mediaId": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "mediaId"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 50,
                    "default": []
                  },
                  "platformData": {
                    "type": "object",
                    "properties": {
                      "instagram": {
                        "type": "object",
                        "properties": {
                          "contentType": {
                            "type": "string",
                            "enum": [
                              "image",
                              "carousel",
                              "reel"
                            ]
                          },
                          "collaborators": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9._]{1,30}$"
                            },
                            "minItems": 1,
                            "maxItems": 3
                          },
                          "aiGenerated": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "contentType"
                        ],
                        "additionalProperties": false
                      },
                      "sandbox": {
                        "type": "object",
                        "properties": {
                          "contentType": {
                            "type": "string",
                            "enum": [
                              "image",
                              "carousel"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "published",
                              "failed",
                              "unconfirmed"
                            ]
                          },
                          "failureCode": {
                            "type": "string",
                            "pattern": "^[a-z_]{3,40}$"
                          }
                        },
                        "required": [
                          "contentType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false,
                    "description": "Keyed by platform: each platform's contentType and options",
                    "default": {}
                  },
                  "firstComment": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "targets": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "accountId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "scheduledAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "media": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mediaId": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "required": [
                              "mediaId"
                            ],
                            "additionalProperties": false
                          },
                          "maxItems": 50
                        },
                        "firstComment": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "platformData": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "contentType": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "carousel",
                                    "reel"
                                  ]
                                },
                                "collaborators": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[A-Za-z0-9._]{1,30}$"
                                  },
                                  "minItems": 1,
                                  "maxItems": 3
                                },
                                "aiGenerated": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "contentType": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "carousel"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "published",
                                    "failed",
                                    "unconfirmed"
                                  ]
                                },
                                "failureCode": {
                                  "type": "string",
                                  "pattern": "^[a-z_]{3,40}$"
                                }
                              },
                              "additionalProperties": false
                            }
                          ],
                          "description": "Flat: the options of the target's own platform, and its contentType when it differs from the post's"
                        }
                      },
                      "required": [
                        "accountId"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 20
                  },
                  "stagger": {
                    "type": "object",
                    "properties": {
                      "minSeconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      },
                      "maxSeconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      }
                    },
                    "required": [
                      "minSeconds",
                      "maxSeconds"
                    ],
                    "additionalProperties": false
                  },
                  "allowDuplicate": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": {
                      "type": [
                        "string",
                        "number",
                        "boolean",
                        "null"
                      ]
                    },
                    "propertyNames": {
                      "minLength": 1,
                      "maxLength": 64
                    }
                  }
                },
                "required": [
                  "mode",
                  "targets"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PostCheck"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:write",
        "x-relayport-action": "compose",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/queues": {
      "get": {
        "operationId": "listQueues",
        "summary": "List queues",
        "description": "A queue is a weekly list of posting times in one time zone; mode queue on POST /posts takes its earliest free slot.",
        "tags": [
          "Queues"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Queue"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "createQueue",
        "summary": "Create a queue",
        "tags": [
          "Queues"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "day": {
                          "type": "string",
                          "enum": [
                            "mon",
                            "tue",
                            "wed",
                            "thu",
                            "fri",
                            "sat",
                            "sun"
                          ]
                        },
                        "time": {
                          "type": "string",
                          "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                        }
                      },
                      "required": [
                        "day",
                        "time"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 70
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "slots"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Queue"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:write",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/queues/{id}": {
      "get": {
        "operationId": "getQueue",
        "summary": "Get a queue",
        "tags": [
          "Queues"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Queue"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "patch": {
        "operationId": "updateQueue",
        "summary": "Update a queue",
        "description": "Set active false to pause it: queued posts keep their times and new posts cannot take its slots.",
        "tags": [
          "Queues"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "day": {
                          "type": "string",
                          "enum": [
                            "mon",
                            "tue",
                            "wed",
                            "thu",
                            "fri",
                            "sat",
                            "sun"
                          ]
                        },
                        "time": {
                          "type": "string",
                          "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                        }
                      },
                      "required": [
                        "day",
                        "time"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 70
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Queue"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:write",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "delete": {
        "operationId": "deleteQueue",
        "summary": "Delete a queue",
        "description": "Refused with 409 Conflict while posts of the caller's mode are scheduled in it.",
        "tags": [
          "Queues"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:write",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/queues/{id}/preview": {
      "get": {
        "operationId": "previewQueue",
        "summary": "Forecast the next free slots",
        "description": "A forecast, not a reservation: another post may take a slot first.",
        "tags": [
          "Queues"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QueuePreview"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/queues/{id}/reshuffle": {
      "post": {
        "operationId": "reshuffleQueue",
        "summary": "Move the queue's scheduled posts onto its current slots",
        "description": "After editing the slots, moves the posts already queued (in the caller's brands and mode) onto the earliest free slots, in order; posts that started publishing stay where they are.",
        "tags": [
          "Queues"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QueueReshuffle"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "posts:write",
        "x-relayport-action": "connect",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/request-logs": {
      "get": {
        "operationId": "listRequestLogs",
        "summary": "List the workspace's recent API requests",
        "description": "Newest first, kept for the plan's log retention. livemode tells live-key requests from test-key requests; session requests from the Dashboard are logged as live. Filter by status (404 or 4xx), method, keyId, path and a time range.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-5](?:\\d{2}|xx)$"
            }
          },
          {
            "name": "method",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "GET",
                "HEAD",
                "POST",
                "PUT",
                "PATCH",
                "DELETE"
              ]
            }
          },
          {
            "name": "keyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\/"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RequestLog"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-action": "developer",
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Get the workspace's meters for the current billing period",
        "description": "Each meter of the response against the plan's limit (null means no limit; posts count one per target), and the billing block state.",
        "tags": [
          "Usage"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "usage:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/usage/daily": {
      "get": {
        "operationId": "listUsageDaily",
        "summary": "Count posts per UTC day",
        "description": "Targets created, published and failed per day from from to to (default the last 30 days, at most 90).",
        "tags": [
          "Usage"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UsageDay"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "usage:read",
        "x-relayport-action": "view",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/webhook-endpoints": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "summary": "List webhook endpoints",
        "description": "Endpoints in the credential's mode and brands, each with its status and newest delivery.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:read",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "createWebhookEndpoint",
        "summary": "Create a webhook endpoint",
        "description": "A public HTTPS URL and the events it receives: event types, prefixes ending in .* or *. The response carries the signing secret (whsec_...) once. An API key creates endpoints in its own mode; a brand-restricted key must limit the endpoint to its brands. At most 20 endpoints per workspace (409 Conflict with details.reason endpoint_limit).",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ConcurrencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "minItems": 1,
                    "maxItems": 50
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "brandIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 100
                  },
                  "accountIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 100
                  },
                  "livemode": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IssuedWebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:write",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/webhook-endpoints/{id}": {
      "get": {
        "operationId": "getWebhookEndpoint",
        "summary": "Get a webhook endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:read",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "summary": "Update a webhook endpoint",
        "description": "Set status disabled to pause deliveries, or active to resume them. An endpoint that fails for 3 days is failing, and after 7 days it is disabled.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "minItems": 1,
                    "maxItems": 50
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "brandIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 100
                  },
                  "accountIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 100
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "disabled"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:write",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      },
      "delete": {
        "operationId": "deleteWebhookEndpoint",
        "summary": "Delete a webhook endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:write",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/webhook-endpoints/{id}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List an endpoint's delivery attempts",
        "description": "Newest first, with the response status, a response excerpt and the next retry time. A failed attempt is retried 10 times with backoff.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "sending",
                "success",
                "failed",
                "skipped"
              ]
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/WorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:read",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/webhook-endpoints/{id}/deliveries/{deliveryId}/retry": {
      "post": {
        "operationId": "retryWebhookDelivery",
        "summary": "Send a delivery's event again",
        "description": "Queues a new attempt of the delivery's event to the endpoint. 409 Conflict while the endpoint is disabled (details.reason endpoint_disabled) or the event is being delivered right now (delivery_sending).",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:write",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/webhook-endpoints/{id}/rotate-secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate a webhook endpoint's signing secret",
        "description": "Returns the new secret once. For overlapHours (default 24, at most 168) each delivery is signed with both secrets, so the webhook-signature header carries two signatures.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ConcurrencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "overlapHours": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 168,
                    "default": 24
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IssuedWebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrIdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:write",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": false
      }
    },
    "/webhook-endpoints/{id}/test": {
      "post": {
        "operationId": "testWebhookEndpoint",
        "summary": "Send a webhook.test event to an endpoint",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJsonOrWorkspaceRequired"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyInProgress"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/IdempotencyKeyReusedOrValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-scope": "webhooks:write",
        "x-relayport-action": "developer",
        "x-relayport-session-only": false,
        "x-relayport-idempotent": true
      }
    },
    "/workspaces": {
      "get": {
        "operationId": "listWorkspaces",
        "summary": "List the workspaces you belong to",
        "description": "Send X-Workspace-Id with one of these ids on every workspace call made with a session.",
        "tags": [
          "Workspaces"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WorkspaceMembership"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        },
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      },
      "post": {
        "operationId": "createWorkspace",
        "summary": "Create a workspace",
        "description": "You become its owner. It starts on the Free plan with a default brand.",
        "tags": [
          "Workspaces"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Workspace"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJson"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/RateLimiterUnavailable"
          }
        },
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    },
    "/workspaces/{id}": {
      "get": {
        "operationId": "getWorkspace",
        "summary": "Get a workspace",
        "tags": [
          "Workspaces"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Workspace"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        },
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      },
      "patch": {
        "operationId": "updateWorkspace",
        "summary": "Update a workspace",
        "description": "Name, time zone and settings. Needs the manageWorkspace role.",
        "tags": [
          "Workspaces"
        ],
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersion"
          },
          {
            "$ref": "#/components/parameters/RequestedWith"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "settings": {
                    "type": "object",
                    "properties": {
                      "duplicateGuard": {
                        "type": "boolean"
                      },
                      "defaultQueueId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Workspace"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidJson"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKeyOrUnauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CsrfRejectedOrForbiddenOrWorkspaceSuspended"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        },
        "x-relayport-session-only": true,
        "x-relayport-idempotent": false
      }
    }
  },
  "webhooks": {
    "account.action_required": {
      "post": {
        "summary": "A social account needs an action on the platform before it can publish.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account.action_required"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/AccountData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "account.connected": {
      "post": {
        "summary": "A social account was connected or reconnected.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account.connected"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/AccountData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "account.disconnected": {
      "post": {
        "summary": "A social account was disconnected.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account.disconnected"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/AccountData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "account.reconnect_required": {
      "post": {
        "summary": "A social account must be reconnected before it can publish.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account.reconnect_required"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/AccountData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "billing.blocked": {
      "post": {
        "summary": "The grace ended and new posts and connections are paused.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "billing.blocked"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "hostedInvoiceUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "hostedInvoiceUrl"
                    ]
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "billing.past_due": {
      "post": {
        "summary": "A payment failed and the 7-day grace started.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "billing.past_due"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "graceUntil": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "hostedInvoiceUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "attemptCount": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "graceUntil",
                      "hostedInvoiceUrl",
                      "attemptCount"
                    ]
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "billing.recovered": {
      "post": {
        "summary": "The open invoice was paid and service resumed.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "billing.recovered"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {}
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "media.failed": {
      "post": {
        "summary": "An uploaded media file failed its checks.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "media.failed"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "mediaId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "kind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "image",
                              "video"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "status": {
                        "type": "string",
                        "const": "failed"
                      },
                      "error": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "issues": {
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/MediaIssue"
                            }
                          }
                        },
                        "required": [
                          "code",
                          "message",
                          "issues"
                        ]
                      }
                    },
                    "required": [
                      "mediaId",
                      "kind",
                      "status",
                      "error"
                    ]
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "media.ready": {
      "post": {
        "summary": "An uploaded media file passed its checks and can be attached to posts.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "media.ready"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "mediaId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "image",
                          "video"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "const": "ready"
                      }
                    },
                    "required": [
                      "mediaId",
                      "kind",
                      "status"
                    ]
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.cancelled": {
      "post": {
        "summary": "A scheduled post was cancelled before any target started publishing.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.cancelled"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/PostData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.failed": {
      "post": {
        "summary": "Every target of a post failed.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.failed"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/PostData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.partial": {
      "post": {
        "summary": "A post settled with some targets published and others not.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.partial"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/PostData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.published": {
      "post": {
        "summary": "Every target of a post was published.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.published"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/PostData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.scheduled": {
      "post": {
        "summary": "A post was scheduled for later.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.scheduled"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/PostData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.target.failed": {
      "post": {
        "summary": "One target of a post failed and nothing was published to it.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.target.failed"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/TargetData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.target.published": {
      "post": {
        "summary": "One target of a post was published.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.target.published"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/TargetData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.target.publishing": {
      "post": {
        "summary": "Publishing started for one target of a post.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.target.publishing"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/TargetData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.target.resolved": {
      "post": {
        "summary": "An unconfirmed target was marked published or not published.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.target.resolved"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/TargetData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.target.unconfirmed": {
      "post": {
        "summary": "The platform did not confirm one target. It was not sent again; check the account before retrying.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.target.unconfirmed"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/TargetData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "post.updated": {
      "post": {
        "summary": "A scheduled post was edited.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "post.updated"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "$ref": "#/components/schemas/PostData"
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "usage.threshold": {
      "post": {
        "summary": "A usage meter reached 80% or 100% of its plan limit",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "usage.threshold"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "meter": {
                        "type": "string",
                        "enum": [
                          "accounts",
                          "posts",
                          "storage"
                        ]
                      },
                      "threshold": {
                        "type": "number",
                        "enum": [
                          80,
                          100
                        ]
                      },
                      "used": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "period": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "planKey": {
                        "type": "string",
                        "enum": [
                          "free",
                          "pro",
                          "business",
                          "enterprise"
                        ]
                      },
                      "upgradeUrl": {
                        "type": "string"
                      },
                      "livemode": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "meter",
                      "threshold",
                      "used",
                      "limit",
                      "period",
                      "planKey",
                      "upgradeUrl",
                      "livemode"
                    ]
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    },
    "webhook.test": {
      "post": {
        "summary": "A test event sent to one webhook endpoint.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "webhook.test"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "endpointId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "endpointId",
                      "message"
                    ]
                  }
                },
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within 10 seconds, is retried with backoff."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key: rp_live_... for live data or rp_test_... for test data. Any other bearer is 401 Unauthenticated."
      },
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "relayport_at",
        "description": "A signed-in Dashboard session (the relayport_at cookie). Session-only operations take only this; writes also need X-Requested-With."
      }
    },
    "parameters": {
      "ApiVersion": {
        "name": "X-Api-Version",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "2026-12-01"
          ]
        },
        "description": "The API version. API keys answer in the version they were created with unless this header asks for another; the current version is 2026-12-01."
      },
      "WorkspaceId": {
        "name": "X-Workspace-Id",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "description": "The workspace of the request. Required with a session; with an API key it may be left out and must match the key's workspace when sent."
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "description": "Repeating a request with the same key within 24 hours returns the first response (header Idempotent-Replayed: true) instead of running it again."
      },
      "ConcurrencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "description": "Only blocks a second request with the same key while the first runs (409 IdempotencyInProgress). The response carries a secret, so it is never stored or replayed: a retry with the same key runs again and issues a new secret."
      },
      "RequestedWith": {
        "name": "X-Requested-With",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "XMLHttpRequest"
          ]
        },
        "description": "Required on every write made with a signed-in session; without it the request is 403 CsrfRejected. API keys do not send it."
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 25
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "responses": {
      "AccountDisconnectedOrIdempotencyInProgress": {
        "description": "AccountDisconnected: The account is disconnected; connect it again first. IdempotencyInProgress: A request with this Idempotency-Key is still running.",
        "x-relayport-errors": [
          "AccountDisconnected",
          "IdempotencyInProgress"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CapabilityUnavailableOrIdempotencyKeyReusedOrUnsupportedAuthVariantOrUnsupportedPlatformOrValidationError": {
        "description": "CapabilityUnavailable: The platform or account does not offer this capability. IdempotencyKeyReused: The Idempotency-Key was used with different parameters. UnsupportedAuthVariant: The platform does not support this sign-in variant. UnsupportedPlatform: The platform is not supported. ValidationError: The request is malformed or has an unknown or invalid field.",
        "x-relayport-errors": [
          "CapabilityUnavailable",
          "IdempotencyKeyReused",
          "UnsupportedAuthVariant",
          "UnsupportedPlatform",
          "ValidationError"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CapabilityUnavailableOrIdempotencyKeyReusedOrUnsupportedPlatformOrValidationError": {
        "description": "CapabilityUnavailable: The platform or account does not offer this capability. IdempotencyKeyReused: The Idempotency-Key was used with different parameters. UnsupportedPlatform: The platform is not supported. ValidationError: The request is malformed or has an unknown or invalid field.",
        "x-relayport-errors": [
          "CapabilityUnavailable",
          "IdempotencyKeyReused",
          "UnsupportedPlatform",
          "ValidationError"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict: The request conflicts with the current state of the resource.",
        "x-relayport-errors": [
          "Conflict"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ConflictOrDuplicateContentOrIdempotencyInProgress": {
        "description": "Conflict: The request conflicts with the current state of the resource. DuplicateContent: The same content was already published to this account. IdempotencyInProgress: A request with this Idempotency-Key is still running.",
        "x-relayport-errors": [
          "Conflict",
          "DuplicateContent",
          "IdempotencyInProgress"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ConflictOrDuplicateContentOrIdempotencyInProgressOrPostStateConflict": {
        "description": "Conflict: The request conflicts with the current state of the resource. DuplicateContent: The same content was already published to this account. IdempotencyInProgress: A request with this Idempotency-Key is still running. PostStateConflict: The post is in a state that does not allow this action.",
        "x-relayport-errors": [
          "Conflict",
          "DuplicateContent",
          "IdempotencyInProgress",
          "PostStateConflict"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ConflictOrDuplicateContentOrPostStateConflict": {
        "description": "Conflict: The request conflicts with the current state of the resource. DuplicateContent: The same content was already published to this account. PostStateConflict: The post is in a state that does not allow this action.",
        "x-relayport-errors": [
          "Conflict",
          "DuplicateContent",
          "PostStateConflict"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ConflictOrIdempotencyInProgress": {
        "description": "Conflict: The request conflicts with the current state of the resource. IdempotencyInProgress: A request with this Idempotency-Key is still running.",
        "x-relayport-errors": [
          "Conflict",
          "IdempotencyInProgress"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ConflictOrMediaInUse": {
        "description": "Conflict: The request conflicts with the current state of the resource. MediaInUse: The media is attached to a post and cannot be deleted.",
        "x-relayport-errors": [
          "Conflict",
          "MediaInUse"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CsrfRejectedOrForbiddenOrInviteEmailMismatchOrWorkspaceSuspended": {
        "description": "CsrfRejected: A write made with a signed-in session lacked the X-Requested-With header. Forbidden: The credential is not allowed to do this. InviteEmailMismatch: The invite was sent to a different email address. WorkspaceSuspended: The workspace is suspended.",
        "x-relayport-errors": [
          "CsrfRejected",
          "Forbidden",
          "InviteEmailMismatch",
          "WorkspaceSuspended"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CsrfRejectedOrForbiddenOrModuleNotAvailableOrWorkspaceSuspended": {
        "description": "CsrfRejected: A write made with a signed-in session lacked the X-Requested-With header. Forbidden: The credential is not allowed to do this. ModuleNotAvailable: The module is not enabled for this workspace. WorkspaceSuspended: The workspace is suspended.",
        "x-relayport-errors": [
          "CsrfRejected",
          "Forbidden",
          "ModuleNotAvailable",
          "WorkspaceSuspended"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CsrfRejectedOrForbiddenOrWorkspaceSuspended": {
        "description": "CsrfRejected: A write made with a signed-in session lacked the X-Requested-With header. Forbidden: The credential is not allowed to do this. WorkspaceSuspended: The workspace is suspended.",
        "x-relayport-errors": [
          "CsrfRejected",
          "Forbidden",
          "WorkspaceSuspended"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ForbiddenOrModuleNotAvailableOrWorkspaceSuspended": {
        "description": "Forbidden: The credential is not allowed to do this. ModuleNotAvailable: The module is not enabled for this workspace. WorkspaceSuspended: The workspace is suspended.",
        "x-relayport-errors": [
          "Forbidden",
          "ModuleNotAvailable",
          "WorkspaceSuspended"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ForbiddenOrWorkspaceSuspended": {
        "description": "Forbidden: The credential is not allowed to do this. WorkspaceSuspended: The workspace is suspended.",
        "x-relayport-errors": [
          "Forbidden",
          "WorkspaceSuspended"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "IdempotencyInProgress": {
        "description": "IdempotencyInProgress: A request with this Idempotency-Key is still running.",
        "x-relayport-errors": [
          "IdempotencyInProgress"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "IdempotencyInProgressOrPostStateConflict": {
        "description": "IdempotencyInProgress: A request with this Idempotency-Key is still running. PostStateConflict: The post is in a state that does not allow this action.",
        "x-relayport-errors": [
          "IdempotencyInProgress",
          "PostStateConflict"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "IdempotencyInProgressOrWorkspaceDeletionInProgress": {
        "description": "IdempotencyInProgress: A request with this Idempotency-Key is still running. WorkspaceDeletionInProgress: The workspace is being deleted; wait for the deletion to finish.",
        "x-relayport-errors": [
          "IdempotencyInProgress",
          "WorkspaceDeletionInProgress"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "IdempotencyKeyReusedOrMediaRejectedOrValidationError": {
        "description": "IdempotencyKeyReused: The Idempotency-Key was used with different parameters. MediaRejected: The media file failed the platform media rules. ValidationError: The request is malformed or has an unknown or invalid field.",
        "x-relayport-errors": [
          "IdempotencyKeyReused",
          "MediaRejected",
          "ValidationError"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "IdempotencyKeyReusedOrPostValidationFailedOrValidationError": {
        "description": "IdempotencyKeyReused: The Idempotency-Key was used with different parameters. PostValidationFailed: The post does not satisfy the rules of its platform. ValidationError: The request is malformed or has an unknown or invalid field.",
        "x-relayport-errors": [
          "IdempotencyKeyReused",
          "PostValidationFailed",
          "ValidationError"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "IdempotencyKeyReusedOrValidationError": {
        "description": "IdempotencyKeyReused: The Idempotency-Key was used with different parameters. ValidationError: The request is malformed or has an unknown or invalid field.",
        "x-relayport-errors": [
          "IdempotencyKeyReused",
          "ValidationError"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InvalidApiKeyOrUnauthenticated": {
        "description": "InvalidApiKey: The API key is unknown, revoked or malformed. Unauthenticated: The request carries no valid credentials.",
        "x-relayport-errors": [
          "InvalidApiKey",
          "Unauthenticated"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InvalidJson": {
        "description": "InvalidJson: The request body is not valid JSON.",
        "x-relayport-errors": [
          "InvalidJson"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InvalidJsonOrWorkspaceRequired": {
        "description": "InvalidJson: The request body is not valid JSON. WorkspaceRequired: The request needs an X-Workspace-Id header.",
        "x-relayport-errors": [
          "InvalidJson",
          "WorkspaceRequired"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InviteInvalid": {
        "description": "InviteInvalid: The invite is unknown, expired, revoked or already used.",
        "x-relayport-errors": [
          "InviteInvalid"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "MediaTooLargeOrPayloadTooLarge": {
        "description": "MediaTooLarge: The media file exceeds the size limit. PayloadTooLarge: The request body exceeds the size limit.",
        "x-relayport-errors": [
          "MediaTooLarge",
          "PayloadTooLarge"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "NotFound: The resource does not exist or is not visible to this credential.",
        "x-relayport-errors": [
          "NotFound"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotSupported": {
        "description": "NotSupported: The operation is not supported.",
        "x-relayport-errors": [
          "NotSupported"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "PayloadTooLarge: The request body exceeds the size limit.",
        "x-relayport-errors": [
          "PayloadTooLarge"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "PaymentRequired: The workspace is past due and its grace period has ended.",
        "x-relayport-errors": [
          "PaymentRequired"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequiredOrPlanLimitReached": {
        "description": "PaymentRequired: The workspace is past due and its grace period has ended. PlanLimitReached: The workspace reached a limit of its plan.",
        "x-relayport-errors": [
          "PaymentRequired",
          "PlanLimitReached"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PlanLimitReached": {
        "description": "PlanLimitReached: The workspace reached a limit of its plan.",
        "x-relayport-errors": [
          "PlanLimitReached"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PostStateConflict": {
        "description": "PostStateConflict: The post is in a state that does not allow this action.",
        "x-relayport-errors": [
          "PostStateConflict"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PostValidationFailedOrValidationError": {
        "description": "PostValidationFailed: The post does not satisfy the rules of its platform. ValidationError: The request is malformed or has an unknown or invalid field.",
        "x-relayport-errors": [
          "PostValidationFailed",
          "ValidationError"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "RateLimited: Too many requests; wait for Retry-After.",
        "x-relayport-errors": [
          "RateLimited"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimiterUnavailable": {
        "description": "RateLimiterUnavailable: The rate limiter is unavailable; retry shortly.",
        "x-relayport-errors": [
          "RateLimiterUnavailable"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "UnsupportedMediaType: The Content-Type is not a supported media type.",
        "x-relayport-errors": [
          "UnsupportedMediaType"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UpstreamUnavailable": {
        "description": "UpstreamUnavailable: The social platform could not be reached; try again later.",
        "x-relayport-errors": [
          "UpstreamUnavailable"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ValidationError": {
        "description": "ValidationError: The request is malformed or has an unknown or invalid field.",
        "x-relayport-errors": [
          "ValidationError"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "WorkspaceRequired": {
        "description": "WorkspaceRequired: The request needs an X-Workspace-Id header.",
        "x-relayport-errors": [
          "WorkspaceRequired"
        ],
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "AccountCapabilities": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string"
          },
          "authVariant": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "enum": [
                    "publishing.image",
                    "publishing.carousel",
                    "publishing.reel",
                    "publishing.story",
                    "publishing.collaborators",
                    "publishing.alt_text",
                    "publishing.user_tags",
                    "publishing.location",
                    "publishing.trial_reels",
                    "publishing.ai_label",
                    "publishing.first_comment",
                    "publishing.delete",
                    "publishing.resumable_upload",
                    "publishing.partnership_label",
                    "publishing.polls",
                    "publishing.audio",
                    "inbox.comments.read",
                    "inbox.mentions",
                    "inbox.dm.send",
                    "inbox.private_reply",
                    "analytics.post_metrics",
                    "analytics.account_metrics",
                    "analytics.story_insights_webhook",
                    "ads.boost"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "available",
                    "reconnect_required",
                    "requires_variant",
                    "requires_connection",
                    "plan_upgrade",
                    "coming_soon",
                    "unsupported"
                  ]
                },
                "reason": {
                  "type": "string"
                },
                "actionUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "limits": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": {
                        "type": "number"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "key",
                "state",
                "reason",
                "actionUrl",
                "limits"
              ]
            }
          }
        },
        "required": [
          "platform",
          "authVariant",
          "capabilities"
        ]
      },
      "AccountData": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "brandId": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "action_required",
              "reconnect_required",
              "disconnected",
              "frozen"
            ]
          },
          "username": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          }
        },
        "required": [
          "accountId",
          "brandId",
          "platform",
          "status",
          "username",
          "livemode"
        ]
      },
      "AccountLimits": {
        "type": "object",
        "properties": {
          "quotaTotal": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "quotaUsage": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "budgets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lane": {
                  "type": "string",
                  "enum": [
                    "prepare",
                    "publish"
                  ]
                },
                "windowMs": {
                  "type": "integer"
                },
                "max": {
                  "type": "integer"
                },
                "used": {
                  "type": "integer"
                },
                "remaining": {
                  "type": "integer"
                },
                "live": {
                  "type": "boolean"
                }
              },
              "required": [
                "lane",
                "windowMs",
                "max",
                "used",
                "remaining",
                "live"
              ]
            }
          },
          "pressure": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "percent": {
                    "type": "number"
                  },
                  "retryAfterMs": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "percent",
                  "retryAfterMs"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "readAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "quotaTotal",
          "quotaUsage",
          "budgets",
          "pressure",
          "readAt"
        ]
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "brandIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "apiVersion": {
            "type": "string"
          },
          "createdBy": {
            "type": "string",
            "format": "uuid"
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "replacedBy": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "mode",
          "scopes",
          "brandIds",
          "apiVersion",
          "createdBy",
          "lastUsedAt",
          "expiresAt",
          "revokedAt",
          "replacedBy",
          "createdAt"
        ]
      },
      "Brand": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "externalRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "branding": {
            "type": "object",
            "properties": {
              "displayName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "logoUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "accentColor": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "displayName",
              "logoUrl",
              "accentColor"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "accountCount": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "externalRef",
          "branding",
          "isDefault",
          "accountCount",
          "createdAt"
        ]
      },
      "ConnectLinkIssued": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "expiresAt"
        ]
      },
      "ConnectSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "consumed",
              "completed",
              "failed"
            ]
          },
          "platform": {
            "type": "string"
          },
          "brandId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "accountId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "success",
                  "denied",
                  "account_type_unsupported",
                  "missing_scope",
                  "already_connected",
                  "account_mismatch",
                  "invalid_state",
                  "plan_limit",
                  "payment_required",
                  "failed"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "status",
          "platform",
          "brandId",
          "accountId",
          "error",
          "expiresAt"
        ]
      },
      "ConnectStart": {
        "type": "object",
        "properties": {
          "authUrl": {
            "type": "string"
          },
          "connectSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "authUrl",
          "connectSessionId",
          "expiresAt"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": {}
          },
          "requestId": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "InterestKeys": {
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "keys"
        ]
      },
      "InterestRecord": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "recorded": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "recorded"
        ]
      },
      "Invite": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "editor",
              "viewer"
            ]
          },
          "invitedBy": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "invitedBy",
          "expiresAt",
          "createdAt"
        ]
      },
      "Issue": {
        "type": "object",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          },
          "target": {
            "type": "integer"
          },
          "platform": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "rule": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "limit": {
            "type": "number"
          },
          "actual": {
            "type": [
              "number",
              "string"
            ]
          },
          "allowed": {
            "type": "string"
          },
          "capability": {
            "type": "string",
            "enum": [
              "publishing.image",
              "publishing.carousel",
              "publishing.reel",
              "publishing.story",
              "publishing.collaborators",
              "publishing.alt_text",
              "publishing.user_tags",
              "publishing.location",
              "publishing.trial_reels",
              "publishing.ai_label",
              "publishing.first_comment",
              "publishing.delete",
              "publishing.resumable_upload",
              "publishing.partnership_label",
              "publishing.polls",
              "publishing.audio",
              "inbox.comments.read",
              "inbox.mentions",
              "inbox.dm.send",
              "inbox.private_reply",
              "analytics.post_metrics",
              "analytics.account_metrics",
              "analytics.story_insights_webhook",
              "ads.boost"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "available",
              "reconnect_required",
              "requires_variant",
              "requires_connection",
              "plan_upgrade",
              "coming_soon",
              "unsupported"
            ]
          }
        },
        "required": [
          "severity",
          "target",
          "platform",
          "field",
          "rule",
          "message"
        ]
      },
      "IssuedApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "brandIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "apiVersion": {
            "type": "string"
          },
          "createdBy": {
            "type": "string",
            "format": "uuid"
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "replacedBy": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "description": "The key (rp_live_... or rp_test_...), shown once"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "mode",
          "scopes",
          "brandIds",
          "apiVersion",
          "createdBy",
          "lastUsedAt",
          "expiresAt",
          "revokedAt",
          "replacedBy",
          "createdAt",
          "secret"
        ]
      },
      "IssuedWebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "brandIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "livemode": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "failing",
              "disabled"
            ]
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "failingSince": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "apiVersion": {
            "type": "string"
          },
          "lastDelivery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "sending",
                      "success",
                      "failed",
                      "skipped"
                    ]
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "status",
                  "at"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The newest delivery to this endpoint, or null when it has none"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "description": "The signing secret (whsec_...), shown once"
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "brandIds",
          "accountIds",
          "livemode",
          "status",
          "consecutiveFailures",
          "failingSince",
          "apiVersion",
          "lastDelivery",
          "createdAt",
          "secret"
        ]
      },
      "Media": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "brandId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "image",
                  "video"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ]
          },
          "bytes": {
            "type": "integer"
          },
          "declaredBytes": {
            "type": "integer"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "durationMs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "ready",
              "failed"
            ]
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "altText": {
            "type": [
              "string",
              "null"
            ]
          },
          "previewUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "A signed link valid for one hour; null until the media is ready"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaIssue"
            }
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "size_mismatch",
                  "type_mismatch",
                  "unreadable",
                  "rejected",
                  "unsafe_url",
                  "redirect_not_followed",
                  "fetch_failed",
                  "unsupported_content_type",
                  "too_large",
                  "storage_limit"
                ]
              },
              "message": {
                "type": "string"
              },
              "issues": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MediaIssue"
                }
              }
            },
            "required": [
              "code",
              "message",
              "issues"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "brandId",
          "kind",
          "contentType",
          "bytes",
          "width",
          "height",
          "durationMs",
          "status",
          "filename",
          "altText",
          "previewUrl",
          "issues",
          "createdAt"
        ]
      },
      "MediaDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "id"
        ]
      },
      "MediaIssue": {
        "type": "object",
        "properties": {
          "rule": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          },
          "limit": {
            "type": "number"
          },
          "actual": {
            "type": "number"
          }
        },
        "required": [
          "rule",
          "message",
          "severity"
        ]
      },
      "MediaStorage": {
        "type": "object",
        "properties": {
          "usedBytes": {
            "type": "integer"
          },
          "limitBytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "count": {
            "type": "integer"
          }
        },
        "required": [
          "usedBytes",
          "limitBytes",
          "count"
        ]
      },
      "MediaUploadTicket": {
        "type": "object",
        "properties": {
          "mediaId": {
            "type": "string",
            "format": "uuid"
          },
          "uploadUrl": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "const": "PUT"
          },
          "headers": {
            "type": "object",
            "properties": {
              "content-type": {
                "type": "string"
              }
            },
            "required": [
              "content-type"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "mediaId",
          "uploadUrl",
          "method",
          "headers",
          "expiresAt"
        ]
      },
      "Member": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "null once the member's account is deleted"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "developer",
              "editor",
              "viewer"
            ]
          },
          "joinedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "userId",
          "email",
          "name",
          "role",
          "joinedAt"
        ]
      },
      "ModuleState": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "publishing",
              "inbox",
              "automations",
              "analytics",
              "ads"
            ]
          },
          "stage": {
            "type": "string",
            "enum": [
              "ga",
              "beta",
              "planned"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "nav": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "area": {
                  "type": "string",
                  "enum": [
                    "workspace",
                    "admin"
                  ]
                },
                "group": {
                  "type": "string",
                  "enum": [
                    "home",
                    "workspace",
                    "developer",
                    "account"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "icon": {
                  "type": "string"
                }
              },
              "required": [
                "area",
                "group",
                "label",
                "path",
                "icon"
              ]
            }
          }
        },
        "required": [
          "id",
          "stage",
          "enabled",
          "nav"
        ]
      },
      "PageMeta": {
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "per_page": {
            "type": "integer"
          }
        },
        "required": [
          "next_cursor",
          "per_page"
        ]
      },
      "Platform": {
        "type": "object",
        "properties": {
          "accountType": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "availability": {
            "type": "string",
            "enum": [
              "live",
              "planned"
            ]
          },
          "release": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The planned release of a coming platform; null when live"
          },
          "interestKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "test": {
            "type": "boolean",
            "description": "true for test platforms such as sandbox, which only test keys see"
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rules": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ],
            "description": "The publishing rules: caption limits, content types, media specs, timing and rate budgets; null for a planned platform"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "enum": [
                    "publishing.image",
                    "publishing.carousel",
                    "publishing.reel",
                    "publishing.story",
                    "publishing.collaborators",
                    "publishing.alt_text",
                    "publishing.user_tags",
                    "publishing.location",
                    "publishing.trial_reels",
                    "publishing.ai_label",
                    "publishing.first_comment",
                    "publishing.delete",
                    "publishing.resumable_upload",
                    "publishing.partnership_label",
                    "publishing.polls",
                    "publishing.audio",
                    "inbox.comments.read",
                    "inbox.mentions",
                    "inbox.dm.send",
                    "inbox.private_reply",
                    "analytics.post_metrics",
                    "analytics.account_metrics",
                    "analytics.story_insights_webhook",
                    "ads.boost"
                  ]
                },
                "stage": {
                  "type": "string",
                  "enum": [
                    "ga",
                    "beta",
                    "planned",
                    "unsupported"
                  ]
                },
                "variants": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "planFeature": {
                  "type": "string"
                },
                "limits": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "number"
                  }
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "stage",
                "variants",
                "scopes"
              ]
            }
          }
        },
        "required": [
          "accountType",
          "provider",
          "name",
          "description",
          "availability",
          "release",
          "interestKey",
          "test",
          "variants",
          "rules",
          "capabilities"
        ]
      },
      "Post": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "brandId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "publishing",
              "published",
              "partial",
              "failed",
              "unconfirmed",
              "cancelled"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "draft",
              "schedule",
              "publish_now",
              "queue"
            ]
          },
          "text": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstComment": {
            "type": [
              "string",
              "null"
            ]
          },
          "scheduledAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "queueId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "dashboard",
              "api"
            ]
          },
          "media": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "mediaId": {
                  "type": "string",
                  "format": "uuid"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "mediaId",
                "position"
              ]
            }
          },
          "platformData": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "contentType": {
                  "type": "string"
                }
              },
              "required": [
                "contentType"
              ],
              "additionalProperties": true
            }
          },
          "stagger": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "minSeconds": {
                    "type": "integer"
                  },
                  "maxSeconds": {
                    "type": "integer"
                  }
                },
                "required": [
                  "minSeconds",
                  "maxSeconds"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "accountId": {
                  "type": "string",
                  "format": "uuid"
                },
                "platform": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "scheduled",
                    "publishing",
                    "published",
                    "failed",
                    "unconfirmed",
                    "cancelled"
                  ]
                },
                "dueAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "leadMs": {
                  "type": "integer"
                },
                "platformPostId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "permalink": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "permalinkPending": {
                  "type": "boolean"
                },
                "publishedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "publishedLateMs": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "action": {
                          "type": "string"
                        },
                        "retryByUser": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "action"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reconciliation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "evidence": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "evidence"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revision": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "accountId",
                "platform",
                "status",
                "dueAt",
                "leadMs",
                "platformPostId",
                "permalink",
                "permalinkPending",
                "publishedAt",
                "publishedLateMs",
                "error",
                "reconciliation",
                "revision"
              ]
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "brandId",
          "status",
          "mode",
          "text",
          "title",
          "firstComment",
          "scheduledAt",
          "queueId",
          "revision",
          "source",
          "media",
          "platformData",
          "stagger",
          "metadata",
          "targets",
          "warnings",
          "createdAt"
        ]
      },
      "PostCheck": {
        "type": "object",
        "properties": {
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          }
        },
        "required": [
          "issues",
          "warnings"
        ]
      },
      "PostData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "brandId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "publishing",
              "published",
              "partial",
              "failed",
              "unconfirmed",
              "cancelled"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "draft",
              "schedule",
              "publish_now",
              "queue"
            ]
          },
          "text": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstComment": {
            "type": [
              "string",
              "null"
            ]
          },
          "scheduledAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "queueId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "dashboard",
              "api"
            ]
          },
          "media": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "mediaId": {
                  "type": "string",
                  "format": "uuid"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "mediaId",
                "position"
              ]
            }
          },
          "platformData": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "contentType": {
                  "type": "string"
                }
              },
              "required": [
                "contentType"
              ],
              "additionalProperties": true
            }
          },
          "stagger": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "minSeconds": {
                    "type": "integer"
                  },
                  "maxSeconds": {
                    "type": "integer"
                  }
                },
                "required": [
                  "minSeconds",
                  "maxSeconds"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "accountId": {
                  "type": "string",
                  "format": "uuid"
                },
                "platform": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "scheduled",
                    "publishing",
                    "published",
                    "failed",
                    "unconfirmed",
                    "cancelled"
                  ]
                },
                "dueAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "leadMs": {
                  "type": "integer"
                },
                "platformPostId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "permalink": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "permalinkPending": {
                  "type": "boolean"
                },
                "publishedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "publishedLateMs": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "action": {
                          "type": "string"
                        },
                        "retryByUser": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "action"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reconciliation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "evidence": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "evidence"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revision": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "accountId",
                "platform",
                "status",
                "dueAt",
                "leadMs",
                "platformPostId",
                "permalink",
                "permalinkPending",
                "publishedAt",
                "publishedLateMs",
                "error",
                "reconciliation",
                "revision"
              ]
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "livemode": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "brandId",
          "status",
          "mode",
          "text",
          "title",
          "firstComment",
          "scheduledAt",
          "queueId",
          "revision",
          "source",
          "media",
          "platformData",
          "stagger",
          "metadata",
          "targets",
          "warnings",
          "createdAt",
          "livemode"
        ]
      },
      "PostEvent": {
        "type": "object",
        "properties": {
          "targetId": {
            "type": "string",
            "format": "uuid"
          },
          "step": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "detail": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "targetId",
          "step",
          "label",
          "outcome",
          "at",
          "detail"
        ]
      },
      "PublicEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "brandId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "accountId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "additionalProperties": {},
            "description": "The payload of the event type; see the event catalog"
          }
        },
        "required": [
          "id",
          "type",
          "timestamp",
          "brandId",
          "accountId",
          "livemode",
          "data"
        ]
      },
      "PublicEventType": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "module": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "stage": {
            "type": "string",
            "enum": [
              "ga",
              "beta",
              "planned"
            ]
          }
        },
        "required": [
          "type",
          "module",
          "description",
          "stage"
        ]
      },
      "PublicPlan": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "free",
              "pro",
              "business",
              "enterprise"
            ]
          },
          "name": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "publishing",
                "inbox",
                "automations",
                "analytics",
                "ads",
                "connect_branding",
                "customer_apps",
                "priority_support",
                "sso"
              ]
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "accounts": {
                "type": "object",
                "properties": {
                  "included": {
                    "type": "integer"
                  },
                  "max": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "included",
                  "max"
                ]
              },
              "postsPerMonth": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "storageBytes": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "logRetentionDays": {
                "type": "integer"
              },
              "rateLimitPerMin": {
                "type": "integer"
              },
              "rateTier": {
                "type": "string",
                "enum": [
                  "free",
                  "paid",
                  "scale"
                ],
                "description": "The API rate budget tier; rateLimitPerMin follows it"
              }
            },
            "required": [
              "accounts",
              "postsPerMonth",
              "storageBytes",
              "logRetentionDays",
              "rateLimitPerMin",
              "rateTier"
            ]
          },
          "priceLookupKeys": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "pro_monthly",
                "pro_annual",
                "business_monthly",
                "business_annual"
              ]
            },
            "description": "The plan's prices at the payment provider; empty for a plan sold without a price"
          },
          "prices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lookupKey": {
                  "type": "string",
                  "description": "The price's id at the payment provider"
                },
                "interval": {
                  "type": "string",
                  "enum": [
                    "month",
                    "year"
                  ]
                },
                "currency": {
                  "type": "string",
                  "const": "usd"
                },
                "baseCents": {
                  "type": "integer"
                },
                "includedAccounts": {
                  "type": "integer"
                },
                "extraBands": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "upToAccounts": {
                        "anyOf": [
                          {
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "unitCents": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "upToAccounts",
                      "unitCents"
                    ]
                  }
                }
              },
              "required": [
                "lookupKey",
                "interval",
                "currency",
                "baseCents",
                "includedAccounts",
                "extraBands"
              ]
            }
          }
        },
        "required": [
          "key",
          "name",
          "features",
          "limits",
          "priceLookupKeys",
          "prices"
        ]
      },
      "Queue": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "brandId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "slots": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "string",
                  "enum": [
                    "mon",
                    "tue",
                    "wed",
                    "thu",
                    "fri",
                    "sat",
                    "sun"
                  ]
                },
                "time": {
                  "type": "string"
                }
              },
              "required": [
                "day",
                "time"
              ]
            }
          },
          "isDefault": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "brandId",
          "name",
          "timezone",
          "slots",
          "isDefault",
          "active",
          "createdAt"
        ]
      },
      "QueuePreview": {
        "type": "object",
        "properties": {
          "slots": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "required": [
          "slots"
        ]
      },
      "QueueReshuffle": {
        "type": "object",
        "properties": {
          "moved": {
            "type": "integer"
          }
        },
        "required": [
          "moved"
        ]
      },
      "RequestLog": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "principalType": {
            "type": "string",
            "enum": [
              "user",
              "api_key"
            ]
          },
          "principalId": {
            "type": "string"
          },
          "keyPrefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "latencyMs": {
            "type": "integer"
          },
          "requestId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "method",
          "path",
          "status",
          "principalType",
          "principalId",
          "keyPrefix",
          "livemode",
          "latencyMs",
          "requestId",
          "createdAt"
        ]
      },
      "ScopeListing": {
        "type": "object",
        "properties": {
          "module": {
            "type": "string"
          },
          "stage": {
            "type": "string",
            "enum": [
              "ga",
              "beta",
              "planned"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scope": {
                  "type": "string"
                },
                "available": {
                  "type": "boolean"
                },
                "reason": {
                  "type": "string",
                  "const": "planned"
                }
              },
              "required": [
                "scope",
                "available"
              ]
            }
          }
        },
        "required": [
          "module",
          "stage",
          "scopes"
        ]
      },
      "SocialAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "brandId": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "type": "string"
          },
          "authVariant": {
            "type": "string"
          },
          "platformAccountId": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "profilePictureUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountCategory": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "action_required",
              "reconnect_required",
              "disconnected",
              "frozen"
            ]
          },
          "grantedScopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "connectedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "brandId",
          "platform",
          "authVariant",
          "platformAccountId",
          "username",
          "profilePictureUrl",
          "accountCategory",
          "status",
          "grantedScopes",
          "connectedAt"
        ]
      },
      "TargetData": {
        "type": "object",
        "properties": {
          "postId": {
            "type": "string",
            "format": "uuid"
          },
          "targetId": {
            "type": "string",
            "format": "uuid"
          },
          "brandId": {
            "type": "string",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "publishing",
              "published",
              "failed",
              "unconfirmed",
              "cancelled"
            ]
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TargetError"
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {}
          },
          "livemode": {
            "type": "boolean"
          }
        },
        "required": [
          "postId",
          "targetId",
          "brandId",
          "accountId",
          "platform",
          "status",
          "error",
          "metadata",
          "livemode"
        ]
      },
      "TargetError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "retryByUser": {
            "type": "boolean"
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "code",
          "message",
          "action"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "description": "The billing period the meters count, as YYYY-MM"
          },
          "accounts": {
            "type": "object",
            "properties": {
              "used": {
                "type": "number"
              },
              "limit": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "null means no limit"
              }
            },
            "required": [
              "used",
              "limit"
            ]
          },
          "posts": {
            "type": "object",
            "properties": {
              "used": {
                "type": "number"
              },
              "limit": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "null means no limit"
              }
            },
            "required": [
              "used",
              "limit"
            ]
          },
          "storageBytes": {
            "type": "object",
            "properties": {
              "used": {
                "type": "number"
              },
              "limit": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "null means no limit"
              }
            },
            "required": [
              "used",
              "limit"
            ]
          },
          "planKey": {
            "type": "string",
            "enum": [
              "free",
              "pro",
              "business",
              "enterprise"
            ]
          },
          "billingBlock": {
            "type": "string",
            "enum": [
              "none",
              "grace",
              "blocked"
            ]
          },
          "graceUntil": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "period",
          "accounts",
          "posts",
          "storageBytes",
          "planKey",
          "billingBlock",
          "graceUntil"
        ]
      },
      "UsageDay": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "YYYY-MM-DD (UTC)"
          },
          "posts": {
            "type": "integer"
          },
          "published": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          }
        },
        "required": [
          "date",
          "posts",
          "published",
          "failed"
        ]
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "endpointId": {
            "type": "string",
            "format": "uuid"
          },
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "eventType": {
            "type": "string"
          },
          "attempt": {
            "type": "integer"
          },
          "trigger": {
            "type": "string",
            "enum": [
              "auto",
              "manual",
              "test"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "success",
              "failed",
              "skipped"
            ]
          },
          "responseStatus": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "responseExcerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "durationMs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextAttemptAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpointId",
          "eventId",
          "eventType",
          "attempt",
          "trigger",
          "status",
          "responseStatus",
          "responseExcerpt",
          "durationMs",
          "nextAttemptAt",
          "createdAt"
        ]
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "brandIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "livemode": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "failing",
              "disabled"
            ]
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "failingSince": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "apiVersion": {
            "type": "string"
          },
          "lastDelivery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "sending",
                      "success",
                      "failed",
                      "skipped"
                    ]
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "status",
                  "at"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The newest delivery to this endpoint, or null when it has none"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "brandIds",
          "accountIds",
          "livemode",
          "status",
          "consecutiveFailures",
          "failingSince",
          "apiVersion",
          "lastDelivery",
          "createdAt"
        ]
      },
      "Workspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "planKey": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "settings": {
            "type": "object",
            "properties": {
              "duplicateGuard": {
                "type": "boolean"
              },
              "defaultQueueId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "duplicateGuard",
              "defaultQueueId"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "planKey",
          "status",
          "timezone",
          "settings",
          "createdAt"
        ]
      },
      "WorkspaceMembership": {
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "developer",
              "editor",
              "viewer"
            ]
          },
          "planKey": {
            "type": "string"
          }
        },
        "required": [
          "workspaceId",
          "name",
          "slug",
          "role",
          "planKey"
        ]
      }
    }
  }
}
