{"openapi":"3.1.0","info":{"title":"Crewferry API","version":"v1","description":"Responses are `{ data, code, message, meta }`. Errors add RFC 9457 fields and use `application/problem+json`. Lists are cursor-paginated (`limit`, `cursor`)."},"servers":[{"url":"/api/v1"}],"components":{"securitySchemes":{"bearer_auth":{"type":"http","scheme":"bearer","description":"An organization API key: `Authorization: Bearer <key>`."},"session_cookie":{"type":"apiKey","in":"cookie","name":"__Host-crew.session_token","description":"The browser session (same-origin only)."}},"schemas":{"Workspace":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"member_count":{"type":"integer"},"created_at":{"type":["string","null"],"example":"2026-10-02T09:30:00.000Z"},"updated_at":{"type":["string","null"],"example":"2026-10-02T09:30:00.000Z"}},"required":["id","organization_id","name","slug","member_count","created_at","updated_at"]},"Meta":{"type":"object","properties":{"request_id":{"type":"string"}},"required":["request_id"],"additionalProperties":{}},"Problem":{"type":"object","properties":{"data":{"type":"null"},"code":{"type":"string","example":"not_found"},"message":{"type":"string"},"meta":{"$ref":"#/components/schemas/Meta"},"type":{"type":"string","example":"about:blank"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"}},"required":["data","code","message","meta","type","title","status","detail"]},"PlanUsage":{"type":"object","properties":{"plan":{"type":["object","null"],"properties":{"key":{"type":"string"},"name":{"type":"string"},"price_micro_usd":{"type":"integer"}},"required":["key","name","price_micro_usd"]},"plan_state":{"type":"string","enum":["free","off","trial","paid","none"]},"workspace_id":{"type":["string","null"],"format":"uuid"},"projects":{"type":"array","items":{"$ref":"#/components/schemas/UsageProject"}},"resets_at":{"type":"string"},"period":{"type":"object","properties":{"kind":{"type":"string","enum":["calendar","trial","paid","unpaid","none"]},"starts_at":{"type":"string"},"ends_at":{"type":"string"}},"required":["kind","starts_at","ends_at"]},"trial":{"type":["object","null"],"properties":{"ends_at":{"type":"string"}},"required":["ends_at"]},"balance":{"$ref":"#/components/schemas/AddonBalance"},"services":{"type":"array","items":{"$ref":"#/components/schemas/ServiceUsage"}},"addons":{"type":"array","items":{"$ref":"#/components/schemas/AddonGrant"}},"addon_spent_micro_usd":{"type":["integer","null"]},"addon_limit_micro_usd":{"type":["integer","null"]},"agent_email":{"type":"object","properties":{"agents":{"type":"integer"},"price_micro_usd":{"type":["integer","null"]}},"required":["agents","price_micro_usd"]},"can_buy":{"type":"boolean"},"start_plan_now":{"type":["object","null"],"properties":{"trial_ends_at":{"type":["string","null"]},"first_bill_micro_usd":{"type":"integer"}},"required":["trial_ends_at","first_bill_micro_usd"]}},"required":["plan","plan_state","workspace_id","projects","resets_at","period","trial","balance","services","addons","addon_spent_micro_usd","addon_limit_micro_usd","agent_email","can_buy","start_plan_now"]},"UsageProject":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"]},"AddonBalance":{"type":"object","properties":{"kind":{"type":"string","enum":["calendar","trial","paid","unpaid","none"]},"period_micro_usd":{"type":"integer"},"plan_left_micro_usd":{"type":"integer"},"extra_left_micro_usd":{"type":"integer"},"left_micro_usd":{"type":"integer"},"held_micro_usd":{"type":"integer"},"frozen_micro_usd":{"type":"integer"},"frozen_reason":{"type":["string","null"],"enum":["past_due","canceled","archived","no_plan","disputed",null]},"low":{"type":"boolean"},"resets_at":{"type":"string"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/BalanceGrant"}},"spend":{"type":"array","items":{"$ref":"#/components/schemas/BalanceSpend"}},"rates":{"type":"array","items":{"$ref":"#/components/schemas/AddonRate"}},"top_up":{"$ref":"#/components/schemas/TopUpBudget"},"top_up_open":{"type":"boolean"}},"required":["kind","period_micro_usd","plan_left_micro_usd","extra_left_micro_usd","left_micro_usd","held_micro_usd","frozen_micro_usd","frozen_reason","low","resets_at","grants","spend","rates","top_up","top_up_open"]},"BalanceGrant":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"source":{"type":"string","enum":["top_up","admin","converted","refund"]},"amount_micro_usd":{"type":"integer"},"left_micro_usd":{"type":"integer"},"expires_at":{"type":["string","null"]},"disputed":{"type":"boolean"},"by":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","source","amount_micro_usd","left_micro_usd","expires_at","disputed","by","created_at"]},"BalanceSpend":{"type":"object","properties":{"service":{"type":"string"},"unit_label":{"type":"string"},"units":{"type":"integer"},"calls":{"type":"integer"},"charged_micro_usd":{"type":"integer"}},"required":["service","unit_label","units","calls","charged_micro_usd"]},"AddonRate":{"type":"object","properties":{"path":{"type":"string"},"service":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"micro_usd":{"type":"integer"},"estimated":{"type":"boolean"}},"required":["path","service","label","unit","micro_usd","estimated"]},"TopUpBudget":{"type":["object","null"],"properties":{"min_usd":{"type":"integer"},"limit_micro_usd":{"type":"integer"},"spent_micro_usd":{"type":"integer"},"attempts_left_24h":{"type":"integer"}},"required":["min_usd","limit_micro_usd","spent_micro_usd","attempts_left_24h"]},"ServiceUsage":{"type":"object","properties":{"service":{"type":"string"},"unit_label":{"type":"string"},"included":{"type":["integer","null"]},"addons":{"type":"integer"},"used":{"type":"integer"},"left":{"type":["integer","null"]},"daily_cap":{"type":["integer","null"]},"used_today":{"type":"integer"},"left_today":{"type":["integer","null"]},"enforce":{"type":"boolean"},"unit_cost_micro_usd":{"type":"integer"},"cost_micro_usd":{"type":"integer"},"resets_at":{"type":"string"},"pack":{"$ref":"#/components/schemas/AddonPack"}},"required":["service","unit_label","included","addons","used","left","daily_cap","used_today","left_today","enforce","unit_cost_micro_usd","cost_micro_usd","resets_at","pack"]},"AddonPack":{"type":["object","null"],"properties":{"key":{"type":"string"},"size":{"type":"integer"},"price_micro_usd":{"type":"integer"}},"required":["key","size","price_micro_usd"]},"AddonGrant":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"service":{"type":"string"},"unit_label":{"type":"string"},"units":{"type":"integer"},"price_micro_usd":{"type":["integer","null"]},"by":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","service","unit_label","units","price_micro_usd","by","created_at"]}},"parameters":{}},"paths":{"/organizations/{organization_id}/workspaces":{"get":{"security":[{"bearer_auth":[]},{"session_cookie":[]}],"summary":"List the organization's workspaces","description":"Cursor-paginated by ID (creation order).","tags":["workspaces"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"organization_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size, 1–100.","example":20},"required":false,"description":"Page size, 1–100.","name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid","description":"The `next_cursor` from the previous page."},"required":false,"description":"The `next_cursor` from the previous page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of workspaces","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}},"code":{"type":"string","enum":["ok"]},"message":{"type":["string","null"]},"meta":{"allOf":[{"$ref":"#/components/schemas/Meta"},{"type":"object","properties":{"pagination":{"type":"object","properties":{"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"},"limit":{"type":"integer"}},"required":["next_cursor","has_more","limit"]}},"required":["pagination"],"additionalProperties":{}}]}},"required":["data","code","message","meta"]}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Not signed in, or no valid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Signed in, but the role is not enough (`meta.required_role`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found (also for other organizations' data)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict (`meta.field`), or `client_outdated`","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed (`meta.errors[{ field, code, message }]`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limited (`meta.retry_after`, `Retry-After`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Server error (only the request ID is shown)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/workspaces/{workspace_id}":{"get":{"security":[{"bearer_auth":[]},{"session_cookie":[]}],"summary":"Get a workspace","tags":["workspaces"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workspace_id","in":"path"}],"responses":{"200":{"description":"The workspace","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workspace"},"code":{"type":"string","enum":["ok"]},"message":{"type":["string","null"]},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","code","message","meta"]}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Not signed in, or no valid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Signed in, but the role is not enough (`meta.required_role`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found (also for other organizations' data)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict (`meta.field`), or `client_outdated`","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed (`meta.errors[{ field, code, message }]`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limited (`meta.retry_after`, `Retry-After`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Server error (only the request ID is shown)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/organizations/{organization_id}/usage":{"get":{"security":[{"bearer_auth":[]},{"session_cookie":[]}],"summary":"One project's add-on balance","description":"The project's add-on balance (ADR 0239) in millionths of a dollar: the period's own dollars and what is left of them, grants (top-ups, and dollars given by Crewferry) with what is left and when they expire, what is frozen and why, this period's spend by service, what calls are charged now, and (for owners and admins signed in) the organization's top-up budget (`addon_spent_micro_usd` and `addon_limit_micro_usd` are null otherwise). Each paid call is charged what it costs. Calls answered by the organization's own connected accounts are never charged. `services`, `addons`, `addon_spent_micro_usd`, `addon_limit_micro_usd` and `can_buy` are deprecated (see the `Deprecation` and `Sunset` headers): use `balance`.","tags":["usage"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"organization_id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"The project's add-on balance","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanUsage"},"code":{"type":"string","enum":["ok"]},"message":{"type":["string","null"]},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","code","message","meta"]}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Not signed in, or no valid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Signed in, but the role is not enough (`meta.required_role`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found (also for other organizations' data)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict (`meta.field`), or `client_outdated`","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed (`meta.errors[{ field, code, message }]`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limited (`meta.retry_after`, `Retry-After`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Server error (only the request ID is shown)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/routines/{trigger_id}/start":{"post":{"security":[{"bearer_auth":[]},{"session_cookie":[]}],"summary":"Start a routine now from its URL trigger (Bearer: the trigger's token)","description":"Send `Authorization: Bearer <token>` and optionally `{ \"text\": \"…\" }` (at most 65,536 characters): the run reads the text as outside data, never as instructions. At most 30 starts an hour per routine (429 with Retry-After). An unknown or switched-off trigger, or a wrong token, is 404.","tags":["Routines"],"parameters":[{"schema":{"type":"string","maxLength":64},"required":true,"name":"trigger_id","in":"path"}],"responses":{"200":{"description":"The run it started","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"run_id":{"type":"string","format":"uuid"},"job_id":{"type":"string","format":"uuid"}},"required":["run_id","job_id"]},"code":{"type":"string","enum":["ok"]},"message":{"type":["string","null"]},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","code","message","meta"]}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Not signed in, or no valid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Signed in, but the role is not enough (`meta.required_role`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found (also for other organizations' data)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict (`meta.field`), or `client_outdated`","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed (`meta.errors[{ field, code, message }]`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limited (`meta.retry_after`, `Retry-After`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Server error (only the request ID is shown)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"webhooks":{}}