{"openapi":"3.1.0","info":{"title":"Chaviar public API","version":"1.1.0","description":"Brand content API. Email sending, ad-budget management and comment replies remain in the app. See /docs/api."},"servers":[{"url":"https://chaviar.app/api/v1"}],"paths":{"/content":{"post":{"summary":"Generate content","operationId":"post_content","description":"Required scope: content:write. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:write"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Idempotent replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}},"headers":{"Location":{"schema":{"type":"string"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContent"}}}}},"get":{"summary":"List brand content","operationId":"get_content","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentPage"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"query","name":"limit","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}},{"in":"query","name":"kind","required":false,"schema":{"type":"string","enum":["post","story","reel","email","ad"]}},{"in":"query","name":"platform","required":false,"schema":{"type":"string","enum":["in","ig","fb","th","x","bsky"]}}]}},"/content/validate":{"post":{"summary":"Validate creation without generation","operationId":"post_content_validate","description":"Required scope: content:write. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:write"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Validation"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContent"}}}}}},"/content/{id}":{"get":{"summary":"Retrieve content and signed media","operationId":"get_content_id","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Content"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]},"patch":{"summary":"Edit caption","operationId":"patch_content_id","description":"Required scope: content:write. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:write"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Content"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"caption":{"type":"string","minLength":1,"maxLength":64000}},"required":["caption"],"additionalProperties":false}}}}}},"/content/{id}/actions":{"post":{"summary":"Control a social draft","operationId":"post_content_id_actions","description":"Required scope: content:write. See /docs/api for lifecycle, billing and retry semantics. Approve/schedule/publish additionally need content:publish and publishing grant; LinkedIn requires app review.","x-required-scopes":["content:write"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Content"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["approve","schedule","publish","cancel","restore"]},"publish_at":{"type":"string","format":"date-time"}},"required":["action"],"additionalProperties":false}}}}}},"/content/{id}/regenerate":{"post":{"summary":"Generate a new review-mode version","operationId":"post_content_id_regenerate","description":"Required scope: content:write. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:write"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Idempotent replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"type":"string","minLength":1,"maxLength":2000},"idempotency_key":{"type":"string","minLength":1,"maxLength":128}},"required":["brief","idempotency_key"],"additionalProperties":false}}}}}},"/requests":{"get":{"summary":"List requests or look up an idempotency key","operationId":"get_requests","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestPage"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"query","name":"limit","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}},{"in":"query","name":"idempotency_key","required":false,"schema":{"type":"string","maxLength":128}}]}},"/requests/{id}":{"get":{"summary":"Read aggregate and per-delivery state","operationId":"get_requests_id","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]}},"/requests/{id}/cancel":{"post":{"summary":"Cancel pending request deliveries","operationId":"post_requests_id_cancel","description":"Required scope: content:write. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:write"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]}},"/channels":{"get":{"summary":"Discover channels and capabilities","operationId":"get_channels","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}}},"required":["data"]}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/library":{"get":{"summary":"List brand media","operationId":"get_library","description":"Required scope: library:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["library:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPage"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"query","name":"limit","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}}]}},"/calendar":{"get":{"summary":"Read app calendar","operationId":"get_calendar","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"query","name":"from","required":true,"schema":{"type":"string","format":"date"}},{"in":"query","name":"to","required":true,"schema":{"type":"string","format":"date"}}]}},"/metrics":{"get":{"summary":"Read cached metrics","operationId":"get_metrics","description":"Required scope: insights:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["insights:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metrics"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"query","name":"content_ids","required":false,"schema":{"type":"string"},"description":"Comma-separated list of up to 100 content ids; omit for channel rollups."}]}},"/wallet":{"get":{"summary":"Read wallet","operationId":"get_wallet","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Wallet"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"summary":"Read token ledger","operationId":"get_usage","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsagePage"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"query","name":"limit","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}}]}},"/key":{"get":{"summary":"Read own key policy","operationId":"get_key","description":"Required scope: content:read. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["content:read"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Reduce key family policy","operationId":"patch_key","description":"Required scope: keys:rotate. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["keys:rotate"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyPatch"}}}}}},"/key/rotate":{"post":{"summary":"Rotate current key","operationId":"post_key_rotate","description":"Required scope: keys:rotate. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["keys:rotate"],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"key_id":{"type":"string"},"previous_key_expires_at":{"type":"string","format":"date-time"}},"required":["key","key_id","previous_key_expires_at"]}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grace_seconds":{"type":"integer","minimum":0,"maximum":86400,"default":3600}},"additionalProperties":false}}}}}},"/webhooks":{"get":{"summary":"List subscriptions","operationId":"get_webhooks","description":"Required scope: webhooks:manage. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}},"required":["data"]}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create signed webhook subscription","operationId":"post_webhooks","description":"Required scope: webhooks:manage. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048}},"required":["url"],"additionalProperties":false}}}}}},"/webhooks/{id}":{"patch":{"summary":"Pause or resume subscription","operationId":"patch_webhooks_id","description":"Required scope: webhooks:manage. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}}},"delete":{"summary":"Delete subscription","operationId":"delete_webhooks_id","description":"Required scope: webhooks:manage. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Success"},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]}},"/webhooks/{id}/deliveries":{"get":{"summary":"Inspect deliveries","operationId":"get_webhooks_id_deliveries","description":"Required scope: webhooks:manage. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}}]}},"/webhooks/{id}/deliveries/{deliveryId}/replay":{"post":{"summary":"Retry undelivered idle event","operationId":"post_webhooks_id_deliveries_deliveryId_replay","description":"Required scope: webhooks:manage. See /docs/api for lifecycle, billing and retry semantics.","x-required-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"queued":{"type":"boolean"}}}}}},"default":{"description":"API error. Branch on error.code. Retry-After is present for rate limits.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"deliveryId","required":true,"schema":{"type":"string"}}]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Brand-scoped cvk_ API key"}},"schemas":{"CreateContent":{"type":"object","properties":{"kind":{"type":"string","enum":["post","story","reel","email","ad"]},"brief":{"type":"string","minLength":1,"maxLength":2000},"mode":{"type":"string","enum":["review","auto"],"default":"review"},"platforms":{"type":"array","items":{"type":"string","enum":["in","ig","fb","th","x","bsky"]},"minItems":1,"maxItems":6,"description":"Stories: ig/fb only. Reels: exactly one ig/fb. Email/ad: omitted. Exact destination selection."},"publish_at":{"type":"string","description":"Auto only. now or ISO timestamp with offset, future and within 30 days."},"expire_after":{"type":"string","pattern":"^\\d{1,6}[mhd]$","description":"Positive duration at most 30 days; deadline must follow publish_at."},"idempotency_key":{"type":"string","minLength":1,"maxLength":128},"images":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"data_url":{"type":"string","pattern":"^data:image/"}},"required":["data_url"],"additionalProperties":false}]},"maxItems":4,"description":"Post/email/ad max 1; story/reel max 4. Whole JSON <=20 MiB."},"email_format":{"type":"string","enum":["standard","leaflet_tiles","leaflet_image","auto"]},"metadata":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","maxLength":500},"propertyNames":{"type":"string","minLength":1,"maxLength":64},"description":"At most 4000 encoded characters; prototype-related keys rejected."}},"required":["kind","brief"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":true}},"required":["error"]},"Delivery":{"type":"object","properties":{"content_id":{"type":"string"},"platform":{"anyOf":[{"type":"string","enum":["in","ig","fb","th","x","bsky"]},{"type":"null"}]},"status":{"type":"string","enum":["composing","awaiting_review","scheduled","publishing","published","blocked","failed","expired","cancelled"]},"review_status":{"type":"string"},"generation_status":{"type":"string"},"scheduled_for":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"type":"string"},"action_required":{"type":"string"}},"required":["content_id","platform","status","generation_status","review_status"]},"Request":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["post","story","reel","email","ad"]},"mode":{"type":"string","enum":["review","auto"]},"status":{"type":"string","enum":["composing","awaiting_review","scheduled","partially_published","published","blocked","failed","expired","cancelled"]},"created_at":{"type":"string","format":"date-time"},"content_id":{"type":"string"},"scheduled_for":{"type":"string","format":"date-time"},"published_at":{"type":"string","format":"date-time"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error":{"type":"string"},"complete":{"type":"boolean"},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"requested_platforms":{"anyOf":[{"type":"array","items":{"type":"string","enum":["in","ig","fb","th","x","bsky"]}},{"type":"null"}]},"skipped_platforms":{"type":"array","items":{"type":"string","enum":["in","ig","fb","th","x","bsky"]}}},"required":["id","kind","mode","status","created_at"]},"Media":{"type":"object","properties":{"id":{"type":"string"},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"content_type":{"type":"string"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}]},"height":{"anyOf":[{"type":"integer"},{"type":"null"}]},"url_expires_in":{"type":"integer","enum":[300]}},"required":["id","url","content_type"]},"Block":{"type":"object","properties":{"id":{"type":"string"},"index":{"type":"integer"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"href":{"anyOf":[{"type":"string"},{"type":"null"}]},"asset_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","index"]},"Content":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["post","story","reel","email","ad"]},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"platform":{"anyOf":[{"type":"string","enum":["in","ig","fb","th","x","bsky"]},{"type":"null"}]},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"headline":{"anyOf":[{"type":"string"},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"generation_status":{"type":"string"},"review_status":{"type":"string"},"delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduled_for":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"review_url":{"type":"string"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/Block"}},"email":{"type":"object","properties":{"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"preheader":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}},"ad":{"type":"object","properties":{"format":{"anyOf":[{"type":"string"},{"type":"null"}]},"call_to_action":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"reel":{"type":"object","properties":{"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}]},"aspect":{"anyOf":[{"type":"string"},{"type":"null"}]},"video_asset_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"poster_asset_id":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"error":{"type":"string"}},"required":["id","kind","media","blocks","review_url"]},"Validation":{"type":"object","properties":{"valid":{"type":"boolean"},"kind":{"type":"string","enum":["post","story","reel","email","ad"]},"cost_tokens":{"type":"integer"},"tokens_available":{"type":"integer"},"affordable":{"type":"boolean"},"requested_platforms":{"anyOf":[{"type":"array","items":{"type":"string","enum":["in","ig","fb","th","x","bsky"]}},{"type":"null"}]},"available_platforms":{"type":"array","items":{"type":"string","enum":["in","ig","fb","th","x","bsky"]}},"skipped_platforms":{"type":"array","items":{"type":"string","enum":["in","ig","fb","th","x","bsky"]}},"review_required":{"type":"boolean"},"note":{"type":"string"}},"required":["valid","kind","cost_tokens","affordable"]},"Channel":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"platform":{"type":"string","enum":["in","ig","fb","th","x","bsky"]},"connected":{"type":"boolean"},"paused":{"type":"boolean"},"kinds":{"type":"array","items":{"type":"string","enum":["post","story","reel","email","ad"]}},"caption_character_limit":{"type":"integer"},"image_required":{"type":"boolean"},"image_supported":{"type":"boolean"},"human_review_required":{"type":"boolean"},"allowed_by_key":{"type":"boolean"}}},"Wallet":{"type":"object","properties":{"tokens":{"type":"integer"},"plan":{"type":"string"}},"required":["tokens","plan"]},"Usage":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"tokens":{"type":"integer"},"content_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}},"Policy":{"type":"object","properties":{"id":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["content:read","content:write","content:publish","library:read","insights:read","webhooks:manage","keys:rotate"]}},"allowed_kinds":{"type":"array","items":{"type":"string","enum":["post","story","reel","email","ad"]}},"allowed_platforms":{"anyOf":[{"type":"array","items":{"type":"string","enum":["in","ig","fb","th","x","bsky"]}},{"type":"null"}]},"allow_auto_publish":{"type":"boolean"},"daily_token_limit":{"anyOf":[{"type":"integer"},{"type":"null"}]}}},"PolicyPatch":{"type":"object","properties":{"scopes":{"type":"array","items":{"type":"string","enum":["content:read","content:write","content:publish","library:read","insights:read","webhooks:manage","keys:rotate"]}},"allowed_platforms":{"type":"array","items":{"type":"string","enum":["in","ig","fb","th","x","bsky"]}},"allow_auto_publish":{"const":false},"daily_token_limit":{"type":"integer","minimum":0,"maximum":1000000}},"additionalProperties":false,"minProperties":1},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"signing_secret":{"type":"string","description":"Creation response only. Store securely."}},"required":["id","url","enabled"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"attempts":{"type":"integer"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"next_attempt_at":{"type":"string","format":"date-time"},"last_status":{"anyOf":[{"type":"integer"},{"type":"null"}]},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["request.updated"]},"created_at":{"type":"string","format":"date-time"},"request_id":{"type":"string"},"version":{"type":"integer"},"data":{"$ref":"#/components/schemas/Request"}},"required":["id","type","created_at","request_id","version","data"]},"Metrics":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","description":"Cached channel rollup or content snapshot. May contain null/missing metrics; fetchedAt/metricsFetchedAt identify freshness.","additionalProperties":true}}},"required":["data"]},"Calendar":{"type":"object","properties":{"fromISO":{"type":"string","format":"date"},"toISO":{"type":"string","format":"date"},"items":{"type":"array","items":{"type":"object","additionalProperties":true}},"coverage":{"type":"array","items":{"type":"object","additionalProperties":true}},"meta":{"type":"object","additionalProperties":true}},"required":["fromISO","toISO","items","coverage","meta"]},"RequestPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Request"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"]},"ContentPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Content"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"]},"MediaPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"]},"UsagePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Usage"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"]},"WebhookDeliveryPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"]}}},"webhooks":{"request.updated":{"post":{"summary":"Signed request state snapshot","parameters":[{"in":"header","name":"Chaviar-Signature","required":true,"schema":{"type":"string"}},{"in":"header","name":"Chaviar-Event-Id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledge the event; any 2xx is accepted."}}}}}}