{"openapi":"3.0.3","info":{"title":"Downtown Back Office API","description":"Internal ecommerce back-office API. All routes require session authentication.","version":"1.0.0","contact":{"email":"angela.lima@mathematica.ai"}},"servers":[{"url":"https://downtown-bo.vercel.app","description":"Production"}],"components":{"securitySchemes":{"cookieAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}},"security":[{"cookieAuth":[]}],"paths":{"/api/accounts":{"get":{"summary":"List all accounts","operationId":"listAccounts","responses":{"200":{"description":"Array of accounts"},"401":{"description":"Unauthorized","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}}}}},"/api/accounts/{slug}":{"get":{"summary":"Get account by slug","operationId":"getAccount","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Account object"},"401":{"description":"Unauthorized"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/skills":{"get":{"summary":"List all skills","operationId":"listSkills","responses":{"200":{"description":"Array of skills"},"401":{"description":"Unauthorized"}}},"post":{"summary":"Create a skill","operationId":"createSkill","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"markdown":{"type":"string"}}}}}},"responses":{"201":{"description":"Created skill"},"401":{"description":"Unauthorized"}}}},"/api/skills/{id}/run":{"post":{"summary":"Trigger a skill run","operationId":"runSkill","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job ID and deeplink","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"deeplink":{"type":"string"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/jobs/{jobId}":{"get":{"summary":"Poll job status","operationId":"getJob","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job status object"},"404":{"description":"Job not found"}}}},"/api/webhooks":{"get":{"summary":"Webhook endpoint info","operationId":"getWebhookInfo","responses":{"200":{"description":"Endpoint metadata"}}},"post":{"summary":"Receive webhook events","operationId":"receiveWebhook","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Acknowledged","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/sse":{"get":{"summary":"Server-sent events stream","operationId":"sseStream","responses":{"200":{"description":"Event stream","content":{"text/event-stream":{"schema":{"type":"string"}}}}}}},"/api/feed.xml":{"get":{"summary":"Atom feed","operationId":"atomFeed","responses":{"200":{"description":"Atom XML feed","content":{"application/atom+xml":{"schema":{"type":"string"}}}}}}},"/graphql":{"post":{"summary":"GraphQL endpoint","operationId":"graphql","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"}}}}}},"responses":{"200":{"description":"GraphQL response"}}}},"/api/sync/accounts":{"post":{"summary":"Trigger Google Sheets account sync","operationId":"syncAccounts","responses":{"200":{"description":"Sync result"},"401":{"description":"Unauthorized"}}}},"/api/search-terms/{accountId}":{"get":{"summary":"Get search terms for an account","operationId":"getSearchTerms","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Search terms array"},"401":{"description":"Unauthorized"}}}}}}