{
  "openapi": "3.1.1",
  "info": {
    "title": "Postinger API",
    "description": "Schedule and publish posts, upload media and read analytics for one workspace. Authenticate with an API key from API Keys in the app: Authorization: Bearer pst_live_…",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.postinger.dev",
      "description": "Production"
    }
  ],
  "paths": {
    "/v1/accounts": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List accounts",
        "description": "The workspace's connected social accounts: where posts can go. Use an account's id as socialAccountId. One with status \"needs_reauth\" has to be reconnected in the app first. Needs accounts:read.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SocialAccountResponse"
                  }
                },
                "example": [
                  {
                    "id": "0192f0c1-5a4e-7b3d-9c2f-1e8a6d4b7f20",
                    "platform": "instagram",
                    "externalId": "17841400000000000",
                    "handle": "acme",
                    "displayName": "Acme",
                    "avatarUrl": null,
                    "status": "active",
                    "tokenExpiresAt": null,
                    "connectedAt": "2026-09-14T08:30:00+00:00"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/analytics": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Account statistics",
        "description": "Each account's totals and days in the period, with the period before for comparison. from and to are instants (ISO 8601 with an offset): the period starts at from and stops before to. accounts: some of the workspace's; all when left out. Needs analytics:read.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "When the period starts: ISO 8601 with an offset. At most a year before to.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "When it ends, not included: ISO 8601 with an offset.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "accounts",
            "in": "query",
            "description": "Only these accounts; repeat the parameter for more. Missing: all.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsOverviewResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/posts": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Best posts",
        "description": "Posts published in the period, best first by sort (views when left out). A post that went to two accounts can appear twice. Needs analytics:read.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "When the period starts: ISO 8601 with an offset. At most a year before to.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "When it ends, not included: ISO 8601 with an offset.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "accounts",
            "in": "query",
            "description": "Only these accounts; repeat the parameter for more. Missing: all.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "enum": [
                "views",
                "reach",
                "likes",
                "comments",
                "shares",
                "saves",
                "engagements",
                "avgWatchSeconds"
              ],
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many: 1 to 50, 10 by default.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopPostsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/posts/{postId}": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Post statistics",
        "description": "One post's numbers on each account it went to, and how they grew. Needs analytics:read.",
        "parameters": [
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostAnalyticsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Workspace"
        ],
        "summary": "Get the current key",
        "description": "The workspace and the key the request is made with, and the workspace's time zone: the clock schedule times are on. Works with any key, whatever its scopes.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                },
                "example": {
                  "workspace": {
                    "id": "0192e7d0-4c3b-7a2e-9f1d-8b5a6c0e3d17",
                    "name": "Acme",
                    "timeZone": "Europe/Istanbul"
                  },
                  "apiKey": {
                    "id": "0192e7d3-1f2a-7c4b-8d5e-6a9b0c3d2e11",
                    "name": "Website",
                    "scopes": [
                      "accounts:read",
                      "posts:read",
                      "posts:write"
                    ],
                    "expiresAt": null
                  }
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Workspace"
        ],
        "summary": "Revoke the current key",
        "description": "Revokes the key the request is made with, from the next request on. How the CLI logs out.",
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/v1/media": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Start an upload",
        "description": "Reserves a file in the library and answers where to PUT its bytes: upload.url for the whole file, or upload.parts, each upload.partSize bytes. Then complete it. JPEG or PNG up to 8 MB, MP4 or MOV up to 1 GB. Width, height and duration are yours to measure; the platforms' rules are checked against them. Needs media:write.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Send the same key again to retry without doing it twice: the first answer comes back. Up to 255 characters, kept for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartUploadBody"
              },
              "example": {
                "fileName": "autumn.jpg",
                "contentType": "image/jpeg",
                "size": 482133,
                "width": 1080,
                "height": 1350,
                "durationSeconds": null
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StartUploadBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StartUploadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartUploadResponse"
                },
                "example": {
                  "media": {
                    "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                    "kind": "image",
                    "status": "uploading",
                    "contentType": "image/jpeg",
                    "fileName": "autumn.jpg",
                    "size": 482133,
                    "width": 1080,
                    "height": 1350,
                    "durationSeconds": null,
                    "url": null,
                    "posterUrl": null,
                    "createdAt": "2026-10-28T10:00:00+00:00"
                  },
                  "upload": {
                    "url": "https://storage.postinger.dev/…?X-Amz-Signature=…",
                    "headers": {
                      "Content-Type": "image/jpeg"
                    },
                    "partSize": null,
                    "parts": null
                  },
                  "poster": null,
                  "expiresAt": "2026-10-28T11:00:00+00:00"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/from-url": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Add media from a link",
        "description": "Postinger fetches the file from a public https link: the file itself, not a page showing it. Ready when this answers. Needs media:write.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Send the same key again to retry without doing it twice: the first answer comes back. Up to 255 characters, kept for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadFromUrlBody"
              },
              "example": {
                "url": "https://example.com/autumn.jpg",
                "fileName": "autumn.jpg"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadFromUrlBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UploadFromUrlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaResponse"
                },
                "example": {
                  "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                  "kind": "image",
                  "status": "ready",
                  "contentType": "image/jpeg",
                  "fileName": "autumn.jpg",
                  "size": 482133,
                  "width": 1080,
                  "height": 1350,
                  "durationSeconds": null,
                  "url": "https://media.postinger.dev/…/autumn.jpg",
                  "posterUrl": null,
                  "createdAt": "2026-10-28T10:00:00+00:00"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/{mediaId}/complete": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Complete an upload",
        "description": "Checks what arrived in storage and makes the file ready to attach. Safe to call again. Needs media:write.",
        "parameters": [
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Send the same key again to retry without doing it twice: the first answer comes back. Up to 255 characters, kept for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaResponse"
                },
                "example": {
                  "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                  "kind": "image",
                  "status": "ready",
                  "contentType": "image/jpeg",
                  "fileName": "autumn.jpg",
                  "size": 482133,
                  "width": 1080,
                  "height": 1350,
                  "durationSeconds": null,
                  "url": "https://media.postinger.dev/…/autumn.jpg",
                  "posterUrl": null,
                  "createdAt": "2026-10-28T10:00:00+00:00"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/{mediaId}": {
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "Get media",
        "description": "A file in the library: its kind, size and whether it is ready to attach. Needs media:read.",
        "parameters": [
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaResponse"
                },
                "example": {
                  "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                  "kind": "image",
                  "status": "ready",
                  "contentType": "image/jpeg",
                  "fileName": "autumn.jpg",
                  "size": 482133,
                  "width": 1080,
                  "height": 1350,
                  "durationSeconds": null,
                  "url": "https://media.postinger.dev/…/autumn.jpg",
                  "posterUrl": null,
                  "createdAt": "2026-10-28T10:00:00+00:00"
                }
              }
            }
          }
        }
      }
    },
    "/v1/posts": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "List posts",
        "description": "The workspace's posts, newest first, a page at a time. Filters combine: ?status=scheduled&platform=tiktok&q=launch. Pass nextCursor as cursor for the next page. Needs posts:read.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Only posts with this status.",
            "schema": {
              "enum": [
                "draft",
                "scheduled",
                "publishing",
                "published",
                "partial",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "description": "Only posts to this platform.",
            "schema": {
              "enum": [
                "instagram",
                "facebook",
                "youtube",
                "tiktok"
              ],
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Only posts whose text contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "nextCursor from the previous page. Keep the filters the same.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Posts per page: 1 to 100, 20 by default.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostPageResponse"
                },
                "example": {
                  "items": [
                    {
                      "id": "0193a5a0-2b1c-7d4e-8f3a-5c6b9e0d1a24",
                      "status": "scheduled",
                      "content": "Our autumn collection is here 🍂",
                      "scheduledAt": "2026-11-01T06:00:00+00:00",
                      "scheduledAtLocal": "2026-11-01T09:00",
                      "timeZone": "Europe/Istanbul",
                      "publishedAt": null,
                      "editable": true,
                      "version": 1,
                      "author": null,
                      "apiKey": {
                        "id": "0192e7d3-1f2a-7c4b-8d5e-6a9b0c3d2e11",
                        "name": "Website"
                      },
                      "targets": [
                        {
                          "socialAccountId": "0192f0c1-5a4e-7b3d-9c2f-1e8a6d4b7f20",
                          "platform": "instagram",
                          "content": null,
                          "options": {
                            "format": "feed",
                            "shareToFeed": true
                          },
                          "status": "pending",
                          "externalPostId": null,
                          "externalUrl": null,
                          "error": null,
                          "errorCode": null,
                          "waitReason": null,
                          "nextAttemptAt": null,
                          "attempts": 0,
                          "publishedAt": null,
                          "account": {
                            "handle": "acme",
                            "displayName": "Acme",
                            "avatarUrl": null,
                            "isActive": true
                          }
                        }
                      ],
                      "media": [
                        {
                          "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                          "kind": "image",
                          "status": "ready",
                          "contentType": "image/jpeg",
                          "fileName": "autumn.jpg",
                          "size": 482133,
                          "width": 1080,
                          "height": 1350,
                          "durationSeconds": null,
                          "url": "https://media.postinger.dev/…/autumn.jpg",
                          "posterUrl": null,
                          "createdAt": "2026-10-28T10:00:00+00:00"
                        }
                      ],
                      "createdAt": "2026-10-28T10:00:00+00:00",
                      "updatedAt": "2026-10-28T10:00:00+00:00"
                    }
                  ],
                  "nextCursor": null
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Create a post",
        "description": "A draft (schedule.mode \"draft\", or no schedule), published now (\"now\") or later (\"at\"). schedule.at is on the workspace's clock as YYYY-MM-DDTHH:mm; GET /v1/me says which. A scheduled post must pass each platform's rules. Send an Idempotency-Key to retry safely. Needs posts:write.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Send the same key again to retry without doing it twice: the first answer comes back. Up to 255 characters, kept for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostBody"
              },
              "example": {
                "content": "Our autumn collection is here 🍂",
                "targets": [
                  {
                    "socialAccountId": "0192f0c1-5a4e-7b3d-9c2f-1e8a6d4b7f20",
                    "content": null,
                    "options": {
                      "format": "feed"
                    }
                  }
                ],
                "schedule": {
                  "mode": "at",
                  "at": "2026-11-01T09:00"
                },
                "mediaIds": [
                  "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18"
                ],
                "version": null
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PostBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PostBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                },
                "example": {
                  "id": "0193a5a0-2b1c-7d4e-8f3a-5c6b9e0d1a24",
                  "status": "scheduled",
                  "content": "Our autumn collection is here 🍂",
                  "scheduledAt": "2026-11-01T06:00:00+00:00",
                  "scheduledAtLocal": "2026-11-01T09:00",
                  "timeZone": "Europe/Istanbul",
                  "publishedAt": null,
                  "editable": true,
                  "version": 1,
                  "author": null,
                  "apiKey": {
                    "id": "0192e7d3-1f2a-7c4b-8d5e-6a9b0c3d2e11",
                    "name": "Website"
                  },
                  "targets": [
                    {
                      "socialAccountId": "0192f0c1-5a4e-7b3d-9c2f-1e8a6d4b7f20",
                      "platform": "instagram",
                      "content": null,
                      "options": {
                        "format": "feed",
                        "shareToFeed": true
                      },
                      "status": "pending",
                      "externalPostId": null,
                      "externalUrl": null,
                      "error": null,
                      "errorCode": null,
                      "waitReason": null,
                      "nextAttemptAt": null,
                      "attempts": 0,
                      "publishedAt": null,
                      "account": {
                        "handle": "acme",
                        "displayName": "Acme",
                        "avatarUrl": null,
                        "isActive": true
                      }
                    }
                  ],
                  "media": [
                    {
                      "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                      "kind": "image",
                      "status": "ready",
                      "contentType": "image/jpeg",
                      "fileName": "autumn.jpg",
                      "size": 482133,
                      "width": 1080,
                      "height": 1350,
                      "durationSeconds": null,
                      "url": "https://media.postinger.dev/…/autumn.jpg",
                      "posterUrl": null,
                      "createdAt": "2026-10-28T10:00:00+00:00"
                    }
                  ],
                  "createdAt": "2026-10-28T10:00:00+00:00",
                  "updatedAt": "2026-10-28T10:00:00+00:00"
                }
              }
            }
          }
        }
      }
    },
    "/v1/posts/{postId}": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Get a post",
        "description": "One post, with each target's status: published (with its link), failed (with why) or waiting. Needs posts:read.",
        "parameters": [
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                },
                "example": {
                  "id": "0193a5a0-2b1c-7d4e-8f3a-5c6b9e0d1a24",
                  "status": "scheduled",
                  "content": "Our autumn collection is here 🍂",
                  "scheduledAt": "2026-11-01T06:00:00+00:00",
                  "scheduledAtLocal": "2026-11-01T09:00",
                  "timeZone": "Europe/Istanbul",
                  "publishedAt": null,
                  "editable": true,
                  "version": 1,
                  "author": null,
                  "apiKey": {
                    "id": "0192e7d3-1f2a-7c4b-8d5e-6a9b0c3d2e11",
                    "name": "Website"
                  },
                  "targets": [
                    {
                      "socialAccountId": "0192f0c1-5a4e-7b3d-9c2f-1e8a6d4b7f20",
                      "platform": "instagram",
                      "content": null,
                      "options": {
                        "format": "feed",
                        "shareToFeed": true
                      },
                      "status": "pending",
                      "externalPostId": null,
                      "externalUrl": null,
                      "error": null,
                      "errorCode": null,
                      "waitReason": null,
                      "nextAttemptAt": null,
                      "attempts": 0,
                      "publishedAt": null,
                      "account": {
                        "handle": "acme",
                        "displayName": "Acme",
                        "avatarUrl": null,
                        "isActive": true
                      }
                    }
                  ],
                  "media": [
                    {
                      "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                      "kind": "image",
                      "status": "ready",
                      "contentType": "image/jpeg",
                      "fileName": "autumn.jpg",
                      "size": 482133,
                      "width": 1080,
                      "height": 1350,
                      "durationSeconds": null,
                      "url": "https://media.postinger.dev/…/autumn.jpg",
                      "posterUrl": null,
                      "createdAt": "2026-10-28T10:00:00+00:00"
                    }
                  ],
                  "createdAt": "2026-10-28T10:00:00+00:00",
                  "updatedAt": "2026-10-28T10:00:00+00:00"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Posts"
        ],
        "summary": "Replace a post",
        "description": "Replaces a draft, scheduled or failed post entirely: send all of it, as for create. Also how a post is rescheduled or turned back into a draft. Send the version you read to get 409 rather than overwrite someone else's change. Needs posts:write.",
        "parameters": [
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostBody"
              },
              "example": {
                "content": "Our autumn collection is here 🍂",
                "targets": [
                  {
                    "socialAccountId": "0192f0c1-5a4e-7b3d-9c2f-1e8a6d4b7f20",
                    "content": null,
                    "options": {
                      "format": "feed"
                    }
                  }
                ],
                "schedule": {
                  "mode": "at",
                  "at": "2026-11-01T09:00"
                },
                "mediaIds": [
                  "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18"
                ],
                "version": 1
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PostBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PostBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                },
                "example": {
                  "id": "0193a5a0-2b1c-7d4e-8f3a-5c6b9e0d1a24",
                  "status": "scheduled",
                  "content": "Our autumn collection is here 🍂",
                  "scheduledAt": "2026-11-01T06:00:00+00:00",
                  "scheduledAtLocal": "2026-11-01T09:00",
                  "timeZone": "Europe/Istanbul",
                  "publishedAt": null,
                  "editable": true,
                  "version": 2,
                  "author": null,
                  "apiKey": {
                    "id": "0192e7d3-1f2a-7c4b-8d5e-6a9b0c3d2e11",
                    "name": "Website"
                  },
                  "targets": [
                    {
                      "socialAccountId": "0192f0c1-5a4e-7b3d-9c2f-1e8a6d4b7f20",
                      "platform": "instagram",
                      "content": null,
                      "options": {
                        "format": "feed",
                        "shareToFeed": true
                      },
                      "status": "pending",
                      "externalPostId": null,
                      "externalUrl": null,
                      "error": null,
                      "errorCode": null,
                      "waitReason": null,
                      "nextAttemptAt": null,
                      "attempts": 0,
                      "publishedAt": null,
                      "account": {
                        "handle": "acme",
                        "displayName": "Acme",
                        "avatarUrl": null,
                        "isActive": true
                      }
                    }
                  ],
                  "media": [
                    {
                      "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                      "kind": "image",
                      "status": "ready",
                      "contentType": "image/jpeg",
                      "fileName": "autumn.jpg",
                      "size": 482133,
                      "width": 1080,
                      "height": 1350,
                      "durationSeconds": null,
                      "url": "https://media.postinger.dev/…/autumn.jpg",
                      "posterUrl": null,
                      "createdAt": "2026-10-28T10:00:00+00:00"
                    }
                  ],
                  "createdAt": "2026-10-28T10:00:00+00:00",
                  "updatedAt": "2026-10-28T10:00:00+00:00"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Posts"
        ],
        "summary": "Delete a post",
        "description": "Deletes a post from Postinger. What was already published stays on the platforms. Needs posts:delete.",
        "parameters": [
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/v1/posts/{postId}/retry": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Retry a post",
        "description": "Publishes a failed or partly published post's failed targets again, now; what already went out is not sent twice. Send socialAccountId to retry only that one. Needs posts:write.",
        "parameters": [
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Send the same key again to retry without doing it twice: the first answer comes back. Up to 255 characters, kept for 24 hours.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RetryBody"
                  }
                ]
              },
              "example": {
                "socialAccountId": null,
                "version": 1
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RetryBody"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RetryBody"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                },
                "example": {
                  "id": "0193a5a0-2b1c-7d4e-8f3a-5c6b9e0d1a24",
                  "status": "scheduled",
                  "content": "Our autumn collection is here 🍂",
                  "scheduledAt": "2026-11-01T06:00:00+00:00",
                  "scheduledAtLocal": "2026-11-01T09:00",
                  "timeZone": "Europe/Istanbul",
                  "publishedAt": null,
                  "editable": true,
                  "version": 1,
                  "author": null,
                  "apiKey": {
                    "id": "0192e7d3-1f2a-7c4b-8d5e-6a9b0c3d2e11",
                    "name": "Website"
                  },
                  "targets": [
                    {
                      "socialAccountId": "0192f0c1-5a4e-7b3d-9c2f-1e8a6d4b7f20",
                      "platform": "instagram",
                      "content": null,
                      "options": {
                        "format": "feed",
                        "shareToFeed": true
                      },
                      "status": "pending",
                      "externalPostId": null,
                      "externalUrl": null,
                      "error": null,
                      "errorCode": null,
                      "waitReason": null,
                      "nextAttemptAt": null,
                      "attempts": 0,
                      "publishedAt": null,
                      "account": {
                        "handle": "acme",
                        "displayName": "Acme",
                        "avatarUrl": null,
                        "isActive": true
                      }
                    }
                  ],
                  "media": [
                    {
                      "id": "0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18",
                      "kind": "image",
                      "status": "ready",
                      "contentType": "image/jpeg",
                      "fileName": "autumn.jpg",
                      "size": 482133,
                      "width": 1080,
                      "height": 1350,
                      "durationSeconds": null,
                      "url": "https://media.postinger.dev/…/autumn.jpg",
                      "posterUrl": null,
                      "createdAt": "2026-10-28T10:00:00+00:00"
                    }
                  ],
                  "createdAt": "2026-10-28T10:00:00+00:00",
                  "updatedAt": "2026-10-28T10:00:00+00:00"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccountAnalyticsResponse": {
        "required": [
          "id",
          "platform",
          "handle",
          "displayName",
          "avatarUrl",
          "isActive",
          "sync",
          "totals",
          "days"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "enum": [
              "instagram",
              "facebook",
              "youtube",
              "tiktok"
            ],
            "type": "string"
          },
          "handle": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "sync": {
            "$ref": "#/components/schemas/AccountSyncResponse"
          },
          "totals": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/MetricTotal"
            }
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountDayResponse"
            }
          }
        }
      },
      "AccountDayResponse": {
        "required": [
          "start",
          "followers",
          "posts",
          "views",
          "reach",
          "engagements",
          "likes",
          "comments",
          "shares",
          "saves",
          "followersGained",
          "followersLost",
          "watchMinutes"
        ],
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "followers": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "posts": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "views": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "reach": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "engagements": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "likes": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "comments": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "shares": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "saves": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "followersGained": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "followersLost": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "watchMinutes": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "AccountSyncResponse": {
        "required": [
          "status",
          "lastSyncedAt",
          "error",
          "errorCode"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "errorCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AnalyticsOverviewResponse": {
        "required": [
          "from",
          "to",
          "previousFrom",
          "totals",
          "accounts"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "previousFrom": {
            "type": "string",
            "format": "date-time"
          },
          "totals": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/MetricTotal"
            }
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountAnalyticsResponse"
            }
          }
        }
      },
      "JsonElement": { },
      "JsonObject": {
        "type": "object"
      },
      "MediaResponse": {
        "required": [
          "id",
          "kind",
          "status",
          "contentType",
          "fileName",
          "size",
          "width",
          "height",
          "durationSeconds",
          "url",
          "posterUrl",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "enum": [
              "image",
              "video"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "uploading",
              "ready"
            ],
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "width": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "height": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "durationSeconds": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "posterUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MeKeyResponse": {
        "required": [
          "id",
          "name",
          "scopes",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "MeResponse": {
        "required": [
          "workspace",
          "apiKey"
        ],
        "type": "object",
        "properties": {
          "workspace": {
            "$ref": "#/components/schemas/MeWorkspaceResponse"
          },
          "apiKey": {
            "$ref": "#/components/schemas/MeKeyResponse"
          }
        }
      },
      "MetricTotal": {
        "required": [
          "value",
          "previous",
          "accounts"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "previous": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "accounts": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "MeWorkspaceResponse": {
        "required": [
          "id",
          "name",
          "timeZone"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "timeZone": {
            "type": "string",
            "description": "The clock schedule.at is read on, as an IANA time zone."
          }
        }
      },
      "PostAccountResponse": {
        "required": [
          "handle",
          "displayName",
          "avatarUrl",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "handle": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "PostAnalyticsResponse": {
        "required": [
          "postId",
          "targets"
        ],
        "type": "object",
        "properties": {
          "postId": {
            "type": "string",
            "format": "uuid"
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostTargetAnalyticsResponse"
            }
          }
        }
      },
      "PostApiKeyResponse": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "PostAuthorResponse": {
        "required": [
          "id",
          "firstName",
          "lastName",
          "imageUrl"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "imageUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PostBody": {
        "required": [
          "content",
          "targets",
          "schedule"
        ],
        "type": "object",
        "properties": {
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "The text, for every target without its own."
          },
          "targets": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TargetBody"
            },
            "description": "Where it goes: one entry per account."
          },
          "schedule": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "When it goes out. Missing: a draft.",
                "$ref": "#/components/schemas/ScheduleBody"
              }
            ]
          },
          "mediaIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Ready media from the library, in order. At most 10."
          },
          "version": {
            "type": [
              "null",
              "integer"
            ],
            "description": "PUT only: the version you read. A post changed since answers 409 instead of being overwritten. Missing: last write wins.",
            "format": "uint32"
          }
        }
      },
      "PostPageResponse": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostResponse"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Pass it as cursor for the next page. Null: this was the last."
          }
        }
      },
      "PostResponse": {
        "required": [
          "id",
          "status",
          "content",
          "scheduledAt",
          "scheduledAtLocal",
          "timeZone",
          "publishedAt",
          "editable",
          "version",
          "author",
          "apiKey",
          "targets",
          "media",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "enum": [
              "draft",
              "scheduled",
              "publishing",
              "published",
              "partial",
              "failed"
            ],
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "scheduledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "scheduledAtLocal": {
            "type": [
              "null",
              "string"
            ],
            "description": "scheduledAt on the workspace's clock."
          },
          "timeZone": {
            "type": "string"
          },
          "publishedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "editable": {
            "type": "boolean",
            "description": "Whether it can still be changed: not once published."
          },
          "version": {
            "type": "integer",
            "description": "Send it back with PUT or retry to detect changes made since.",
            "format": "uint32"
          },
          "author": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PostAuthorResponse"
              }
            ]
          },
          "apiKey": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PostApiKeyResponse"
              }
            ]
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostTargetResponse"
            }
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaResponse"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PostSnapshotResponse": {
        "required": [
          "takenAt",
          "metrics"
        ],
        "type": "object",
        "properties": {
          "takenAt": {
            "type": "string",
            "format": "date-time"
          },
          "metrics": {
            "$ref": "#/components/schemas/PostValuesResponse"
          }
        }
      },
      "PostTargetAnalyticsResponse": {
        "required": [
          "socialAccountId",
          "platform",
          "format",
          "publishedAt",
          "externalUrl",
          "state",
          "lastSyncedAt",
          "nextSyncAt",
          "error",
          "metrics",
          "snapshots"
        ],
        "type": "object",
        "properties": {
          "socialAccountId": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "enum": [
              "instagram",
              "facebook",
              "youtube",
              "tiktok"
            ],
            "type": "string"
          },
          "format": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "externalUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "enum": [
              "active",
              "done",
              "unavailable",
              "gone"
            ],
            "type": "string"
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "nextSyncAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "metrics": {
            "$ref": "#/components/schemas/PostValuesResponse"
          },
          "snapshots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostSnapshotResponse"
            }
          }
        }
      },
      "PostTargetResponse": {
        "required": [
          "socialAccountId",
          "platform",
          "content",
          "options",
          "status",
          "externalPostId",
          "externalUrl",
          "error",
          "errorCode",
          "waitReason",
          "nextAttemptAt",
          "attempts",
          "publishedAt",
          "account"
        ],
        "type": "object",
        "properties": {
          "socialAccountId": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "enum": [
              "instagram",
              "facebook",
              "youtube",
              "tiktok"
            ],
            "type": "string"
          },
          "content": {
            "type": [
              "null",
              "string"
            ]
          },
          "options": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "status": {
            "enum": [
              "pending",
              "publishing",
              "processing",
              "published",
              "failed"
            ],
            "type": "string"
          },
          "externalPostId": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "errorCode": {
            "enum": [
              "reconnect_required",
              "not_publishable",
              "rejected",
              "outcome_unknown",
              "processing_timeout",
              "rate_limited",
              "platform_error",
              "interrupted",
              "deleted",
              "payment_required",
              null
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "waitReason": {
            "enum": [
              "retrying",
              "rate_limited",
              null
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "nextAttemptAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "attempts": {
            "type": "integer",
            "format": "int32"
          },
          "publishedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "account": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PostAccountResponse"
              }
            ]
          }
        }
      },
      "PostValuesResponse": {
        "required": [
          "views",
          "reach",
          "likes",
          "comments",
          "shares",
          "saves",
          "engagements",
          "avgWatchSeconds"
        ],
        "type": "object",
        "properties": {
          "views": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "reach": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "likes": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "comments": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "shares": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "saves": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "engagements": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "avgWatchSeconds": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "RetryBody": {
        "required": [
          "socialAccountId",
          "version"
        ],
        "type": "object",
        "properties": {
          "socialAccountId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Only this account. Null: every failed one.",
            "format": "uuid"
          },
          "version": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The version you read. A post changed since answers 409.",
            "format": "uint32"
          }
        }
      },
      "ScheduleBody": {
        "required": [
          "mode",
          "at"
        ],
        "type": "object",
        "properties": {
          "mode": {
            "enum": [
              "draft",
              "now",
              "at",
              null
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "draft (the default), now, or at."
          },
          "at": {
            "type": [
              "null",
              "string"
            ],
            "description": "For at: when, on the workspace's clock, as YYYY-MM-DDTHH:mm without an offset. GET /v1/me says which clock. For draft, optional: the time it is planned for; nothing publishes it."
          }
        }
      },
      "SocialAccountResponse": {
        "required": [
          "id",
          "platform",
          "externalId",
          "handle",
          "displayName",
          "avatarUrl",
          "status",
          "tokenExpiresAt",
          "connectedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "enum": [
              "instagram",
              "facebook",
              "youtube",
              "tiktok"
            ],
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "handle": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "enum": [
              "active",
              "needs_reauth",
              "disconnected"
            ],
            "type": "string"
          },
          "tokenExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "connectedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StartUploadBody": {
        "required": [
          "fileName",
          "contentType",
          "size",
          "width",
          "height",
          "durationSeconds"
        ],
        "type": "object",
        "properties": {
          "fileName": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name shown in the library."
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ],
            "description": "image/jpeg, image/png, video/mp4 or video/quicktime."
          },
          "size": {
            "type": [
              "null",
              "integer"
            ],
            "description": "In bytes: images up to 8 MB, videos up to 1 GB.",
            "format": "int64"
          },
          "width": {
            "type": [
              "null",
              "integer"
            ],
            "description": "In pixels, when known. The platforms' rules check it.",
            "format": "int32"
          },
          "height": {
            "type": [
              "null",
              "integer"
            ],
            "description": "In pixels, when known. The platforms' rules check it.",
            "format": "int32"
          },
          "durationSeconds": {
            "type": [
              "null",
              "number"
            ],
            "description": "Videos: the length in seconds. TikTok and YouTube check it.",
            "format": "double"
          }
        }
      },
      "StartUploadResponse": {
        "required": [
          "media",
          "upload",
          "poster",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "media": {
            "$ref": "#/components/schemas/MediaResponse"
          },
          "upload": {
            "$ref": "#/components/schemas/UploadInstructions"
          },
          "poster": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Videos: where a JPEG frame for the thumbnail may go. Optional.",
                "$ref": "#/components/schemas/UploadInstructions"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TargetBody": {
        "required": [
          "socialAccountId",
          "content",
          "options"
        ],
        "type": "object",
        "properties": {
          "socialAccountId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The account's id, from GET /v1/accounts.",
            "format": "uuid"
          },
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "This account's own text. Null: the post's."
          },
          "options": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The platform's options, such as format or privacy. Null: the defaults.",
                "$ref": "#/components/schemas/JsonObject"
              }
            ]
          }
        }
      },
      "TopPostResponse": {
        "required": [
          "postId",
          "socialAccountId",
          "platform",
          "format",
          "publishedAt",
          "externalUrl",
          "content",
          "thumbnailUrl",
          "metrics",
          "lastSyncedAt"
        ],
        "type": "object",
        "properties": {
          "postId": {
            "type": "string",
            "format": "uuid"
          },
          "socialAccountId": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "enum": [
              "instagram",
              "facebook",
              "youtube",
              "tiktok"
            ],
            "type": "string"
          },
          "format": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "externalUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "metrics": {
            "$ref": "#/components/schemas/PostValuesResponse"
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "TopPostsResponse": {
        "required": [
          "posts"
        ],
        "type": "object",
        "properties": {
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TopPostResponse"
            }
          }
        }
      },
      "UploadFromUrlBody": {
        "required": [
          "url",
          "fileName"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ],
            "description": "A public link to the file itself, not a page showing it."
          },
          "fileName": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name shown in the library. Null: the link's own."
          }
        }
      },
      "UploadInstructions": {
        "required": [
          "url",
          "headers",
          "partSize",
          "parts"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ],
            "description": "Where to PUT the whole file, with headers. Null: upload in parts."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Headers to send with the PUT. Never add your API key."
          },
          "partSize": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The bytes in each part; the last may be smaller.",
            "format": "int32"
          },
          "parts": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UploadPart"
            },
            "description": "Where to PUT each part, in partNumber order. Null: one PUT to url."
          }
        }
      },
      "UploadPart": {
        "required": [
          "partNumber",
          "url"
        ],
        "type": "object",
        "properties": {
          "partNumber": {
            "type": "integer",
            "format": "int32"
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "description": "A workspace API key (pst_live_…).",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "apiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Accounts"
    },
    {
      "name": "Analytics"
    },
    {
      "name": "Workspace"
    },
    {
      "name": "Media"
    },
    {
      "name": "Posts"
    }
  ]
}