{"openapi":"3.1.0","info":{"title":"PostMyReels API","version":"1.0.0","description":"Post video, photos and text to TikTok, Instagram and YouTube. Test keys (pmr_test_) simulate everything and post nothing. Error codes: https://docs.postmyreels.com/errors"},"servers":[{"url":"https://api.postmyreels.com/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"System"},{"name":"Profiles"},{"name":"Accounts"},{"name":"Connect links"},{"name":"Media"},{"name":"Posts"},{"name":"Analytics"},{"name":"Webhooks"}],"paths":{"/health":{"get":{"tags":["System"],"summary":"Liveness check (no auth)","operationId":"get_health","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"version":{"type":"string"},"time":{"type":"string","format":"date-time"}}}}}}}}},"/me":{"get":{"tags":["System"],"summary":"Workspace, plan and usage behind the key","operationId":"get_me","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/profiles":{"get":{"tags":["Profiles"],"summary":"List profiles","operationId":"get_profiles","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Page of profiles","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Profile"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"post":{"tags":["Profiles"],"summary":"Create a profile","operationId":"post_profiles","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":80},"slug":{"type":"string"},"metadata":{"type":"object"},"branding":{"type":"object"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"plan_limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"slug_taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/profiles/{id}":{"get":{"tags":["Profiles"],"summary":"Get a profile (id or slug)","operationId":"get_profiles_id","parameters":[{"name":"id","in":"path","required":true,"description":"prof_... or slug","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"patch":{"tags":["Profiles"],"summary":"Update a profile","operationId":"patch_profiles_id","parameters":[{"name":"id","in":"path","required":true,"description":"prof_... or slug","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"metadata":{"type":"object"},"branding":{"type":"object"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"delete":{"tags":["Profiles"],"summary":"Delete a profile (?dry_run=true previews)","operationId":"delete_profiles_id","parameters":[{"name":"id","in":"path","required":true,"description":"prof_... or slug","schema":{"type":"string"}},{"name":"dry_run","in":"query","schema":{"type":"boolean"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/profiles/{id}/accounts":{"get":{"tags":["Accounts"],"summary":"List a profile's connected accounts","operationId":"get_profiles_id_accounts","parameters":[{"name":"id","in":"path","required":true,"description":"prof_... or slug","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Account"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/accounts/{id}":{"delete":{"tags":["Accounts"],"summary":"Disconnect an account and revoke its tokens","operationId":"delete_accounts_id","parameters":[{"name":"id","in":"path","required":true,"description":"acct_...","schema":{"type":"string"}}],"responses":{"204":{"description":"Disconnected"},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/profiles/{id}/connect-links":{"post":{"tags":["Connect links"],"summary":"Create a hosted (white-label) connect link","operationId":"post_profiles_id_connect_links","parameters":[{"name":"id","in":"path","required":true,"description":"prof_... or slug","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platforms":{"type":"array","items":{"$ref":"#/components/schemas/Platform"}},"redirect_url":{"type":"string","format":"uri"},"branding":{"type":"object"},"expires_in":{"type":"integer","minimum":300,"maximum":2592000,"default":172800},"reusable":{"type":"boolean","default":true}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLink"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"get":{"tags":["Connect links"],"summary":"List active connect links","operationId":"get_profiles_id_connect_links","parameters":[{"name":"id","in":"path","required":true,"description":"prof_... or slug","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConnectLink"}}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/connect-links/{id}":{"delete":{"tags":["Connect links"],"summary":"Revoke a connect link","operationId":"delete_connect_links_id","parameters":[{"name":"id","in":"path","required":true,"description":"cl_...","schema":{"type":"string"}}],"responses":{"204":{"description":"Revoked"},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/media/uploads":{"post":{"tags":["Media"],"summary":"Start a presigned R2 multipart upload","operationId":"post_media_uploads","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","content_type","size"],"properties":{"filename":{"type":"string"},"content_type":{"type":"string","enum":["video/mp4","video/quicktime","image/jpeg","image/png","image/webp"]},"size":{"type":"integer"}}}}}},"responses":{"200":{"description":"Upload parts","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"media_too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/media/uploads/{id}/complete":{"post":{"tags":["Media"],"summary":"Complete a multipart upload","operationId":"post_media_uploads_id_complete","parameters":[{"name":"id","in":"path","required":true,"description":"up_...","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","properties":{"part_number":{"type":"integer"},"etag":{"type":"string"}}}}}}}}},"responses":{"201":{"description":"Media","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/media/{id}":{"get":{"tags":["Media"],"summary":"Get a media object","operationId":"get_media_id","parameters":[{"name":"id","in":"path","required":true,"description":"med_...","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/posts":{"post":{"tags":["Posts"],"summary":"Create a post (JSON or multipart)","operationId":"post_posts","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreate"}},"multipart/form-data":{"schema":{"type":"object","description":"Upload-Post style: user, platform[], title, video, photos[] ..."}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostAccepted"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"get":{"tags":["Posts"],"summary":"List posts","operationId":"get_posts","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"profile","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string"}},{"name":"to","in":"query","schema":{"type":"string"}},{"name":"external_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/posts/{id}":{"get":{"tags":["Posts"],"summary":"Get a post with its deliveries","operationId":"get_posts_id","parameters":[{"name":"id","in":"path","required":true,"description":"post_...","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"delete":{"tags":["Posts"],"summary":"Cancel a scheduled or queued post","operationId":"delete_posts_id","parameters":[{"name":"id","in":"path","required":true,"description":"post_...","schema":{"type":"string"}}],"responses":{"200":{"description":"Canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"invalid_state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/posts/{id}/retry":{"post":{"tags":["Posts"],"summary":"Retry failed, retryable deliveries","operationId":"post_posts_id_retry","parameters":[{"name":"id","in":"path","required":true,"description":"post_...","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"invalid_state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/uploadposts/status":{"get":{"tags":["Posts"],"summary":"Upload-Post compat status alias","operationId":"get_uploadposts_status","parameters":[{"name":"request_id","in":"query","schema":{"type":"string"}},{"name":"job_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/posts/{id}/stats":{"get":{"tags":["Analytics"],"summary":"Numbers per delivery of a post (?refresh=1 reads the platforms live)","operationId":"get_posts_id_stats","parameters":[{"name":"id","in":"path","required":true,"description":"post_...","schema":{"type":"string"}},{"name":"refresh","in":"query","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string"},"history_days":{"type":"integer"},"note":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PostMetrics"}}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/analytics/overview":{"get":{"tags":["Analytics"],"summary":"Cross-platform totals, per-platform split, accounts, daily series, top posts","operationId":"get_analytics_overview","parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":730,"default":7}},{"name":"profile","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsOverview"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"plan_limit_reached (days beyond the plan's history)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/analytics/posts":{"get":{"tags":["Analytics"],"summary":"Post-level numbers","operationId":"get_analytics_posts","parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":730,"default":7}},{"name":"profile","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["views","engagement","recent"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PostMetrics"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/analytics/best-times":{"get":{"tags":["Analytics"],"summary":"Best times to post from the account's own history (Creator+), else queue slots","operationId":"get_analytics_best_times","parameters":[{"name":"tz","in":"query","schema":{"type":"string"}},{"name":"profile","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"integer","minimum":1,"maximum":10}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BestTimes"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/analytics/export.csv":{"get":{"tags":["Analytics"],"summary":"Post-level numbers as CSV","operationId":"get_analytics_export_csv","parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":730,"default":7}},{"name":"profile","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/webhooks":{"post":{"tags":["Webhooks"],"summary":"Create a webhook; the secret is returned once","operationId":"post_webhooks","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","description":"HTTPS only"},"events":{"type":"array","items":{"type":"string"},"description":"Event names or [\"*\"]"},"description":{"type":"string"},"profile":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid url or events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"get":{"tags":["Webhooks"],"summary":"List webhooks","operationId":"get_webhooks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/webhooks/{id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook","operationId":"get_webhooks_id","parameters":[{"name":"id","in":"path","required":true,"description":"wh_...","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"patch":{"tags":["Webhooks"],"summary":"Update url, events, description or re-enable (status=active)","operationId":"patch_webhooks_id","parameters":[{"name":"id","in":"path","required":true,"description":"wh_...","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","operationId":"delete_webhooks_id","parameters":[{"name":"id","in":"path","required":true,"description":"wh_...","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a webhook.test event to this endpoint","operationId":"post_webhooks_id_test","parameters":[{"name":"id","in":"path","required":true,"description":"wh_...","schema":{"type":"string"}}],"responses":{"202":{"description":"Queued"},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Deliveries log","operationId":"get_webhooks_id_deliveries","parameters":[{"name":"id","in":"path","required":true,"description":"wh_...","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","delivered","failed"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}},"/webhooks/{id}/deliveries/{delivery_id}/redeliver":{"post":{"tags":["Webhooks"],"summary":"Re-send the same payload with a fresh signature","operationId":"post_webhooks_id_deliveries_delivery_id_redeliver","parameters":[{"name":"id","in":"path","required":true,"description":"wh_...","schema":{"type":"string"}},{"name":"delivery_id","in":"path","required":true,"description":"whd_...","schema":{"type":"string"}}],"responses":{"202":{"description":"Queued"},"401":{"description":"invalid_api_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (see Retry-After)"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"pmr_live_... or pmr_test_...  (Authorization: Apikey <key> is accepted too)"}},"schemas":{"Platform":{"type":"string","enum":["tiktok","instagram","youtube","facebook","threads"]},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"fix":{"type":"string"},"docs_url":{"type":"string"},"request_id":{"type":"string"}}}}},"Me":{"type":"object","properties":{"workspace":{"type":"object"},"key":{"type":"object"},"plan":{"type":"object"},"usage":{"type":"object"}}},"Profile":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"metadata":{"type":"object"},"branding":{"type":["object","null"]},"accounts_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}},"Account":{"type":"object","properties":{"id":{"type":"string"},"profile_id":{"type":"string"},"platform":{"$ref":"#/components/schemas/Platform"},"handle":{"type":"string"},"display_name":{"type":"string"},"health":{"type":"string","enum":["connected","expiring","expired","disconnected"]},"expires_at":{"type":["string","null"]},"last_error_code":{"type":["string","null"]}}},"ConnectLink":{"type":"object","properties":{"id":{"type":"string"},"profile_id":{"type":"string"},"url":{"type":"string"},"platforms":{"type":"array","items":{"$ref":"#/components/schemas/Platform"}},"expires_at":{"type":"string","format":"date-time"}}},"Media":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"filename":{"type":"string"},"size":{"type":"integer"},"duration_s":{"type":"number"},"width":{"type":"integer"},"height":{"type":"integer"},"ratio":{"type":"string"},"status":{"type":"string","enum":["ready","invalid"]}}},"PostCreate":{"type":"object","required":["profile","platform"],"properties":{"profile":{"type":"string"},"platform":{"type":"array","items":{"$ref":"#/components/schemas/Platform"}},"accounts":{"type":"array","items":{"type":"string"}},"media":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"media_id":{"type":"string"}}}},"title":{"type":"string"},"caption":{"type":"string"},"scheduled_at":{"type":"string","format":"date-time"},"timezone":{"type":"string"},"first_comment":{"type":"string"},"external_id":{"type":"string","maxLength":255},"add_to_queue":{"type":"boolean"},"tiktok":{"type":"object"},"instagram":{"type":"object"},"youtube":{"type":"object"},"facebook":{"type":"object","description":"description, title, media_type (REELS | VIDEO)"},"threads":{"type":"object","description":"text (up to 500 characters)"}}},"Delivery":{"type":"object","properties":{"id":{"type":"string"},"platform":{"$ref":"#/components/schemas/Platform"},"account_id":{"type":"string"},"status":{"type":"string","enum":["queued","uploading","processing","published","failed","canceled","skipped"]},"platform_post_id":{"type":["string","null"]},"url":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]}}},"PostAccepted":{"type":"object","properties":{"request_id":{"type":"string"},"post_id":{"type":"string"},"status":{"type":"string"},"scheduled_at":{"type":["string","null"]},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}},"warnings":{"type":"array","items":{"type":"string"}}}},"Post":{"type":"object","properties":{"id":{"type":"string"},"profile_id":{"type":"string"},"status":{"type":"string","enum":["scheduled","queued","in_progress","published","partial","failed","canceled"]},"external_id":{"type":["string","null"]},"completed":{"type":"integer"},"total":{"type":"integer"},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":["string","null"]},"profile_id":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled"]},"created_at":{"type":"string","format":"date-time"}}},"WebhookWithSecret":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","properties":{"secret":{"type":"string","description":"whsec_..., shown once"}}}]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer"},"last_status_code":{"type":["integer","null"]},"last_error":{"type":["string","null"]},"next_attempt_at":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}}},"PostMetrics":{"type":"object","description":"null = the platform didn't give this number (see note); never estimated.","properties":{"delivery_id":{"type":"string"},"post_id":{"type":"string"},"account_id":{"type":"string"},"platform":{"$ref":"#/components/schemas/Platform"},"url":{"type":["string","null"]},"published_at":{"type":["string","null"]},"views":{"type":["integer","null"]},"likes":{"type":["integer","null"]},"comments":{"type":["integer","null"]},"shares":{"type":["integer","null"]},"saves":{"type":["integer","null"]},"reach":{"type":["integer","null"]},"watch_time_min":{"type":["integer","null"]},"engagement_rate":{"type":["number","null"]},"available":{"type":"boolean"},"note":{"type":["string","null"]},"fetched_at":{"type":["string","null"]}}},"AnalyticsOverview":{"type":"object","properties":{"range":{"type":"object"},"plan":{"type":"string"},"totals":{"type":"object"},"previous":{"type":["object","null"]},"by_platform":{"type":"array","items":{"type":"object"}},"series":{"type":"array","items":{"type":"object"}},"accounts":{"type":"array","items":{"type":"object"}},"top_posts":{"type":"array","items":{"$ref":"#/components/schemas/PostMetrics"}},"availability":{"type":"array","items":{"type":"object"}},"empty":{"type":"boolean"},"last_collected_at":{"type":["string","null"]}}},"BestTimes":{"type":"object","properties":{"timezone":{"type":"string"},"basis":{"type":"string","enum":["history","queue_settings"]},"sample_posts":{"type":"integer"},"heatmap":{"type":["array","null"]},"best":{"type":"array","items":{"type":"object","properties":{"weekday":{"type":"integer"},"hour":{"type":"integer"},"score":{"type":"integer"},"next_at":{"type":"string","format":"date-time"},"local":{"type":"string"}}}},"note":{"type":"string"},"locked":{"type":"boolean"}}},"WebhookEvent":{"type":"object","description":"Body POSTed to your endpoint. Verify X-PMR-Signature: t=<unix>,v1=hex(HMAC_SHA256(secret, t + \".\" + raw_body)); reject if t is older than 5 min.","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["post.published","post.failed","delivery.updated","account.connected","account.expiring","account.disconnected"]},"created_at":{"type":"string","format":"date-time"},"livemode":{"type":"boolean"},"data":{"type":"object"}}}}}}