{
    "openapi": "3.1.0",
    "info": {
        "title": "PostMesh — Public API",
        "version": "1.0.0",
        "description": "The versioned, token-authenticated, tenant-isolated Public API. Every request is authenticated with a Bearer API token scoped to one workspace (team); a token can never reach another tenant's data. The API reuses the in-app publish pipeline, so creating a post honours the same validation, plan capabilities, and never-over-publish guarantees."
    },
    "servers": [
        {
            "url": "{baseUrl}/api/v1",
            "description": "The versioned Public API.",
            "variables": {
                "baseUrl": {
                    "default": "https://app.example.com",
                    "description": "Your PostMesh base URL."
                }
            }
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "paths": {
        "/accounts": {
            "get": {
                "operationId": "v1.accounts.index",
                "tags": [
                    "Account"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `SocialAccountResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/analytics": {
            "get": {
                "operationId": "v1.analytics.summary",
                "tags": [
                    "Analytics"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "since": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "since",
                                                        "until"
                                                    ]
                                                },
                                                "accounts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "connected": {
                                                            "type": "integer",
                                                            "minimum": 0
                                                        },
                                                        "publishable": {
                                                            "type": "integer",
                                                            "minimum": 0
                                                        }
                                                    },
                                                    "required": [
                                                        "connected",
                                                        "publishable"
                                                    ]
                                                },
                                                "posts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "string"
                                                        },
                                                        "by_status": {
                                                            "type": "object",
                                                            "additionalProperties": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "required": [
                                                        "total",
                                                        "by_status"
                                                    ]
                                                },
                                                "targets": {
                                                    "type": "object",
                                                    "properties": {
                                                        "published": {
                                                            "type": "string"
                                                        },
                                                        "failed": {
                                                            "type": "string"
                                                        },
                                                        "needs_action": {
                                                            "type": "string"
                                                        },
                                                        "pending": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "published",
                                                        "failed",
                                                        "needs_action",
                                                        "pending"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "period",
                                                "accounts",
                                                "posts",
                                                "targets"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "description": "The honest \"reach/engagement not yet collected\" disclosure — the API never\npretends to have platform-insight numbers it has not yet gathered.",
                                            "properties": {
                                                "engagement_metrics": {
                                                    "type": "string",
                                                    "const": "pending"
                                                },
                                                "note": {
                                                    "type": "string",
                                                    "const": "Reach and engagement metrics populate once the platform collectors run."
                                                }
                                            },
                                            "required": [
                                                "engagement_metrics",
                                                "note"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/posts/bulk/{batch}": {
            "get": {
                "operationId": "v1.posts.bulk.show",
                "description": "Tenant-scoped route binding: a batch belonging to another workspace is invisible to this token\nand 404s. Eager-loads the per-row outcomes so the poller can see which rows prepared and which\nneed fixing.",
                "summary": "GET /posts/bulk/{batch} — poll a batch's status, per-row tallies, and row errors",
                "tags": [
                    "BulkPost"
                ],
                "parameters": [
                    {
                        "name": "batch",
                        "in": "path",
                        "required": true,
                        "description": "The batch ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`BulkBatchResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/BulkBatchResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such batch in this workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The workspace plan does not unlock bulk publishing (`social_bulk_publish`). Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token lacks the `read` ability. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/posts/bulk": {
            "post": {
                "operationId": "v1.posts.bulk.store",
                "description": "Validates the request shape + the flat caps ({@see CreateBulkPostsRequest}), builds the shared\nrow specs, and hands them to {@see BulkBatchService::create()} with `source: api`. Responds 202\n(Accepted — preparation is async) with the new batch + a `poll_url` to watch it settle.",
                "summary": "POST /posts/bulk — start a bulk \"prepare rows → review as drafts\" batch",
                "tags": [
                    "BulkPost"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateBulkPostsRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Batch accepted. Preparation runs async on the `bulk` queue; nothing is scheduled or published. Body: the batch + a `poll_url`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/BulkBatchResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed, or a flat cap (rows-per-batch / media-per-row) was breached. Body: `{ \"message\": string, \"errors\": { field: string[] } }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The workspace plan does not unlock bulk publishing (`social_bulk_publish`). Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token lacks the `write` ability. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/platforms": {
            "get": {
                "operationId": "v1.platforms.index",
                "summary": "GET /platforms — every supported network with its name, id, and key limits",
                "tags": [
                    "Platform"
                ],
                "responses": {
                    "200": {
                        "description": "The supported networks (public, unauthenticated).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": []
            }
        },
        "/posts": {
            "get": {
                "operationId": "v1.posts.index",
                "summary": "GET /posts — the team's posts, newest first, with per-network outcomes",
                "tags": [
                    "Post"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `PostResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/PostResource"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.posts.store",
                "summary": "POST /posts — create + publish (or schedule) a post across one or more accounts",
                "tags": [
                    "Post"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreatePostRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`PostResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PostResource"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "scheduled": {
                                                    "type": "boolean"
                                                },
                                                "dispatched_count": {
                                                    "type": "integer"
                                                },
                                                "skipped_count": {
                                                    "type": "integer"
                                                },
                                                "skipped_platforms": {
                                                    "type": "array",
                                                    "items": {}
                                                }
                                            },
                                            "required": [
                                                "scheduled",
                                                "dispatched_count",
                                                "skipped_count",
                                                "skipped_platforms"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed (or every selected network is blocked). Body: `{ \"message\": string, \"errors\": { field: string[] } }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Errors overview."
                                        },
                                        "errors": {
                                            "type": "object",
                                            "description": "A detailed description of each field that failed validation.",
                                            "additionalProperties": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token lacks the `write` ability, or the plan does not unlock `social_publish`. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The workspace plan does not include the Public API. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/posts/{post}": {
            "get": {
                "operationId": "v1.posts.show",
                "summary": "GET /posts/{post} — a single post (tenant-scoped route binding)",
                "tags": [
                    "Post"
                ],
                "parameters": [
                    {
                        "name": "post",
                        "in": "path",
                        "required": true,
                        "description": "The post ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`PostResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PostResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token's plan does not unlock another team's post, or the post belongs to another workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such post in this workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks": {
            "get": {
                "operationId": "v1.webhooks.index",
                "tags": [
                    "WebhookEndpoint"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `WebhookEndpointResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.webhooks.store",
                "tags": [
                    "WebhookEndpoint"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SaveWebhookEndpointRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The plaintext secret is surfaced ONCE here so the integrator can store it to verify\nsignatures — it is encrypted at rest and never returned again.\n\n\n\n`WebhookEndpointResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpointResource"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "secret": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "secret"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed. Body: `{ \"message\": string, \"errors\": { field: string[] } }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Errors overview."
                                        },
                                        "errors": {
                                            "type": "object",
                                            "description": "A detailed description of each field that failed validation.",
                                            "additionalProperties": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token lacks the `write` ability. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/{webhook}": {
            "get": {
                "operationId": "v1.webhooks.show",
                "tags": [
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "required": true,
                        "description": "The webhook ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`WebhookEndpointResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpointResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The endpoint belongs to another workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such webhook endpoint in this workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "v1.webhooks.update",
                "tags": [
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "required": true,
                        "description": "The webhook ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SaveWebhookEndpointRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`WebhookEndpointResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpointResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token lacks the `write` ability, or the endpoint belongs to another workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such webhook endpoint in this workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed. Body: `{ \"message\": string, \"errors\": { field: string[] } }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Errors overview."
                                        },
                                        "errors": {
                                            "type": "object",
                                            "description": "A detailed description of each field that failed validation.",
                                            "additionalProperties": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v1.webhooks.destroy",
                "tags": [
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "required": true,
                        "description": "The webhook ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "403": {
                        "description": "The token lacks the `write` ability, or the endpoint belongs to another workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such webhook endpoint in this workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-deliveries/{delivery}/replay": {
            "post": {
                "operationId": "v1.webhooks.replay",
                "summary": "Re-queue a past delivery for manual replay (#119). Resets the row to pending and\ndispatches a fresh delivery job — the same signed payload is sent again",
                "tags": [
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "delivery",
                        "in": "path",
                        "required": true,
                        "description": "The delivery ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Delivery re-queued."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "delivery_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "delivery_id",
                                                "status"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token lacks the `write` ability, or the delivery belongs to another workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such webhook delivery in this workspace. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked, or expired token. Body: `{ \"message\": string }`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "description": "A workspace-scoped API token (prefix `frsk_`) minted at /app/settings/api. Send it as `Authorization: Bearer frsk_…`. A token can never reach another workspace's data.",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "BulkBatchResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "source": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "total_rows": {
                        "type": "integer"
                    },
                    "prepared_count": {
                        "type": "integer"
                    },
                    "failed_count": {
                        "type": "integer"
                    },
                    "is_complete": {
                        "type": "boolean"
                    },
                    "row_errors": {
                        "type": "array",
                        "description": "Parse-stage rejections (a malformed/over-cap row that never became a draft).",
                        "items": {}
                    },
                    "rows": {
                        "type": "array",
                        "description": "The per-row outcomes — only when the relation is eager-loaded (the poll view).",
                        "items": {
                            "type": "object",
                            "properties": {
                                "index": {
                                    "type": "integer"
                                },
                                "status": {
                                    "type": "string"
                                },
                                "post_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "error": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "index",
                                "status",
                                "post_id",
                                "error"
                            ]
                        }
                    },
                    "poll_url": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "source",
                    "status",
                    "total_rows",
                    "prepared_count",
                    "failed_count",
                    "is_complete",
                    "row_errors",
                    "poll_url",
                    "created_at",
                    "updated_at"
                ],
                "title": "BulkBatchResource"
            },
            "CreateBulkPostsRequest": {
                "type": "object",
                "description": "The Public API's bulk-create body (feat/bulk-publishing, direction 3) — the third front door into\nthe SAME \"prepare rows → review as drafts\" pipeline the in-app mass-upload board and the CSV import\nuse. The integrator POSTs an array of `posts`, each one row of the shared spec (caption, title,\ntags, kind, accounts, media, scheduled_at); every valid row becomes a {@see BulkRowSpec} the\n{@see BulkBatchService} fans out as a DRAFT for the review board. The API NEVER auto-schedules or\nauto-publishes — a row's optional `scheduled_at` is carried onto the draft, not acted on.\n\nOnly the request SHAPE + the FLAT, env-overridable caps are validated here:\n - `max_rows_per_batch` bounds the `posts` array (a cheap 422 before any write);\n - `max_media_per_row` bounds each row's `media` array.\nThe DOMAIN resolution (does this `platform@username` / media URL resolve within the team?) is the\nresolver's job at prepare time — an unresolvable ref becomes a per-row error on the batch, never a\nwrong-account post. {@see BulkBatchService} re-checks every cap authoritatively when it persists.\n\nRefs are deliberately loose so the API speaks the same shape as the board + CSV:\n - `accounts[]` — a connected SocialAccount id (int) OR a `platform@username` string.\n - `media[]`    — a MediaAsset id (int) OR a public https media URL (SSRF-guarded + ingested).",
                "properties": {
                    "posts": {
                        "type": "array",
                        "description": "The batch: at least one row, never more than the flat per-batch ceiling.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "caption": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "description": "Per-row content — every field optional except the targeting (a row MUST name at least\none account; an account-less row would only ever become a row error)."
                                },
                                "title": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "kind": {
                                    "$ref": "#/components/schemas/PostKind"
                                },
                                "scheduled_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "timezone": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "description": "The IANA zone a NAIVE scheduled_at is set in (the pair contract); omitted →\nthe scheduling cascade (row's account → team → token user → app default).",
                                    "enum": [
                                        "Africa/Abidjan",
                                        "Africa/Accra",
                                        "Africa/Addis_Ababa",
                                        "Africa/Algiers",
                                        "Africa/Asmara",
                                        "Africa/Bamako",
                                        "Africa/Bangui",
                                        "Africa/Banjul",
                                        "Africa/Bissau",
                                        "Africa/Blantyre",
                                        "Africa/Brazzaville",
                                        "Africa/Bujumbura",
                                        "Africa/Cairo",
                                        "Africa/Casablanca",
                                        "Africa/Ceuta",
                                        "Africa/Conakry",
                                        "Africa/Dakar",
                                        "Africa/Dar_es_Salaam",
                                        "Africa/Djibouti",
                                        "Africa/Douala",
                                        "Africa/El_Aaiun",
                                        "Africa/Freetown",
                                        "Africa/Gaborone",
                                        "Africa/Harare",
                                        "Africa/Johannesburg",
                                        "Africa/Juba",
                                        "Africa/Kampala",
                                        "Africa/Khartoum",
                                        "Africa/Kigali",
                                        "Africa/Kinshasa",
                                        "Africa/Lagos",
                                        "Africa/Libreville",
                                        "Africa/Lome",
                                        "Africa/Luanda",
                                        "Africa/Lubumbashi",
                                        "Africa/Lusaka",
                                        "Africa/Malabo",
                                        "Africa/Maputo",
                                        "Africa/Maseru",
                                        "Africa/Mbabane",
                                        "Africa/Mogadishu",
                                        "Africa/Monrovia",
                                        "Africa/Nairobi",
                                        "Africa/Ndjamena",
                                        "Africa/Niamey",
                                        "Africa/Nouakchott",
                                        "Africa/Ouagadougou",
                                        "Africa/Porto-Novo",
                                        "Africa/Sao_Tome",
                                        "Africa/Tripoli",
                                        "Africa/Tunis",
                                        "Africa/Windhoek",
                                        "America/Adak",
                                        "America/Anchorage",
                                        "America/Anguilla",
                                        "America/Antigua",
                                        "America/Araguaina",
                                        "America/Argentina/Buenos_Aires",
                                        "America/Argentina/Catamarca",
                                        "America/Argentina/Cordoba",
                                        "America/Argentina/Jujuy",
                                        "America/Argentina/La_Rioja",
                                        "America/Argentina/Mendoza",
                                        "America/Argentina/Rio_Gallegos",
                                        "America/Argentina/Salta",
                                        "America/Argentina/San_Juan",
                                        "America/Argentina/San_Luis",
                                        "America/Argentina/Tucuman",
                                        "America/Argentina/Ushuaia",
                                        "America/Aruba",
                                        "America/Asuncion",
                                        "America/Atikokan",
                                        "America/Bahia",
                                        "America/Bahia_Banderas",
                                        "America/Barbados",
                                        "America/Belem",
                                        "America/Belize",
                                        "America/Blanc-Sablon",
                                        "America/Boa_Vista",
                                        "America/Bogota",
                                        "America/Boise",
                                        "America/Cambridge_Bay",
                                        "America/Campo_Grande",
                                        "America/Cancun",
                                        "America/Caracas",
                                        "America/Cayenne",
                                        "America/Cayman",
                                        "America/Chicago",
                                        "America/Chihuahua",
                                        "America/Ciudad_Juarez",
                                        "America/Costa_Rica",
                                        "America/Coyhaique",
                                        "America/Creston",
                                        "America/Cuiaba",
                                        "America/Curacao",
                                        "America/Danmarkshavn",
                                        "America/Dawson",
                                        "America/Dawson_Creek",
                                        "America/Denver",
                                        "America/Detroit",
                                        "America/Dominica",
                                        "America/Edmonton",
                                        "America/Eirunepe",
                                        "America/El_Salvador",
                                        "America/Fort_Nelson",
                                        "America/Fortaleza",
                                        "America/Glace_Bay",
                                        "America/Goose_Bay",
                                        "America/Grand_Turk",
                                        "America/Grenada",
                                        "America/Guadeloupe",
                                        "America/Guatemala",
                                        "America/Guayaquil",
                                        "America/Guyana",
                                        "America/Halifax",
                                        "America/Havana",
                                        "America/Hermosillo",
                                        "America/Indiana/Indianapolis",
                                        "America/Indiana/Knox",
                                        "America/Indiana/Marengo",
                                        "America/Indiana/Petersburg",
                                        "America/Indiana/Tell_City",
                                        "America/Indiana/Vevay",
                                        "America/Indiana/Vincennes",
                                        "America/Indiana/Winamac",
                                        "America/Inuvik",
                                        "America/Iqaluit",
                                        "America/Jamaica",
                                        "America/Juneau",
                                        "America/Kentucky/Louisville",
                                        "America/Kentucky/Monticello",
                                        "America/Kralendijk",
                                        "America/La_Paz",
                                        "America/Lima",
                                        "America/Los_Angeles",
                                        "America/Lower_Princes",
                                        "America/Maceio",
                                        "America/Managua",
                                        "America/Manaus",
                                        "America/Marigot",
                                        "America/Martinique",
                                        "America/Matamoros",
                                        "America/Mazatlan",
                                        "America/Menominee",
                                        "America/Merida",
                                        "America/Metlakatla",
                                        "America/Mexico_City",
                                        "America/Miquelon",
                                        "America/Moncton",
                                        "America/Monterrey",
                                        "America/Montevideo",
                                        "America/Montserrat",
                                        "America/Nassau",
                                        "America/New_York",
                                        "America/Nome",
                                        "America/Noronha",
                                        "America/North_Dakota/Beulah",
                                        "America/North_Dakota/Center",
                                        "America/North_Dakota/New_Salem",
                                        "America/Nuuk",
                                        "America/Ojinaga",
                                        "America/Panama",
                                        "America/Paramaribo",
                                        "America/Phoenix",
                                        "America/Port-au-Prince",
                                        "America/Port_of_Spain",
                                        "America/Porto_Velho",
                                        "America/Puerto_Rico",
                                        "America/Punta_Arenas",
                                        "America/Rankin_Inlet",
                                        "America/Recife",
                                        "America/Regina",
                                        "America/Resolute",
                                        "America/Rio_Branco",
                                        "America/Santarem",
                                        "America/Santiago",
                                        "America/Santo_Domingo",
                                        "America/Sao_Paulo",
                                        "America/Scoresbysund",
                                        "America/Sitka",
                                        "America/St_Barthelemy",
                                        "America/St_Johns",
                                        "America/St_Kitts",
                                        "America/St_Lucia",
                                        "America/St_Thomas",
                                        "America/St_Vincent",
                                        "America/Swift_Current",
                                        "America/Tegucigalpa",
                                        "America/Thule",
                                        "America/Tijuana",
                                        "America/Toronto",
                                        "America/Tortola",
                                        "America/Vancouver",
                                        "America/Whitehorse",
                                        "America/Winnipeg",
                                        "America/Yakutat",
                                        "Antarctica/Casey",
                                        "Antarctica/Davis",
                                        "Antarctica/DumontDUrville",
                                        "Antarctica/Macquarie",
                                        "Antarctica/Mawson",
                                        "Antarctica/McMurdo",
                                        "Antarctica/Palmer",
                                        "Antarctica/Rothera",
                                        "Antarctica/Syowa",
                                        "Antarctica/Troll",
                                        "Antarctica/Vostok",
                                        "Arctic/Longyearbyen",
                                        "Asia/Aden",
                                        "Asia/Almaty",
                                        "Asia/Amman",
                                        "Asia/Anadyr",
                                        "Asia/Aqtau",
                                        "Asia/Aqtobe",
                                        "Asia/Ashgabat",
                                        "Asia/Atyrau",
                                        "Asia/Baghdad",
                                        "Asia/Bahrain",
                                        "Asia/Baku",
                                        "Asia/Bangkok",
                                        "Asia/Barnaul",
                                        "Asia/Beirut",
                                        "Asia/Bishkek",
                                        "Asia/Brunei",
                                        "Asia/Chita",
                                        "Asia/Colombo",
                                        "Asia/Damascus",
                                        "Asia/Dhaka",
                                        "Asia/Dili",
                                        "Asia/Dubai",
                                        "Asia/Dushanbe",
                                        "Asia/Famagusta",
                                        "Asia/Gaza",
                                        "Asia/Hebron",
                                        "Asia/Ho_Chi_Minh",
                                        "Asia/Hong_Kong",
                                        "Asia/Hovd",
                                        "Asia/Irkutsk",
                                        "Asia/Jakarta",
                                        "Asia/Jayapura",
                                        "Asia/Jerusalem",
                                        "Asia/Kabul",
                                        "Asia/Kamchatka",
                                        "Asia/Karachi",
                                        "Asia/Kathmandu",
                                        "Asia/Khandyga",
                                        "Asia/Kolkata",
                                        "Asia/Krasnoyarsk",
                                        "Asia/Kuala_Lumpur",
                                        "Asia/Kuching",
                                        "Asia/Kuwait",
                                        "Asia/Macau",
                                        "Asia/Magadan",
                                        "Asia/Makassar",
                                        "Asia/Manila",
                                        "Asia/Muscat",
                                        "Asia/Nicosia",
                                        "Asia/Novokuznetsk",
                                        "Asia/Novosibirsk",
                                        "Asia/Omsk",
                                        "Asia/Oral",
                                        "Asia/Phnom_Penh",
                                        "Asia/Pontianak",
                                        "Asia/Pyongyang",
                                        "Asia/Qatar",
                                        "Asia/Qostanay",
                                        "Asia/Qyzylorda",
                                        "Asia/Riyadh",
                                        "Asia/Sakhalin",
                                        "Asia/Samarkand",
                                        "Asia/Seoul",
                                        "Asia/Shanghai",
                                        "Asia/Singapore",
                                        "Asia/Srednekolymsk",
                                        "Asia/Taipei",
                                        "Asia/Tashkent",
                                        "Asia/Tbilisi",
                                        "Asia/Tehran",
                                        "Asia/Thimphu",
                                        "Asia/Tokyo",
                                        "Asia/Tomsk",
                                        "Asia/Ulaanbaatar",
                                        "Asia/Urumqi",
                                        "Asia/Ust-Nera",
                                        "Asia/Vientiane",
                                        "Asia/Vladivostok",
                                        "Asia/Yakutsk",
                                        "Asia/Yangon",
                                        "Asia/Yekaterinburg",
                                        "Asia/Yerevan",
                                        "Atlantic/Azores",
                                        "Atlantic/Bermuda",
                                        "Atlantic/Canary",
                                        "Atlantic/Cape_Verde",
                                        "Atlantic/Faroe",
                                        "Atlantic/Madeira",
                                        "Atlantic/Reykjavik",
                                        "Atlantic/South_Georgia",
                                        "Atlantic/St_Helena",
                                        "Atlantic/Stanley",
                                        "Australia/Adelaide",
                                        "Australia/Brisbane",
                                        "Australia/Broken_Hill",
                                        "Australia/Darwin",
                                        "Australia/Eucla",
                                        "Australia/Hobart",
                                        "Australia/Lindeman",
                                        "Australia/Lord_Howe",
                                        "Australia/Melbourne",
                                        "Australia/Perth",
                                        "Australia/Sydney",
                                        "Europe/Amsterdam",
                                        "Europe/Andorra",
                                        "Europe/Astrakhan",
                                        "Europe/Athens",
                                        "Europe/Belgrade",
                                        "Europe/Berlin",
                                        "Europe/Bratislava",
                                        "Europe/Brussels",
                                        "Europe/Bucharest",
                                        "Europe/Budapest",
                                        "Europe/Busingen",
                                        "Europe/Chisinau",
                                        "Europe/Copenhagen",
                                        "Europe/Dublin",
                                        "Europe/Gibraltar",
                                        "Europe/Guernsey",
                                        "Europe/Helsinki",
                                        "Europe/Isle_of_Man",
                                        "Europe/Istanbul",
                                        "Europe/Jersey",
                                        "Europe/Kaliningrad",
                                        "Europe/Kirov",
                                        "Europe/Kyiv",
                                        "Europe/Lisbon",
                                        "Europe/Ljubljana",
                                        "Europe/London",
                                        "Europe/Luxembourg",
                                        "Europe/Madrid",
                                        "Europe/Malta",
                                        "Europe/Mariehamn",
                                        "Europe/Minsk",
                                        "Europe/Monaco",
                                        "Europe/Moscow",
                                        "Europe/Oslo",
                                        "Europe/Paris",
                                        "Europe/Podgorica",
                                        "Europe/Prague",
                                        "Europe/Riga",
                                        "Europe/Rome",
                                        "Europe/Samara",
                                        "Europe/San_Marino",
                                        "Europe/Sarajevo",
                                        "Europe/Saratov",
                                        "Europe/Simferopol",
                                        "Europe/Skopje",
                                        "Europe/Sofia",
                                        "Europe/Stockholm",
                                        "Europe/Tallinn",
                                        "Europe/Tirane",
                                        "Europe/Ulyanovsk",
                                        "Europe/Vaduz",
                                        "Europe/Vatican",
                                        "Europe/Vienna",
                                        "Europe/Vilnius",
                                        "Europe/Volgograd",
                                        "Europe/Warsaw",
                                        "Europe/Zagreb",
                                        "Europe/Zurich",
                                        "Indian/Antananarivo",
                                        "Indian/Chagos",
                                        "Indian/Christmas",
                                        "Indian/Cocos",
                                        "Indian/Comoro",
                                        "Indian/Kerguelen",
                                        "Indian/Mahe",
                                        "Indian/Maldives",
                                        "Indian/Mauritius",
                                        "Indian/Mayotte",
                                        "Indian/Reunion",
                                        "Pacific/Apia",
                                        "Pacific/Auckland",
                                        "Pacific/Bougainville",
                                        "Pacific/Chatham",
                                        "Pacific/Chuuk",
                                        "Pacific/Easter",
                                        "Pacific/Efate",
                                        "Pacific/Fakaofo",
                                        "Pacific/Fiji",
                                        "Pacific/Funafuti",
                                        "Pacific/Galapagos",
                                        "Pacific/Gambier",
                                        "Pacific/Guadalcanal",
                                        "Pacific/Guam",
                                        "Pacific/Honolulu",
                                        "Pacific/Kanton",
                                        "Pacific/Kiritimati",
                                        "Pacific/Kosrae",
                                        "Pacific/Kwajalein",
                                        "Pacific/Majuro",
                                        "Pacific/Marquesas",
                                        "Pacific/Midway",
                                        "Pacific/Nauru",
                                        "Pacific/Niue",
                                        "Pacific/Norfolk",
                                        "Pacific/Noumea",
                                        "Pacific/Pago_Pago",
                                        "Pacific/Palau",
                                        "Pacific/Pitcairn",
                                        "Pacific/Pohnpei",
                                        "Pacific/Port_Moresby",
                                        "Pacific/Rarotonga",
                                        "Pacific/Saipan",
                                        "Pacific/Tahiti",
                                        "Pacific/Tarawa",
                                        "Pacific/Tongatapu",
                                        "Pacific/Wake",
                                        "Pacific/Wallis",
                                        "UTC"
                                    ]
                                },
                                "tags": {
                                    "type": [
                                        "array",
                                        "null"
                                    ],
                                    "description": "Organizational tags (content-board filter labels) — a list of non-empty strings.",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "accounts": {
                                    "type": "array",
                                    "description": "Targets: a connected-account id OR a `platform@username` string; resolved per-row.",
                                    "items": {
                                        "type": "string"
                                    },
                                    "minItems": 1
                                },
                                "media": {
                                    "type": [
                                        "array",
                                        "null"
                                    ],
                                    "description": "Media: a MediaAsset id OR a public https URL; capped at the flat per-row media ceiling.",
                                    "items": {
                                        "type": "string"
                                    },
                                    "maxItems": 10
                                }
                            },
                            "required": [
                                "accounts"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 100
                    }
                },
                "required": [
                    "posts"
                ],
                "title": "CreateBulkPostsRequest"
            },
            "CreatePostRequest": {
                "type": "object",
                "description": "The Public API's create-a-post body (#119). It is the integrator-friendly shape over the\nSAME publish pipeline the in-app composer uses: a shared `caption` + one or more target\n`accounts`, optionally scheduled. Each account becomes a {@see ComposedTarget} the\npipeline re-validates server-side — so the API inherits the never-over-publish guarantee\n(a blocked target is skipped, an all-blocked submission is refused) for free.\n\nOnly the request SHAPE is validated here; the DOMAIN gate (length, banned words, network\nfit) lives in {@see BuildPostFromComposer}. Per-account caption overrides are supported so\nan advanced integration can tailor copy per network without losing the single-call ergonomics.",
                "properties": {
                    "caption": {
                        "type": "string",
                        "description": "The default content shared by every target unless a target overrides it."
                    },
                    "kind": {
                        "$ref": "#/components/schemas/PostKind"
                    },
                    "scheduled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Publish-now omits both; a scheduled post sends either a full ISO-8601\ninstant (offset-bearing) or a NAIVE wall-clock paired with the zone below."
                    },
                    "display_timezone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "Africa/Abidjan",
                            "Africa/Accra",
                            "Africa/Addis_Ababa",
                            "Africa/Algiers",
                            "Africa/Asmara",
                            "Africa/Bamako",
                            "Africa/Bangui",
                            "Africa/Banjul",
                            "Africa/Bissau",
                            "Africa/Blantyre",
                            "Africa/Brazzaville",
                            "Africa/Bujumbura",
                            "Africa/Cairo",
                            "Africa/Casablanca",
                            "Africa/Ceuta",
                            "Africa/Conakry",
                            "Africa/Dakar",
                            "Africa/Dar_es_Salaam",
                            "Africa/Djibouti",
                            "Africa/Douala",
                            "Africa/El_Aaiun",
                            "Africa/Freetown",
                            "Africa/Gaborone",
                            "Africa/Harare",
                            "Africa/Johannesburg",
                            "Africa/Juba",
                            "Africa/Kampala",
                            "Africa/Khartoum",
                            "Africa/Kigali",
                            "Africa/Kinshasa",
                            "Africa/Lagos",
                            "Africa/Libreville",
                            "Africa/Lome",
                            "Africa/Luanda",
                            "Africa/Lubumbashi",
                            "Africa/Lusaka",
                            "Africa/Malabo",
                            "Africa/Maputo",
                            "Africa/Maseru",
                            "Africa/Mbabane",
                            "Africa/Mogadishu",
                            "Africa/Monrovia",
                            "Africa/Nairobi",
                            "Africa/Ndjamena",
                            "Africa/Niamey",
                            "Africa/Nouakchott",
                            "Africa/Ouagadougou",
                            "Africa/Porto-Novo",
                            "Africa/Sao_Tome",
                            "Africa/Tripoli",
                            "Africa/Tunis",
                            "Africa/Windhoek",
                            "America/Adak",
                            "America/Anchorage",
                            "America/Anguilla",
                            "America/Antigua",
                            "America/Araguaina",
                            "America/Argentina/Buenos_Aires",
                            "America/Argentina/Catamarca",
                            "America/Argentina/Cordoba",
                            "America/Argentina/Jujuy",
                            "America/Argentina/La_Rioja",
                            "America/Argentina/Mendoza",
                            "America/Argentina/Rio_Gallegos",
                            "America/Argentina/Salta",
                            "America/Argentina/San_Juan",
                            "America/Argentina/San_Luis",
                            "America/Argentina/Tucuman",
                            "America/Argentina/Ushuaia",
                            "America/Aruba",
                            "America/Asuncion",
                            "America/Atikokan",
                            "America/Bahia",
                            "America/Bahia_Banderas",
                            "America/Barbados",
                            "America/Belem",
                            "America/Belize",
                            "America/Blanc-Sablon",
                            "America/Boa_Vista",
                            "America/Bogota",
                            "America/Boise",
                            "America/Cambridge_Bay",
                            "America/Campo_Grande",
                            "America/Cancun",
                            "America/Caracas",
                            "America/Cayenne",
                            "America/Cayman",
                            "America/Chicago",
                            "America/Chihuahua",
                            "America/Ciudad_Juarez",
                            "America/Costa_Rica",
                            "America/Coyhaique",
                            "America/Creston",
                            "America/Cuiaba",
                            "America/Curacao",
                            "America/Danmarkshavn",
                            "America/Dawson",
                            "America/Dawson_Creek",
                            "America/Denver",
                            "America/Detroit",
                            "America/Dominica",
                            "America/Edmonton",
                            "America/Eirunepe",
                            "America/El_Salvador",
                            "America/Fort_Nelson",
                            "America/Fortaleza",
                            "America/Glace_Bay",
                            "America/Goose_Bay",
                            "America/Grand_Turk",
                            "America/Grenada",
                            "America/Guadeloupe",
                            "America/Guatemala",
                            "America/Guayaquil",
                            "America/Guyana",
                            "America/Halifax",
                            "America/Havana",
                            "America/Hermosillo",
                            "America/Indiana/Indianapolis",
                            "America/Indiana/Knox",
                            "America/Indiana/Marengo",
                            "America/Indiana/Petersburg",
                            "America/Indiana/Tell_City",
                            "America/Indiana/Vevay",
                            "America/Indiana/Vincennes",
                            "America/Indiana/Winamac",
                            "America/Inuvik",
                            "America/Iqaluit",
                            "America/Jamaica",
                            "America/Juneau",
                            "America/Kentucky/Louisville",
                            "America/Kentucky/Monticello",
                            "America/Kralendijk",
                            "America/La_Paz",
                            "America/Lima",
                            "America/Los_Angeles",
                            "America/Lower_Princes",
                            "America/Maceio",
                            "America/Managua",
                            "America/Manaus",
                            "America/Marigot",
                            "America/Martinique",
                            "America/Matamoros",
                            "America/Mazatlan",
                            "America/Menominee",
                            "America/Merida",
                            "America/Metlakatla",
                            "America/Mexico_City",
                            "America/Miquelon",
                            "America/Moncton",
                            "America/Monterrey",
                            "America/Montevideo",
                            "America/Montserrat",
                            "America/Nassau",
                            "America/New_York",
                            "America/Nome",
                            "America/Noronha",
                            "America/North_Dakota/Beulah",
                            "America/North_Dakota/Center",
                            "America/North_Dakota/New_Salem",
                            "America/Nuuk",
                            "America/Ojinaga",
                            "America/Panama",
                            "America/Paramaribo",
                            "America/Phoenix",
                            "America/Port-au-Prince",
                            "America/Port_of_Spain",
                            "America/Porto_Velho",
                            "America/Puerto_Rico",
                            "America/Punta_Arenas",
                            "America/Rankin_Inlet",
                            "America/Recife",
                            "America/Regina",
                            "America/Resolute",
                            "America/Rio_Branco",
                            "America/Santarem",
                            "America/Santiago",
                            "America/Santo_Domingo",
                            "America/Sao_Paulo",
                            "America/Scoresbysund",
                            "America/Sitka",
                            "America/St_Barthelemy",
                            "America/St_Johns",
                            "America/St_Kitts",
                            "America/St_Lucia",
                            "America/St_Thomas",
                            "America/St_Vincent",
                            "America/Swift_Current",
                            "America/Tegucigalpa",
                            "America/Thule",
                            "America/Tijuana",
                            "America/Toronto",
                            "America/Tortola",
                            "America/Vancouver",
                            "America/Whitehorse",
                            "America/Winnipeg",
                            "America/Yakutat",
                            "Antarctica/Casey",
                            "Antarctica/Davis",
                            "Antarctica/DumontDUrville",
                            "Antarctica/Macquarie",
                            "Antarctica/Mawson",
                            "Antarctica/McMurdo",
                            "Antarctica/Palmer",
                            "Antarctica/Rothera",
                            "Antarctica/Syowa",
                            "Antarctica/Troll",
                            "Antarctica/Vostok",
                            "Arctic/Longyearbyen",
                            "Asia/Aden",
                            "Asia/Almaty",
                            "Asia/Amman",
                            "Asia/Anadyr",
                            "Asia/Aqtau",
                            "Asia/Aqtobe",
                            "Asia/Ashgabat",
                            "Asia/Atyrau",
                            "Asia/Baghdad",
                            "Asia/Bahrain",
                            "Asia/Baku",
                            "Asia/Bangkok",
                            "Asia/Barnaul",
                            "Asia/Beirut",
                            "Asia/Bishkek",
                            "Asia/Brunei",
                            "Asia/Chita",
                            "Asia/Colombo",
                            "Asia/Damascus",
                            "Asia/Dhaka",
                            "Asia/Dili",
                            "Asia/Dubai",
                            "Asia/Dushanbe",
                            "Asia/Famagusta",
                            "Asia/Gaza",
                            "Asia/Hebron",
                            "Asia/Ho_Chi_Minh",
                            "Asia/Hong_Kong",
                            "Asia/Hovd",
                            "Asia/Irkutsk",
                            "Asia/Jakarta",
                            "Asia/Jayapura",
                            "Asia/Jerusalem",
                            "Asia/Kabul",
                            "Asia/Kamchatka",
                            "Asia/Karachi",
                            "Asia/Kathmandu",
                            "Asia/Khandyga",
                            "Asia/Kolkata",
                            "Asia/Krasnoyarsk",
                            "Asia/Kuala_Lumpur",
                            "Asia/Kuching",
                            "Asia/Kuwait",
                            "Asia/Macau",
                            "Asia/Magadan",
                            "Asia/Makassar",
                            "Asia/Manila",
                            "Asia/Muscat",
                            "Asia/Nicosia",
                            "Asia/Novokuznetsk",
                            "Asia/Novosibirsk",
                            "Asia/Omsk",
                            "Asia/Oral",
                            "Asia/Phnom_Penh",
                            "Asia/Pontianak",
                            "Asia/Pyongyang",
                            "Asia/Qatar",
                            "Asia/Qostanay",
                            "Asia/Qyzylorda",
                            "Asia/Riyadh",
                            "Asia/Sakhalin",
                            "Asia/Samarkand",
                            "Asia/Seoul",
                            "Asia/Shanghai",
                            "Asia/Singapore",
                            "Asia/Srednekolymsk",
                            "Asia/Taipei",
                            "Asia/Tashkent",
                            "Asia/Tbilisi",
                            "Asia/Tehran",
                            "Asia/Thimphu",
                            "Asia/Tokyo",
                            "Asia/Tomsk",
                            "Asia/Ulaanbaatar",
                            "Asia/Urumqi",
                            "Asia/Ust-Nera",
                            "Asia/Vientiane",
                            "Asia/Vladivostok",
                            "Asia/Yakutsk",
                            "Asia/Yangon",
                            "Asia/Yekaterinburg",
                            "Asia/Yerevan",
                            "Atlantic/Azores",
                            "Atlantic/Bermuda",
                            "Atlantic/Canary",
                            "Atlantic/Cape_Verde",
                            "Atlantic/Faroe",
                            "Atlantic/Madeira",
                            "Atlantic/Reykjavik",
                            "Atlantic/South_Georgia",
                            "Atlantic/St_Helena",
                            "Atlantic/Stanley",
                            "Australia/Adelaide",
                            "Australia/Brisbane",
                            "Australia/Broken_Hill",
                            "Australia/Darwin",
                            "Australia/Eucla",
                            "Australia/Hobart",
                            "Australia/Lindeman",
                            "Australia/Lord_Howe",
                            "Australia/Melbourne",
                            "Australia/Perth",
                            "Australia/Sydney",
                            "Europe/Amsterdam",
                            "Europe/Andorra",
                            "Europe/Astrakhan",
                            "Europe/Athens",
                            "Europe/Belgrade",
                            "Europe/Berlin",
                            "Europe/Bratislava",
                            "Europe/Brussels",
                            "Europe/Bucharest",
                            "Europe/Budapest",
                            "Europe/Busingen",
                            "Europe/Chisinau",
                            "Europe/Copenhagen",
                            "Europe/Dublin",
                            "Europe/Gibraltar",
                            "Europe/Guernsey",
                            "Europe/Helsinki",
                            "Europe/Isle_of_Man",
                            "Europe/Istanbul",
                            "Europe/Jersey",
                            "Europe/Kaliningrad",
                            "Europe/Kirov",
                            "Europe/Kyiv",
                            "Europe/Lisbon",
                            "Europe/Ljubljana",
                            "Europe/London",
                            "Europe/Luxembourg",
                            "Europe/Madrid",
                            "Europe/Malta",
                            "Europe/Mariehamn",
                            "Europe/Minsk",
                            "Europe/Monaco",
                            "Europe/Moscow",
                            "Europe/Oslo",
                            "Europe/Paris",
                            "Europe/Podgorica",
                            "Europe/Prague",
                            "Europe/Riga",
                            "Europe/Rome",
                            "Europe/Samara",
                            "Europe/San_Marino",
                            "Europe/Sarajevo",
                            "Europe/Saratov",
                            "Europe/Simferopol",
                            "Europe/Skopje",
                            "Europe/Sofia",
                            "Europe/Stockholm",
                            "Europe/Tallinn",
                            "Europe/Tirane",
                            "Europe/Ulyanovsk",
                            "Europe/Vaduz",
                            "Europe/Vatican",
                            "Europe/Vienna",
                            "Europe/Vilnius",
                            "Europe/Volgograd",
                            "Europe/Warsaw",
                            "Europe/Zagreb",
                            "Europe/Zurich",
                            "Indian/Antananarivo",
                            "Indian/Chagos",
                            "Indian/Christmas",
                            "Indian/Cocos",
                            "Indian/Comoro",
                            "Indian/Kerguelen",
                            "Indian/Mahe",
                            "Indian/Maldives",
                            "Indian/Mauritius",
                            "Indian/Mayotte",
                            "Indian/Reunion",
                            "Pacific/Apia",
                            "Pacific/Auckland",
                            "Pacific/Bougainville",
                            "Pacific/Chatham",
                            "Pacific/Chuuk",
                            "Pacific/Easter",
                            "Pacific/Efate",
                            "Pacific/Fakaofo",
                            "Pacific/Fiji",
                            "Pacific/Funafuti",
                            "Pacific/Galapagos",
                            "Pacific/Gambier",
                            "Pacific/Guadalcanal",
                            "Pacific/Guam",
                            "Pacific/Honolulu",
                            "Pacific/Kanton",
                            "Pacific/Kiritimati",
                            "Pacific/Kosrae",
                            "Pacific/Kwajalein",
                            "Pacific/Majuro",
                            "Pacific/Marquesas",
                            "Pacific/Midway",
                            "Pacific/Nauru",
                            "Pacific/Niue",
                            "Pacific/Norfolk",
                            "Pacific/Noumea",
                            "Pacific/Pago_Pago",
                            "Pacific/Palau",
                            "Pacific/Pitcairn",
                            "Pacific/Pohnpei",
                            "Pacific/Port_Moresby",
                            "Pacific/Rarotonga",
                            "Pacific/Saipan",
                            "Pacific/Tahiti",
                            "Pacific/Tarawa",
                            "Pacific/Tongatapu",
                            "Pacific/Wake",
                            "Pacific/Wallis",
                            "UTC"
                        ]
                    },
                    "accounts": {
                        "type": "array",
                        "description": "One target per account id. Rule::exists is a RAW query that bypasses the\nmodel's global TenantScope, so the team_id is pinned to the authenticated\ntoken's tenant — a cross-tenant account id is rejected (the isolation gate).",
                        "items": {
                            "type": "object",
                            "properties": {
                                "account_id": {
                                    "type": "integer"
                                },
                                "caption": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "description": "Optional per-account caption override (falls back to the shared caption)."
                                }
                            },
                            "required": [
                                "account_id"
                            ]
                        },
                        "minItems": 1
                    }
                },
                "required": [
                    "caption",
                    "accounts"
                ],
                "title": "CreatePostRequest"
            },
            "PostKind": {
                "type": "string",
                "description": "The polymorphic content kinds a post can render as (plan §5.2). A canonical post is an intent; each network's {@see CapabilityProfile} declares which of these kinds it supports, and each driver resolves the intent into the platform's native shape (a carousel on IG, a multi-image post on LinkedIn, a native thread on X/Bluesky/Threads).\n",
                "enum": [
                    "text",
                    "photo",
                    "carousel",
                    "video",
                    "reel",
                    "story",
                    "thread",
                    "poll",
                    "link",
                    "article"
                ],
                "title": "PostKind"
            },
            "PostResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "scheduled_at": {
                        "type": "string"
                    },
                    "display_timezone": {
                        "type": "string"
                    },
                    "segments": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "position": {
                                    "type": "integer"
                                },
                                "body": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "link_url": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "position",
                                "body",
                                "link_url"
                            ]
                        }
                    },
                    "targets": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/PostTargetResource"
                        }
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "status",
                    "scheduled_at",
                    "display_timezone",
                    "created_at",
                    "updated_at"
                ],
                "title": "PostResource"
            },
            "PostTargetResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "social_account_id": {
                        "type": "integer"
                    },
                    "platform": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "provider_post_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "failure_category": {
                        "type": "string"
                    },
                    "failure_message": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "published_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "social_account_id",
                    "platform",
                    "status",
                    "provider_post_id",
                    "failure_category",
                    "failure_message",
                    "published_at"
                ],
                "title": "PostTargetResource"
            },
            "SaveWebhookEndpointRequest": {
                "type": "object",
                "description": "Create/update body for a webhook subscription (#119). The URL must be a valid, PUBLIC HTTPS URL\n— plaintext callbacks are rejected (a signed payload still warrants transport security) and a\n{@see SafeWebhookUrl} guard rejects internal/loopback/metadata targets (SSRF). Every event must\nbe a known {@see WebhookEvent}; an empty event list means \"subscribe to all\".",
                "properties": {
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048
                    },
                    "is_active": {
                        "type": [
                            "boolean",
                            "null"
                        ]
                    },
                    "events": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "$ref": "#/components/schemas/WebhookEvent"
                        }
                    }
                },
                "required": [
                    "url"
                ],
                "title": "SaveWebhookEndpointRequest"
            },
            "WebhookEndpointResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "url": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "items": {}
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "deactivated_at": {
                        "type": "string"
                    },
                    "deactivated_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_success_at": {
                        "type": "string"
                    },
                    "last_failure_at": {
                        "type": "string"
                    },
                    "consecutive_failures": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "url",
                    "events",
                    "is_active",
                    "deactivated_at",
                    "deactivated_reason",
                    "last_success_at",
                    "last_failure_at",
                    "consecutive_failures",
                    "created_at"
                ],
                "title": "WebhookEndpointResource"
            },
            "WebhookEvent": {
                "type": "string",
                "description": "The catalog of outbound webhook event types an integrator can subscribe to (#119). Each maps a Frosko domain event onto a stable, public wire name an external system depends on. Adding a new outbound event is one case here + one listener that builds its payload — the dispatcher, signing, retry and delivery-log machinery are event-agnostic.\n| |\n|---|\n| `post.published` <br/> A post target reached a confirmed `published` outcome (from PublishOutcomeRecorded). |\n| `post.failed` <br/> A post target settled into a terminal `failed` / `needs_action` outcome. |\n| `account.desynced` <br/> A connected account lost platform access (from AccountDesynced). |",
                "enum": [
                    "post.published",
                    "post.failed",
                    "account.desynced"
                ],
                "title": "WebhookEvent"
            }
        }
    },
    "webhooks": {
        "postPublished": {
            "post": {
                "summary": "post.published",
                "description": "Sent when a post target reaches a confirmed `published` outcome. Signed with the subscription secret via the `X-Frosko-Signature: t=<unix>,v1=<hmac>` header (HMAC-SHA256 over `<timestamp>.<body>`).",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "example": "post.published"
                                    },
                                    "occurred_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "data": {
                                        "type": "object",
                                        "properties": {
                                            "post_id": {
                                                "type": "integer"
                                            },
                                            "target_id": {
                                                "type": "integer"
                                            },
                                            "social_account_id": {
                                                "type": "integer"
                                            },
                                            "status": {
                                                "type": "string"
                                            },
                                            "provider_post_id": {
                                                "type": "string",
                                                "nullable": true
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Acknowledged."
                    }
                }
            }
        },
        "postFailed": {
            "post": {
                "summary": "post.failed",
                "description": "Sent when a post target settles into a terminal `failed` / `needs_action` outcome. Same signature header as `post.published`.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "example": "post.failed"
                                    },
                                    "occurred_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "data": {
                                        "type": "object",
                                        "properties": {
                                            "post_id": {
                                                "type": "integer"
                                            },
                                            "target_id": {
                                                "type": "integer"
                                            },
                                            "social_account_id": {
                                                "type": "integer"
                                            },
                                            "status": {
                                                "type": "string"
                                            },
                                            "failure_category": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "failure_message": {
                                                "type": "string",
                                                "nullable": true
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Acknowledged."
                    }
                }
            }
        },
        "accountDesynced": {
            "post": {
                "summary": "account.desynced",
                "description": "Sent when a connected account loses platform access and needs to be reconnected. Same signature header as `post.published`.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "example": "account.desynced"
                                    },
                                    "occurred_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "data": {
                                        "type": "object",
                                        "properties": {
                                            "social_account_id": {
                                                "type": "integer"
                                            },
                                            "reason": {
                                                "type": "string"
                                            },
                                            "health": {
                                                "type": "string"
                                            },
                                            "requires_reconnect": {
                                                "type": "boolean"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Acknowledged."
                    }
                }
            }
        }
    }
}
