{"openapi":"3.1.1","info":{"title":"Northstar Public API","version":"1.0.0","description":"Isolated demo operations. Keys and OAuth tokens bind run, generation, workspace and actor. Write requests require Idempotency-Key. A timeout does not establish completion; recover the original request with the same key and body. Cursor snapshots expire when sequence changes. Tickets use the immutable credential generation because the curated connector body is fixed."},"servers":[{"url":"/"}],"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}}},"accounts":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"segment":{"enum":["Enterprise","Growth","Standard","Trial"]},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"health":{"enum":["healthy","watch","at-risk"]},"healthScore":{"type":"number"},"renewalAt":{"type":"string","format":"date-time"},"annualValue":{"type":"number"},"openRequestIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"projectIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"invoiceIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"integrationIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"notes":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","segment","ownerId","health","healthScore","renewalAt","openRequestIds","projectIds","integrationIds","notes","updatedAt"],"additionalProperties":false},"work":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"priority":{"enum":["P1","P2","P3"]},"status":{"enum":["open","pending-customer","escalated","resolved"]},"assigneeId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"dueAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","title","description","priority","status","assigneeId","dueAt","createdAt","updatedAt"],"additionalProperties":false},"projects":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["active","blocked","at-risk","complete"]},"progress":{"type":"number"},"blocker":{"type":["string","null"]},"nextMilestone":{"type":"string"},"dueAt":{"type":"string","format":"date-time"}},"required":["id","accountId","name","ownerId","status","progress","blocker","nextMilestone","dueAt"],"additionalProperties":false},"members":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string"},"role":{"enum":["admin","member","viewer"]},"status":{"enum":["active","pending"]},"lastActiveAt":{"type":["string","null"]}},"required":["id","name","role","status","lastActiveAt"],"additionalProperties":false},"invoices":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"amount":{"type":"number"},"currency":{"enum":["USD","EUR"]},"status":{"enum":["draft","due","overdue","paid"]},"issuedAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","format":"date-time"},"taxIdMasked":{"type":"string"},"refundedAmount":{"type":"number"}},"required":["id","accountId","amount","currency","status","issuedAt","dueAt","taxIdMasked","refundedAmount"],"additionalProperties":false},"operations":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false},"webhook-deliveries":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"eventId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"endpointId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["pending","failed","succeeded","replay","cancelled"]},"attempts":{"type":"integer"},"lastStatus":{"type":["integer","null"]},"replayOf":{"type":["string","null"]}},"required":["id","eventId","endpointId","status","attempts","lastStatus","replayOf"],"additionalProperties":false},"Receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false}},"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"ns_key_<opaque>"},"OAuth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/api/oauth/authorize","tokenUrl":"/api/oauth/token","scopes":{"accounts:read":"accounts:read","accounts:write":"accounts:write","work:read":"work:read","work:write":"work:write","projects:read":"projects:read","projects:write":"projects:write","members:read":"members:read","members:write":"members:write","invoices:read":"invoices:read","invoices:write":"invoices:write","operations:read":"operations:read","operations:write":"operations:write","webhooks:read":"webhooks:read","webhooks:write":"webhooks:write","entitlements:read":"entitlements:read","tickets:write":"tickets:write"}}}}}},"paths":{"/api/oauth/consent":{"get":{"operationId":"oauth-consent-read","summary":"Read the session-bound consent request and its workspace","security":[],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","minLength":1,"maxLength":200},"redirectUri":{"type":"string","minLength":1,"maxLength":200},"scopes":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"workspace":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["id","name"],"additionalProperties":false}},"required":["id","label","redirectUri","scopes","workspace"],"additionalProperties":false}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"oauth-consent","summary":"Approve or deny the session-bound consent request","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"generation":{"type":"integer","minimum":1},"expectedWorkspaceId":{"type":"string","minLength":1,"maxLength":200},"approve":{"type":"boolean"}},"required":["id","generation","expectedWorkspaceId","approve"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"redirect":{"type":"string","minLength":1,"maxLength":200}},"required":["redirect"],"additionalProperties":false}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}}}}},"/api/oauth/authorize":{"get":{"operationId":"oauth-authorize","summary":"Start authorization with S256 PKCE; requires a Northstar browser session","security":[],"parameters":[{"name":"response_type","in":"query","required":true,"schema":{"type":"string","enum":["code"]}},{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string"}},{"name":"scope","in":"query","required":true,"schema":{"type":"string"}},{"name":"state","in":"query","required":true,"schema":{"type":"string"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","required":true,"schema":{"type":"string","enum":["S256"]}}],"responses":{"302":{"description":"Redirect to consent; redirects only within Northstar","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}}}}},"/api/oauth/token":{"post":{"operationId":"oauth-token","summary":"Exchange a one-use authorization code or rotate a refresh token","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"oneOf":[{"type":"object","properties":{"grant_type":{"enum":["authorization_code"]},"client_id":{"type":"string","minLength":1,"maxLength":200},"code":{"type":"string","minLength":1,"maxLength":200},"code_verifier":{"type":"string","minLength":43,"maxLength":128},"redirect_uri":{"type":"string"}},"required":["grant_type","client_id","code","code_verifier","redirect_uri"],"additionalProperties":false},{"type":"object","properties":{"grant_type":{"enum":["refresh_token"]},"client_id":{"type":"string","minLength":1,"maxLength":200},"refresh_token":{"type":"string","minLength":1,"maxLength":200},"scope":{"type":"string"}},"required":["grant_type","client_id","refresh_token"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1,"maxLength":200},"refresh_token":{"type":"string","minLength":1,"maxLength":200},"token_type":{"enum":["Bearer"]},"expires_in":{"type":"integer"},"scope":{"type":"string"}},"required":["access_token","refresh_token","token_type","expires_in","scope"],"additionalProperties":false}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}}}}},"/api/oauth/revoke":{"post":{"operationId":"oauth-revoke","summary":"Revoke an access or refresh token family; unknown tokens also return 200","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"client_id":{"type":"string","minLength":1,"maxLength":200},"token":{"type":"string","minLength":1,"maxLength":200}},"required":["client_id","token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","minLength":1,"maxLength":200}},"required":["error"],"additionalProperties":false}}}}}}},"/api/v1/accounts":{"get":{"operationId":"list-accounts","summary":"List accounts","tags":["accounts"],"security":[{"ApiKey":[]},{"OAuth":["accounts:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque nextCursor from the previous response; bound to this snapshot."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","nextCursor"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"segment":{"enum":["Enterprise","Growth","Standard","Trial"]},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"health":{"enum":["healthy","watch","at-risk"]},"healthScore":{"type":"number"},"renewalAt":{"type":"string","format":"date-time"},"annualValue":{"type":"number"},"openRequestIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"projectIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"invoiceIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"integrationIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"notes":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","segment","ownerId","health","healthScore","renewalAt","openRequestIds","projectIds","integrationIds","notes","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/accounts/{id}":{"get":{"operationId":"get-accounts","summary":"Get accounts","tags":["accounts"],"security":[{"ApiKey":[]},{"OAuth":["accounts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"segment":{"enum":["Enterprise","Growth","Standard","Trial"]},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"health":{"enum":["healthy","watch","at-risk"]},"healthScore":{"type":"number"},"renewalAt":{"type":"string","format":"date-time"},"annualValue":{"type":"number"},"openRequestIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"projectIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"invoiceIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"integrationIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"notes":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","segment","ownerId","health","healthScore","renewalAt","openRequestIds","projectIds","integrationIds","notes","updatedAt"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"update-account","summary":"Update account name or notes","tags":["accounts"],"security":[{"ApiKey":[]},{"OAuth":["accounts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":200},"notes":{"type":"string","maxLength":4000}},"required":["generation"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"segment":{"enum":["Enterprise","Growth","Standard","Trial"]},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"health":{"enum":["healthy","watch","at-risk"]},"healthScore":{"type":"number"},"renewalAt":{"type":"string","format":"date-time"},"annualValue":{"type":"number"},"openRequestIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"projectIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"invoiceIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"integrationIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"notes":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","segment","ownerId","health","healthScore","renewalAt","openRequestIds","projectIds","integrationIds","notes","updatedAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/work":{"get":{"operationId":"list-work","summary":"List work","tags":["work"],"security":[{"ApiKey":[]},{"OAuth":["work:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque nextCursor from the previous response; bound to this snapshot."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","nextCursor"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"priority":{"enum":["P1","P2","P3"]},"status":{"enum":["open","pending-customer","escalated","resolved"]},"assigneeId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"dueAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","title","description","priority","status","assigneeId","dueAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create-work","summary":"Create a work request","tags":["work"],"security":[{"ApiKey":[]},{"OAuth":["work:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":4000},"priority":{"type":"string","enum":["P1","P2","P3"]}},"required":["generation","accountId","title","description","priority"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"priority":{"enum":["P1","P2","P3"]},"status":{"enum":["open","pending-customer","escalated","resolved"]},"assigneeId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"dueAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","title","description","priority","status","assigneeId","dueAt","createdAt","updatedAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/work/{id}":{"get":{"operationId":"get-work","summary":"Get work","tags":["work"],"security":[{"ApiKey":[]},{"OAuth":["work:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"priority":{"enum":["P1","P2","P3"]},"status":{"enum":["open","pending-customer","escalated","resolved"]},"assigneeId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"dueAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","title","description","priority","status","assigneeId","dueAt","createdAt","updatedAt"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"update-work","summary":"Update work status or assignee","tags":["work"],"security":[{"ApiKey":[]},{"OAuth":["work:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1},"status":{"type":"string","enum":["open","pending-customer","escalated","resolved"]},"assigneeId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["generation"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"priority":{"enum":["P1","P2","P3"]},"status":{"enum":["open","pending-customer","escalated","resolved"]},"assigneeId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"dueAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","title","description","priority","status","assigneeId","dueAt","createdAt","updatedAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects":{"get":{"operationId":"list-projects","summary":"List projects","tags":["projects"],"security":[{"ApiKey":[]},{"OAuth":["projects:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque nextCursor from the previous response; bound to this snapshot."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","nextCursor"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["active","blocked","at-risk","complete"]},"progress":{"type":"number"},"blocker":{"type":["string","null"]},"nextMilestone":{"type":"string"},"dueAt":{"type":"string","format":"date-time"}},"required":["id","accountId","name","ownerId","status","progress","blocker","nextMilestone","dueAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create-project","summary":"Create project","tags":["projects"],"security":[{"ApiKey":[]},{"OAuth":["projects:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"dueAt":{"type":"string","format":"date-time"},"nextMilestone":{"type":"string","minLength":1,"maxLength":200}},"required":["generation","accountId","name","ownerId","dueAt","nextMilestone"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["active","blocked","at-risk","complete"]},"progress":{"type":"number"},"blocker":{"type":["string","null"]},"nextMilestone":{"type":"string"},"dueAt":{"type":"string","format":"date-time"}},"required":["id","accountId","name","ownerId","status","progress","blocker","nextMilestone","dueAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{id}":{"get":{"operationId":"get-projects","summary":"Get projects","tags":["projects"],"security":[{"ApiKey":[]},{"OAuth":["projects:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["active","blocked","at-risk","complete"]},"progress":{"type":"number"},"blocker":{"type":["string","null"]},"nextMilestone":{"type":"string"},"dueAt":{"type":"string","format":"date-time"}},"required":["id","accountId","name","ownerId","status","progress","blocker","nextMilestone","dueAt"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"edit-project","summary":"Edit project","tags":["projects"],"security":[{"ApiKey":[]},{"OAuth":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":200},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"dueAt":{"type":"string","format":"date-time"},"nextMilestone":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["active","blocked","at-risk","complete"]}},"required":["generation","name","ownerId","dueAt","nextMilestone","status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["active","blocked","at-risk","complete"]},"progress":{"type":"number"},"blocker":{"type":["string","null"]},"nextMilestone":{"type":"string"},"dueAt":{"type":"string","format":"date-time"}},"required":["id","accountId","name","ownerId","status","progress","blocker","nextMilestone","dueAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"delete-project","summary":"Delete project (admin)","tags":["projects"],"security":[{"ApiKey":[]},{"OAuth":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1}},"required":["generation"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200}},"required":["id"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members":{"get":{"operationId":"list-members","summary":"List members","tags":["members"],"security":[{"ApiKey":[]},{"OAuth":["members:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque nextCursor from the previous response; bound to this snapshot."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","nextCursor"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string"},"role":{"enum":["admin","member","viewer"]},"status":{"enum":["active","pending"]},"lastActiveAt":{"type":["string","null"]}},"required":["id","name","role","status","lastActiveAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"invite-member","summary":"Invite member","tags":["members"],"security":[{"ApiKey":[]},{"OAuth":["members:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","maxLength":254},"role":{"type":"string","enum":["admin","member","viewer"]}},"required":["generation","name","email","role"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string"},"role":{"enum":["admin","member","viewer"]},"status":{"enum":["active","pending"]},"lastActiveAt":{"type":["string","null"]}},"required":["id","name","role","status","lastActiveAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members/{id}":{"get":{"operationId":"get-members","summary":"Get members","tags":["members"],"security":[{"ApiKey":[]},{"OAuth":["members:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string"},"role":{"enum":["admin","member","viewer"]},"status":{"enum":["active","pending"]},"lastActiveAt":{"type":["string","null"]}},"required":["id","name","role","status","lastActiveAt"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/invoices":{"get":{"operationId":"list-invoices","summary":"List invoices","tags":["invoices"],"security":[{"ApiKey":[]},{"OAuth":["invoices:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque nextCursor from the previous response; bound to this snapshot."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","nextCursor"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"amount":{"type":"number"},"currency":{"enum":["USD","EUR"]},"status":{"enum":["draft","due","overdue","paid"]},"issuedAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","format":"date-time"},"taxIdMasked":{"type":"string"},"refundedAmount":{"type":"number"}},"required":["id","accountId","amount","currency","status","issuedAt","dueAt","taxIdMasked","refundedAmount"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"save-invoice-draft","summary":"Save invoice draft","tags":["invoices"],"security":[{"ApiKey":[]},{"OAuth":["invoices:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"amount":{"type":"number","minimum":0.01,"maximum":10000000},"dueAt":{"type":"string","format":"date-time"}},"required":["generation","accountId","amount","dueAt"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"amount":{"type":"number"},"currency":{"enum":["USD","EUR"]},"status":{"enum":["draft","due","overdue","paid"]},"issuedAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","format":"date-time"},"taxIdMasked":{"type":"string"},"refundedAmount":{"type":"number"}},"required":["id","accountId","amount","currency","status","issuedAt","dueAt","taxIdMasked","refundedAmount"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/invoices/{id}":{"get":{"operationId":"get-invoices","summary":"Get invoices","tags":["invoices"],"security":[{"ApiKey":[]},{"OAuth":["invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"amount":{"type":"number"},"currency":{"enum":["USD","EUR"]},"status":{"enum":["draft","due","overdue","paid"]},"issuedAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","format":"date-time"},"taxIdMasked":{"type":"string"},"refundedAmount":{"type":"number"}},"required":["id","accountId","amount","currency","status","issuedAt","dueAt","taxIdMasked","refundedAmount"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/operations":{"get":{"operationId":"list-operations","summary":"List operations","tags":["operations"],"security":[{"ApiKey":[]},{"OAuth":["operations:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque nextCursor from the previous response; bound to this snapshot."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","nextCursor"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"export-workspace","summary":"Start asynchronous redacted workspace export","tags":["operations"],"security":[{"ApiKey":[]},{"OAuth":["operations:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1},"type":{"type":"string","enum":["export-workspace"]}},"required":["generation","type"],"additionalProperties":false}}}},"responses":{"202":{"description":"Pending operation; poll GET /api/v1/operations/{id}","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt","operation"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/operations/{id}":{"get":{"operationId":"get-operations","summary":"Get operations","tags":["operations"],"security":[{"ApiKey":[]},{"OAuth":["operations:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhook-deliveries":{"get":{"operationId":"list-webhook-deliveries","summary":"List webhook-deliveries","tags":["webhook-deliveries"],"security":[{"ApiKey":[]},{"OAuth":["webhooks:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque nextCursor from the previous response; bound to this snapshot."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","nextCursor"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"eventId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"endpointId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["pending","failed","succeeded","replay","cancelled"]},"attempts":{"type":"integer"},"lastStatus":{"type":["integer","null"]},"replayOf":{"type":["string","null"]}},"required":["id","eventId","endpointId","status","attempts","lastStatus","replayOf"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhook-deliveries/{id}":{"get":{"operationId":"get-webhook-deliveries","summary":"Get webhook-deliveries","tags":["webhook-deliveries"],"security":[{"ApiKey":[]},{"OAuth":["webhooks:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"eventId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"endpointId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["pending","failed","succeeded","replay","cancelled"]},"attempts":{"type":"integer"},"lastStatus":{"type":["integer","null"]},"replayOf":{"type":["string","null"]}},"required":["id","eventId","endpointId","status","attempts","lastStatus","replayOf"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/operations/{id}/download":{"get":{"operationId":"download-operation","summary":"Download a completed redacted export","tags":["operations"],"security":[{"ApiKey":[]},{"OAuth":["operations:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","minLength":1,"maxLength":200},"role":{"enum":["admin","member","viewer"]},"commercialStatus":{"enum":["trial","active","expired","past_due"]},"plan":{"enum":["Starter","Growth","Scale"]}},"required":["id","name","domain","role","commercialStatus","plan"],"additionalProperties":false},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"segment":{"enum":["Enterprise","Growth","Standard","Trial"]},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"health":{"enum":["healthy","watch","at-risk"]},"healthScore":{"type":"number"},"renewalAt":{"type":"string","format":"date-time"},"annualValue":{"type":"number"},"openRequestIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"projectIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"invoiceIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"integrationIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"notes":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","segment","ownerId","health","healthScore","renewalAt","openRequestIds","projectIds","integrationIds","notes","updatedAt"],"additionalProperties":false}},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"ownerId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"status":{"enum":["active","blocked","at-risk","complete"]},"progress":{"type":"number"},"blocker":{"type":["string","null"]},"nextMilestone":{"type":"string"},"dueAt":{"type":"string","format":"date-time"}},"required":["id","accountId","name","ownerId","status","progress","blocker","nextMilestone","dueAt"],"additionalProperties":false}},"work":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"priority":{"enum":["P1","P2","P3"]},"status":{"enum":["open","pending-customer","escalated","resolved"]},"assigneeId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"dueAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","title","description","priority","status","assigneeId","dueAt","createdAt","updatedAt"],"additionalProperties":false}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"amount":{"type":"number"},"currency":{"enum":["USD","EUR"]},"status":{"enum":["draft","due","overdue","paid"]},"issuedAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","format":"date-time"},"taxIdMasked":{"type":"string"},"refundedAmount":{"type":"number"}},"required":["id","accountId","amount","currency","status","issuedAt","dueAt","taxIdMasked","refundedAmount"],"additionalProperties":false}}},"required":["workspace","accounts","projects","work","invoices"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhook-deliveries/{id}/replay":{"post":{"operationId":"replay-delivery","summary":"Replay a webhook with its original event ID","tags":["webhook-deliveries"],"security":[{"ApiKey":[]},{"OAuth":["webhooks:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"integer","minimum":1}},"required":["generation"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["generation","sequence","workspaceId","data","receipt"],"properties":{"generation":{"type":"integer"},"sequence":{"type":"integer"},"workspaceId":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200}},"required":["id"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"command":{"type":"string"},"status":{"enum":["completed","pending"]},"actorId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"workspaceId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"generation":{"type":"integer"},"sequence":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"consequence":{"enum":["none","review","financial","irreversible","contractual"]},"message":{"type":"string"},"operationId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["id","command","status","actorId","workspaceId","generation","sequence","occurredAt","consequence","message"],"additionalProperties":false},"operation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"type":{"enum":["refund-invoice","export-workspace"]},"status":{"enum":["pending","completed","failed"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"receiptId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"error":{"type":"string"},"downloadPath":{"type":"string"}},"required":["id","type","status","createdAt","receiptId"],"additionalProperties":false}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health":{"get":{"operationId":"health","summary":"Authenticated connector health","tags":["Connectors"],"security":[{"ApiKey":[]},{"OAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ok"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/entitlements/{id}":{"get":{"operationId":"entitlement","summary":"Plan and SSO for signed workspace external ID","tags":["Connectors"],"security":[{"ApiKey":[]},{"OAuth":["entitlements:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["account_id","plan","sso"],"properties":{"account_id":{"type":"string"},"plan":{"type":"string"},"sso":{"type":"boolean"}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tickets":{"post":{"operationId":"ticket","summary":"Create support ticket; credential generation is its immutable precondition","tags":["Connectors"],"security":[{"ApiKey":[]},{"OAuth":["tickets:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,120}$"},"description":"Reuse the same key and exact request until its result is known."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"requester_email":{"type":"string","maxLength":254},"page_url":{"type":"string","maxLength":2048}},"required":["subject","body","requester_email"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ticket_id","status"],"properties":{"ticket_id":{"type":"string"},"status":{"type":"string","enum":["open"]}}}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Original response recovered without repeating its effect."}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"required":true,"schema":{"type":"integer","minimum":1}}}},"500":{"description":"Redacted internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response unknown after commit; replay original request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Transport timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}