{"openapi":"3.1.0","info":{"title":"Cortex External API","version":"1.0.0","description":"Role-aware API for clients, social content, publishing, media, analytics, reports, TikTok trends, and agency automation.","contact":{"name":"Cortex developer support","email":"jack@nativz.io"}},"servers":[{"url":"https://cortex.nativz.io","description":"Nativz Cortex"},{"url":"https://cortex.andersoncollaborative.com","description":"Anderson Collaborative Cortex"}],"externalDocs":{"description":"Cortex developer documentation","url":"https://cortex.nativz.io/docs"},"paths":{"/api/v1/whoami":{"get":{"operationId":"getIdentity","summary":"Resolve the current key identity and scope","tags":["Identity"],"security":[{"bearerAuth":["profile:read"]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/clients":{"get":{"operationId":"listClients","summary":"List accessible clients","tags":["Clients"],"security":[{"bearerAuth":["clients:read"]}],"parameters":[{"in":"query","name":"limit","required":false,"description":"Page size from 1 to 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","required":false,"description":"Opaque cursor returned by the prior page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"createClient","summary":"Create a client","tags":["Clients"],"security":[{"bearerAuth":["clients:write"]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCreate"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/clients/{id}":{"get":{"operationId":"getClient","summary":"Get a client","tags":["Clients"],"security":[{"bearerAuth":["clients:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/clients/{id}/knowledge":{"get":{"operationId":"listKnowledge","summary":"List client knowledge entries","tags":["Brand memory"],"security":[{"bearerAuth":["knowledge:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"createKnowledge","summary":"Create a client knowledge entry","tags":["Brand memory"],"security":[{"bearerAuth":["knowledge:write"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeCreate"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/clients/{id}/knowledge/{entryId}":{"get":{"operationId":"getKnowledge","summary":"Get a client knowledge entry","tags":["Brand memory"],"security":[{"bearerAuth":["knowledge:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"entryId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/clients/{id}/knowledge/graph":{"get":{"operationId":"getKnowledgeGraph","summary":"Get the client knowledge graph","tags":["Brand memory"],"security":[{"bearerAuth":["knowledge:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/clients/{id}/knowledge/import":{"post":{"operationId":"importKnowledge","summary":"Import client knowledge","tags":["Brand memory"],"security":[{"bearerAuth":["knowledge:write"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeImport"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/clients/{id}/knowledge/search":{"post":{"operationId":"searchKnowledge","summary":"Search client knowledge","tags":["Brand memory"],"security":[{"bearerAuth":["knowledge:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/connections":{"get":{"operationId":"listConnections","summary":"List social connections","tags":["Connections"],"security":[{"bearerAuth":["connections:read"]}],"parameters":[{"in":"query","name":"client_id","required":true,"description":"Client UUID.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"platform","required":false,"description":"Optional social platform filter.","schema":{"type":"string"}},{"in":"query","name":"status","required":false,"description":"Optional normalized connection status.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/connections/sessions":{"post":{"operationId":"createConnectionSession","summary":"Create a provider connection session","tags":["Connections"],"security":[{"bearerAuth":["connections:write"]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionSessionCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/connections/sessions/{id}":{"get":{"operationId":"getConnectionSession","summary":"Read connection session state","tags":["Connections"],"security":[{"bearerAuth":["connections:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/media":{"get":{"operationId":"listMedia","summary":"List managed media","tags":["Media"],"security":[{"bearerAuth":["media:read"]}],"parameters":[{"in":"query","name":"client_id","required":true,"description":"Client UUID.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"unused","required":false,"description":"Return only unattached media.","schema":{"type":"boolean"}},{"in":"query","name":"limit","required":false,"description":"Page size from 1 to 100.","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","required":false,"description":"Opaque cursor returned by the prior page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"createMediaUpload","summary":"Create a direct media upload","tags":["Media"],"security":[{"bearerAuth":["media:write"]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/posts":{"get":{"operationId":"listPosts","summary":"List posts","tags":["Posts"],"security":[{"bearerAuth":["posts:read"]}],"parameters":[{"in":"query","name":"client_id","required":true,"description":"Client UUID.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"status","required":false,"description":"Optional post status filter.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"createPost","summary":"Create or schedule a post","tags":["Posts"],"security":[{"bearerAuth":["posts:write"]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/posts/{id}":{"get":{"operationId":"getPost","summary":"Get a post","tags":["Posts"],"security":[{"bearerAuth":["posts:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"patch":{"operationId":"updatePost","summary":"Update an eligible post","tags":["Posts"],"security":[{"bearerAuth":["posts:write"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostUpdate"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"delete":{"operationId":"deletePost","summary":"Cancel or delete an eligible post","tags":["Posts"],"security":[{"bearerAuth":["posts:write"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/posts/{id}/publish":{"post":{"operationId":"publishPost","summary":"Publish a post now","tags":["Posts"],"security":[{"bearerAuth":["posts:write"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequest"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/posts/{id}/deliveries":{"get":{"operationId":"listPostDeliveries","summary":"Read provider delivery state","tags":["Posts"],"security":[{"bearerAuth":["posts:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/calendar/events":{"get":{"operationId":"listCalendarEvents","summary":"List calendar events","tags":["Calendar"],"security":[{"bearerAuth":["calendar:read"]}],"parameters":[{"in":"query","name":"start","required":true,"description":"Inclusive ISO 8601 lower bound.","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"end","required":true,"description":"Exclusive ISO 8601 upper bound.","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"createCalendarEvent","summary":"Create a calendar event","tags":["Calendar"],"security":[{"bearerAuth":["calendar:write"]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/analytics/summary":{"get":{"operationId":"getAnalyticsSummary","summary":"Get normalized account analytics","tags":["Analytics"],"security":[{"bearerAuth":["analytics:read"]}],"parameters":[{"in":"query","name":"client_id","required":true,"description":"Client UUID.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"start","required":true,"description":"Inclusive YYYY-MM-DD start date.","schema":{"type":"string","format":"date"}},{"in":"query","name":"end","required":true,"description":"Inclusive YYYY-MM-DD end date.","schema":{"type":"string","format":"date"}},{"in":"query","name":"platform","required":false,"description":"Optional platform filter.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/analytics/posts":{"get":{"operationId":"listPostAnalytics","summary":"List normalized post analytics","tags":["Analytics"],"security":[{"bearerAuth":["analytics:read"]}],"parameters":[{"in":"query","name":"client_id","required":true,"description":"Client UUID.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"start","required":false,"description":"Inclusive YYYY-MM-DD start date.","schema":{"type":"string","format":"date"}},{"in":"query","name":"end","required":false,"description":"Inclusive YYYY-MM-DD end date.","schema":{"type":"string","format":"date"}},{"in":"query","name":"platform","required":false,"description":"Optional platform filter.","schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"description":"Page size from 1 to 100.","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","required":false,"description":"Opaque cursor returned by the prior page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/reports":{"get":{"operationId":"listReports","summary":"List accessible reports","tags":["Reports"],"security":[{"bearerAuth":["reports:read"]}],"parameters":[{"in":"query","name":"client_id","required":false,"description":"Client UUID. Required for most scoped integrations.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"status","required":false,"description":"Published or draft. Portal keys cannot request draft.","schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"description":"Page size from 1 to 100.","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","required":false,"description":"Opaque cursor returned by the prior page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/reports/{id}":{"get":{"operationId":"getReport","summary":"Get a report","tags":["Reports"],"security":[{"bearerAuth":["reports:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/trends/videos":{"get":{"operationId":"searchTrendVideos","summary":"Search TikTok trend videos","tags":["TikTok trends"],"security":[{"bearerAuth":["trends:read"]}],"parameters":[{"in":"query","name":"client_id","required":false,"description":"Client UUID. Required for scoped keys and optional for unscoped admins.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"query","required":false,"description":"Keyword query. Omit to explore a trend rail.","schema":{"type":"string"}},{"in":"query","name":"rail","required":false,"description":"Trend rail.","schema":{"type":"string","enum":["week","month","breakout"],"default":"week"}},{"in":"query","name":"limit","required":false,"description":"Number of videos from 1 to 50.","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/trends/ask":{"post":{"operationId":"askTrends","summary":"Ask a grounded TikTok trend question","tags":["TikTok trends"],"security":[{"bearerAuth":["trends:ask"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrendQuestion"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/webhooks":{"get":{"operationId":"listWebhooks","summary":"List webhook subscriptions","tags":["Webhooks"],"security":[{"bearerAuth":["webhooks:read"]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"createWebhook","summary":"Create a webhook subscription","tags":["Webhooks"],"security":[{"bearerAuth":["webhooks:write"]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/webhooks/{id}":{"delete":{"operationId":"deleteWebhook","summary":"Delete a webhook subscription","tags":["Webhooks"],"security":[{"bearerAuth":["webhooks:write"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/webhooks/{id}/test":{"post":{"operationId":"testWebhook","summary":"Queue a test webhook delivery","tags":["Webhooks"],"security":[{"bearerAuth":["webhooks:write"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/shoots":{"get":{"operationId":"listShoots","summary":"List shoots","tags":["Shoots"],"security":[{"bearerAuth":["shoots:read"]}],"parameters":[{"in":"query","name":"client_id","required":false,"description":"Optional client UUID.","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"status","required":false,"description":"Optional shoot status.","schema":{"type":"string"}},{"in":"query","name":"date_from","required":false,"description":"Inclusive YYYY-MM-DD lower bound.","schema":{"type":"string","format":"date"}},{"in":"query","name":"date_to","required":false,"description":"Inclusive YYYY-MM-DD upper bound.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/shoots/{id}":{"get":{"operationId":"getShoot","summary":"Get a shoot","tags":["Shoots"],"security":[{"bearerAuth":["shoots:read"]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/team":{"get":{"operationId":"listTeam","summary":"List accessible team members","tags":["Team"],"security":[{"bearerAuth":["team:read"]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"createTeamMember","summary":"Create a team member","tags":["Team"],"security":[{"bearerAuth":["team:write"]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/search":{"get":{"operationId":"getSearchCapabilities","summary":"Get search capabilities","tags":["Search"],"security":[{"bearerAuth":["search:read"]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"searchCortex","summary":"Search accessible Cortex records","tags":["Search"],"security":[{"bearerAuth":["search:read"]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable retry identity. 8 to 200 safe ASCII characters; retained for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Cortex API key","description":"Server-side Cortex API key with least-privilege scopes."}},"responses":{"BadRequest":{"description":"Invalid request or validation failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The key role, client boundary, or scopes do not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"The durable per-key rate limit was exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"RateLimit-Limit":{"schema":{"type":"integer"}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"schema":{"type":"integer"}}}},"ServerError":{"description":"Cortex could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error","code","request_id","docs_url"],"properties":{"error":{"type":"string","description":"Human-readable explanation."},"code":{"type":"string","description":"Stable machine-readable error code."},"request_id":{"type":"string","description":"Correlation ID for logs and support."},"docs_url":{"type":"string","format":"uri","description":"Relevant remediation guide."}}},"ClientCreate":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"agency":{"type":"string","enum":["nativz","anderson"]}}},"KnowledgeCreate":{"type":"object","required":["content"],"properties":{"title":{"type":"string"},"content":{"type":"string"},"source":{"type":"string"}}},"KnowledgeImport":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"SearchRequest":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1},"limit":{"type":"integer","minimum":1,"maximum":100}}},"ConnectionSessionCreate":{"type":"object","required":["client_id","platforms"],"properties":{"client_id":{"type":"string","format":"uuid"},"platforms":{"type":"array","minItems":1,"maxItems":6,"items":{"type":"string"}},"mode":{"type":"string","enum":["connect","reconnect"],"default":"connect"}}},"MediaUploadCreate":{"type":"object","required":["action","client_id","filename","content_type","file_size_bytes"],"properties":{"action":{"type":"string","enum":["create_upload","complete_upload"]},"client_id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"content_type":{"type":"string"},"file_size_bytes":{"type":"integer","minimum":1},"reservation_id":{"type":"string","format":"uuid"},"storage_path":{"type":"string"},"public_url":{"type":"string","format":"uri"}}},"PostCreate":{"type":"object","required":["client_id"],"properties":{"client_id":{"type":"string","format":"uuid"},"caption":{"type":"string"},"hashtags":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["draft","scheduled"],"default":"draft"},"platform_profile_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"media_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"scheduled_at":{"type":["string","null"],"format":"date-time"}}},"PostUpdate":{"type":"object","properties":{"caption":{"type":"string"},"hashtags":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["draft","scheduled"]},"platform_profile_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"media_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"scheduled_at":{"type":["string","null"],"format":"date-time"}}},"PublishRequest":{"type":"object","properties":{"connection_ids":{"type":"array","items":{"type":"string","format":"uuid"}}}},"CalendarEventCreate":{"type":"object","required":["title","starts_at"],"properties":{"client_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time"}}},"TrendQuestion":{"type":"object","required":["question"],"properties":{"question":{"type":"string","minLength":1},"client_id":{"type":"string","format":"uuid"}}},"WebhookCreate":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","pattern":"^https://"},"events":{"type":"array","minItems":1,"items":{"type":"string"}},"client_id":{"type":"string","format":"uuid"}}},"TeamMemberCreate":{"type":"object","required":["email","name"],"properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"},"role":{"type":"string"}}}}}}