{
  "openapi": "3.1.0",
  "info": {
    "title": "Faryen API",
    "version": "2026-11-14",
    "description": "Workspace-scoped API for Studio and Agency. Uses the existing Faryen publishing queue. Social account authorization is interactive in Faryen. See the guides for media, permissions and provider-specific limits.",
    "contact": {
      "email": "office@faryen.com"
    }
  },
  "servers": [
    {
      "url": "https://app.faryen.com/api"
    }
  ],
  "paths": {
    "/v1/workspaces": {
      "get": {
        "operationId": "list_workspaces",
        "summary": "list workspaces",
        "description": "List the workspace authorized for this connection.",
        "x-required-scope": "workspaces:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Workspace"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/accounts": {
      "get": {
        "operationId": "list_accounts",
        "summary": "list accounts",
        "description": "Read connected account identities, formats and comment support.",
        "x-required-scope": "accounts:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Continue from next_cursor."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Account"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/posts": {
      "get": {
        "operationId": "list_posts",
        "summary": "list posts",
        "description": "List posts in the authorized workspace with cursor pagination.",
        "x-required-scope": "posts:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Continue from next_cursor."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PostSummary"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create_draft",
        "summary": "create draft",
        "description": "Create an unpublished draft. This never publishes a post.",
        "x-required-scope": "posts:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "post_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional client-generated post ID."
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 10000
                  },
                  "media_paths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 20
                  },
                  "targets": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "account_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Connected account ID."
                        },
                        "post_format": {
                          "type": "string",
                          "description": "A format supported by this account."
                        },
                        "comment_plan": {
                          "type": "array",
                          "maxItems": 10,
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Unique comment ID."
                              },
                              "text": {
                                "type": "string",
                                "maxLength": 2000
                              },
                              "delay_minutes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10080
                              }
                            },
                            "required": [
                              "id",
                              "text",
                              "delay_minutes"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "caption_override": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 10000
                        },
                        "media_paths_override": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "pinterest_options": {
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "youtube_options": {
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "tiktok_options": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "account_id",
                        "post_format",
                        "comment_plan"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "content"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/posts/{post_id}": {
      "get": {
        "operationId": "get_post",
        "summary": "get post",
        "description": "Read the current post revision, plan, destination outcomes and follow-up comments.",
        "x-required-scope": "posts:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The post ID."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "update_draft",
        "summary": "update draft",
        "description": "Replace the content and destination plan of an existing draft. Read it first; omitted media and targets become empty.",
        "x-required-scope": "posts:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The post ID."
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "The revision read and reviewed before this action."
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 10000
                  },
                  "media_paths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 20
                  },
                  "targets": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "account_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Connected account ID."
                        },
                        "post_format": {
                          "type": "string",
                          "description": "A format supported by this account."
                        },
                        "comment_plan": {
                          "type": "array",
                          "maxItems": 10,
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Unique comment ID."
                              },
                              "text": {
                                "type": "string",
                                "maxLength": 2000
                              },
                              "delay_minutes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10080
                              }
                            },
                            "required": [
                              "id",
                              "text",
                              "delay_minutes"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "caption_override": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 10000
                        },
                        "media_paths_override": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "pinterest_options": {
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "youtube_options": {
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "tiktok_options": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "account_id",
                        "post_format",
                        "comment_plan"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "expected_revision",
                  "content"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_post",
        "summary": "delete post",
        "description": "Remove an unpublished Faryen post. This does not delete remote social posts.",
        "x-required-scope": "posts:delete",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The post ID."
            }
          },
          {
            "name": "expected_revision",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "The revision read and reviewed before this action."
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deleted"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/posts/{post_id}/schedule": {
      "post": {
        "operationId": "schedule_post",
        "summary": "schedule post",
        "description": "Queue the reviewed draft at a future RFC 3339 instant. Obtain user approval of the content, accounts and time first.",
        "x-required-scope": "posts:schedule",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The post ID."
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "The revision read and reviewed before this action."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "A future instant with explicit UTC offset."
                  }
                },
                "required": [
                  "expected_revision",
                  "scheduled_at"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/posts/{post_id}/publish": {
      "post": {
        "operationId": "publish_post",
        "summary": "publish post",
        "description": "Queue the reviewed draft for publication now. Obtain user approval of the exact content and accounts first. A queue acknowledgement is not a publication receipt.",
        "x-required-scope": "posts:publish",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The post ID."
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "The revision read and reviewed before this action."
                  }
                },
                "required": [
                  "expected_revision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/posts/{post_id}/cancel": {
      "post": {
        "operationId": "cancel_schedule",
        "summary": "cancel schedule",
        "description": "Return a scheduled, unstarted post to a draft.",
        "x-required-scope": "posts:schedule",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The post ID."
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "The revision read and reviewed before this action."
                  }
                },
                "required": [
                  "expected_revision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/analytics": {
      "get": {
        "operationId": "get_analytics",
        "summary": "get analytics",
        "description": "Read stored daily analytics in an inclusive date range. Missing values remain null. Does not start a provider sync.",
        "x-required-scope": "analytics:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The authorized workspace ID."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The analytics next_cursor."
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Optional account filter."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DailyAnalytics"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/media/uploads": {
      "post": {
        "operationId": "create_upload",
        "summary": "create upload",
        "description": "Reserve subscriber storage and obtain a private upload URL. A 50 MB reservation counts until completion or cleanup.",
        "x-required-scope": "media:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "post_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "filename": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "content_type": {
                    "type": "string",
                    "enum": [
                      "image/jpeg",
                      "image/png",
                      "video/mp4"
                    ]
                  },
                  "size": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 52428800
                  }
                },
                "required": [
                  "post_id",
                  "filename",
                  "content_type",
                  "size"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Upload"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/media/complete": {
      "post": {
        "operationId": "complete_upload",
        "summary": "complete upload",
        "description": "Confirm the private object and run the same media metadata inspection used by the app.",
        "x-required-scope": "media:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "post_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "path": {
                    "type": "string"
                  }
                },
                "required": [
                  "post_id",
                  "path"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CompletedUpload"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/webhooks": {
      "get": {
        "operationId": "list_webhooks",
        "summary": "list webhooks",
        "description": "List this workspace’s webhook subscriptions. Signing secrets are never returned.",
        "x-required-scope": "webhooks:manage",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create_webhook",
        "summary": "create webhook",
        "description": "Create a webhook for a public HTTPS receiver. Save the signing secret on the first successful response; retries omit it.",
        "x-required-scope": "webhooks:manage",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "type": "array",
                    "uniqueItems": true,
                    "minItems": 1,
                    "maxItems": 6,
                    "items": {
                      "type": "string",
                      "enum": [
                        "destination.published",
                        "destination.failed",
                        "destination.unverified",
                        "comment.published",
                        "comment.failed",
                        "comment.unverified"
                      ]
                    }
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/webhooks/{webhook_id}": {
      "delete": {
        "operationId": "delete_webhook",
        "summary": "delete webhook",
        "description": "Revoke a webhook and cancel undelivered events.",
        "x-required-scope": "webhooks:manage",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._:-]{8,128}$"
            },
            "description": "Retained for 30 days. Identical retries return the original action result; a changed request returns 409. Webhook signing secrets and newly minted upload URLs have the exceptions documented in their guides."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deleted"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspace_id}/webhooks/{webhook_id}/deliveries": {
      "get": {
        "operationId": "list_deliveries",
        "summary": "list deliveries",
        "description": "Read delivery status, attempt count and last HTTP status. Does not expose signing secrets or response bodies.",
        "x-required-scope": "webhooks:manage",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Read the destination status to confirm publication.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Delivery"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry."
              }
            }
          },
          "503": {
            "description": "Stable error code, safe message and request ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Faryen API key",
        "description": "Create a workspace-scoped key in Faryen Settings → API & AI connections."
      }
    },
    "schemas": {
      "Workspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "timezone"
        ]
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "connected",
              "needs_reconnect"
            ]
          },
          "disconnected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pinterest_board_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "pinterest_board_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "formats": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "comment_formats": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "interactive_publication_required": {
                "type": "boolean"
              }
            },
            "required": [
              "formats",
              "comment_formats",
              "interactive_publication_required"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "platform",
          "display_name",
          "state",
          "capabilities"
        ]
      },
      "PostSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid"
          },
          "content": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "publishing",
              "published",
              "failed",
              "unverified"
            ]
          },
          "scheduled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "workspace_id",
          "content",
          "status",
          "revision"
        ]
      },
      "Post": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid"
          },
          "content": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "publishing",
              "published",
              "failed",
              "unverified"
            ]
          },
          "scheduled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "media_paths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "destinations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Destination"
            }
          }
        },
        "required": [
          "id",
          "workspace_id",
          "content",
          "status",
          "revision",
          "media_paths",
          "destinations"
        ]
      },
      "Destination": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "post_format": {
            "type": "string"
          },
          "caption_override": {
            "type": [
              "string",
              "null"
            ]
          },
          "media_paths_override": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "comment_plan": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "delay_minutes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10080
                }
              },
              "required": [
                "id",
                "text",
                "delay_minutes"
              ]
            }
          },
          "pinterest_options": {
            "type": [
              "object",
              "null"
            ]
          },
          "youtube_options": {
            "type": [
              "object",
              "null"
            ]
          },
          "tiktok_options": {
            "type": [
              "object",
              "null"
            ]
          },
          "external_post_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "comments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "due_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "status",
                "text"
              ]
            }
          }
        },
        "required": [
          "id",
          "account_id",
          "status",
          "post_format",
          "comments"
        ]
      },
      "DailyAnalytics": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "day": {
            "type": "string",
            "format": "date"
          },
          "views": {
            "type": [
              "integer",
              "null"
            ]
          },
          "followers": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reach": {
            "type": [
              "integer",
              "null"
            ]
          },
          "engagements": {
            "type": [
              "integer",
              "null"
            ]
          },
          "impressions": {
            "type": [
              "integer",
              "null"
            ]
          },
          "link_clicks": {
            "type": [
              "integer",
              "null"
            ]
          },
          "synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "account_id",
          "day"
        ]
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "description": "Returned only on the first creation response."
          }
        },
        "required": [
          "id",
          "url",
          "events"
        ]
      },
      "Delivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_type": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "last_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "event_id",
          "event_type",
          "state",
          "attempts"
        ]
      },
      "Upload": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "post_id": {
            "type": "string",
            "format": "uuid"
          },
          "max_bytes": {
            "type": "integer"
          },
          "exists": {
            "type": "boolean"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "expires_in": {
            "type": "integer"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          }
        },
        "required": [
          "path",
          "post_id",
          "max_bytes"
        ]
      },
      "CompletedUpload": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "post_id": {
            "type": "string",
            "format": "uuid"
          },
          "media": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Inspected media metadata including MIME, size, dimensions and applicable duration/codecs."
            }
          }
        },
        "required": [
          "path",
          "post_id",
          "media"
        ]
      },
      "Deleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "deleted"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "request_id"
        ]
      }
    }
  },
  "x-scopes": {
    "workspaces:read": "View workspace details",
    "accounts:read": "View connected accounts",
    "posts:read": "Read posts and delivery results",
    "posts:write": "Create and edit drafts",
    "posts:schedule": "Schedule posts and cancel schedules",
    "posts:publish": "Publish posts",
    "posts:delete": "Delete unpublished posts",
    "media:write": "Upload post media",
    "analytics:read": "Read available analytics",
    "webhooks:manage": "Manage webhook destinations"
  }
}
