{"openapi":"3.1.0","info":{"title":"VariantGate API","description":"Agents ask for approval; people decide. Send `Authorization: Bearer <token>`: a Supabase access token for a person, or an agent key for an agent.","license":{"name":""},"version":"0.1.0"},"paths":{"/healthz":{"get":{"tags":["health"],"summary":"The process is up. Does not touch the database.","operationId":"live","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthView"}}}}}}},"/readyz":{"get":{"tags":["health"],"summary":"The process can reach its database and may receive traffic.","operationId":"ready","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthView"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthView"}}}}}}},"/v1/billing":{"get":{"tags":["billing"],"summary":"Says whether plans can be bought on this server. Anyone may ask.","operationId":"get_billing","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingView"}}}}}}},"/v1/decision-links/decide":{"post":{"tags":["inbox"],"summary":"Records the decision an emailed link is for, in the name of the member\nit was sent to, exactly as the inbox would. The link is used up, and so\nis that member's other link for the request.","description":"A request a rule sent to other people is refused, as in the inbox, until\nit escalates; the link is kept, so it works once the request escalates.","operationId":"decide_by_link","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkDecisionBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestView"}}}},"403":{"description":"A rule sent it to other people, and it has not escalated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No usable link has this secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"Already decided, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/decision-links/view":{"post":{"tags":["inbox"],"summary":"Shows the request an emailed link is for, and what it would record.\nDecides nothing.","description":"A secret that is wrong, used, ended, or sent to someone who has since\nleft the workspace all look the same.","operationId":"view_decision_link","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionLinkView"}}}},"404":{"description":"No usable link has this secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/inquiries":{"post":{"tags":["contact"],"summary":"Sends an Enterprise inquiry to the team. Anyone may call this. Answers\n202 once it is sent, and also, without sending anything, when the\nhidden `website` field is filled in.","operationId":"send_inquiry","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InquiryBody"}}},"required":true},"responses":{"202":{"description":"Sent"},"404":{"description":"This server takes no inquiries; write to the support address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"Too many from this address this hour","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/invitations/accept":{"post":{"tags":["members"],"summary":"Joins the workspace an invitation is for. The invitation is used up.","description":"A secret that is wrong, expired, withdrawn or already used all look the\nsame, so a link cannot be probed.","operationId":"accept_invitation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace needs a higher plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"Already a member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"Already in as many workspaces as allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/me":{"get":{"tags":["account"],"summary":"Who is signed in, and which workspaces they can open.","operationId":"get_me","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"delete":{"tags":["account"],"summary":"Deletes the signed-in person's account for good. Workspaces nobody else\nis in are deleted, as `DELETE /v1/workspaces/{id}` does, plan included.\nShared workspaces are left: the person's push devices, email settings,\nweekly summaries and unused join links there go, while their past decisions and changes\nstay in those workspaces' sealed records. Refused while they are the\nonly owner of a workspace with other people in it. Their sign-in is\ndeleted last.","operationId":"delete_account","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountBody"}}},"required":true},"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"This server cannot delete accounts, they are the only owner of a shared workspace, or their workspaces changed meanwhile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The email does not match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"502":{"description":"Stripe or the sign-in service failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/push":{"get":{"tags":["account"],"summary":"Says whether push notifications are on, and the key to subscribe with.","operationId":"get_push","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/requests":{"post":{"tags":["agent"],"summary":"Asks a person to approve an action.","operationId":"agent_create_request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRequestBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace's plan has no requests left this month","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"A person's token was sent, or the action is outside this key's scope (`action_out_of_scope`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"This key has used up its minute","headers":{"Retry-After":{"schema":{"type":"integer","format":"int64","minimum":0},"description":"Seconds until the key may call again"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"agent":[]}]}},"/v1/requests/{request_id}":{"get":{"tags":["agent"],"summary":"Reads a request's current state. Act only when `allowed` is true. Pass\n`wait_seconds` to wait for the answer instead of calling again and again.","operationId":"agent_get_request","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wait_seconds","in":"query","description":"Hold the call open for up to this many seconds (0 to 30) while the\nrequest is still pending, and answer as soon as it is decided.","required":false,"schema":{"type":"integer","format":"int64","minimum":0}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"This key has used up its minute","headers":{"Retry-After":{"schema":{"type":"integer","format":"int64","minimum":0},"description":"Seconds until the key may call again"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"agent":[]}]}},"/v1/requests/{request_id}/outcome":{"post":{"tags":["agent"],"summary":"Says how an approved action went, so the record shows not only that it\nwas allowed but whether it was done. Reported once, by the key that asked.","operationId":"agent_report_outcome","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"Not approved, or already reported","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"agent":[]}]}},"/v1/requests/{request_id}/withdraw":{"post":{"tags":["agent"],"summary":"Takes back a request nobody has decided yet: the plan changed, or the\nagent no longer needs it. Only the key that asked may do this.","operationId":"agent_withdraw_request","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"Already decided, withdrawn or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"agent":[]}]}},"/v1/weekly-summary/unsubscribe":{"post":{"tags":["account"],"summary":"Turns off the weekly summary an emailed link was sent for: one person's,\nof one workspace. Using a link twice changes nothing more. They can turn\nit back on under Settings.","description":"A secret that is wrong, or sent to someone who has since left the\nworkspace, looks the same.","operationId":"unsubscribe_weekly_summary","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribeBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribedView"}}}},"404":{"description":"No usable link has this secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/workspaces":{"post":{"tags":["account"],"summary":"Creates a workspace owned by the caller.","operationId":"create_workspace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}":{"delete":{"tags":["account"],"summary":"Deletes the workspace and everything in it for good: requests and their\ndecisions, the sealed record and activity log, rules, agent keys,\ninvitations and settings. Everyone in it loses access. Only owners may\ndo this. A paid plan is cancelled with Stripe first, with a final\ninvoice for what was used and not billed yet; if Stripe cannot do that,\nnothing is deleted.","operationId":"delete_workspace","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteWorkspaceBody"}}},"required":true},"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The name does not match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"502":{"description":"Stripe could not end the plan; nothing was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/activity":{"get":{"tags":["activity"],"summary":"Lists who changed what in the workspace, newest first: agent keys,\nrules, the pause, people, invitations, notifications, webhooks and the\nplan.","operationId":"list_activity","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"kind","in":"query","description":"Only changes of this family, such as `key` for every `key.…` kind.","required":false,"schema":{"type":"string","description":"A family of changes, the part of a kind before the dot.","enum":["key","rule","workspace","member","invitation","notifications","plan","webhook"]}},{"name":"before","in":"query","description":"Only entries older than this `seq`. Leave out to start at the newest.","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"How many to return, 1 to 200. Defaults to 50.","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/activity/export":{"get":{"tags":["activity"],"summary":"Downloads the activity log as CSV, newest first: one change per line,\nwith its place in the sealed record and its hash.","description":"One file holds at most the 10,000 most recent changes. When older ones\nwere left out, the `x-record-complete` response header is `false`.","operationId":"export_activity","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"headers":{"x-record-complete":{"schema":{"type":"string"},"description":"`false` when changes older than the newest 10,000 were left out"}},"content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace needs a higher plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/agent-keys":{"get":{"tags":["agent-keys"],"summary":"Lists a workspace's agent keys, newest first.","operationId":"list_agent_keys","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentKeyListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"post":{"tags":["agent-keys"],"summary":"Creates an agent key. Only workspace owners may do this.","operationId":"create_agent_key","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentKeyBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedAgentKeyView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace's plan has no agent keys left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/agent-keys/{key_id}":{"delete":{"tags":["agent-keys"],"summary":"Revokes an agent key at once. Only workspace owners may do this.","operationId":"revoke_agent_key","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/agent-keys/{key_id}/pause":{"put":{"tags":["agent-keys"],"summary":"Pauses one agent key. Until it is resumed, nothing that agent asks for is\nallowed, whatever was approved, and no rule approves it. Any member may\ndo this.","operationId":"pause_agent_key","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"delete":{"tags":["agent-keys"],"summary":"Lets a paused agent act again on what was approved. Only owners may.","operationId":"resume_agent_key","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/agent-keys/{key_id}/scope":{"put":{"tags":["agent-keys"],"summary":"Sets which actions an agent key may ask for. Takes effect on the key's\nnext request. Only workspace owners may do this.","operationId":"set_key_scope","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyScopeBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentKeyView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/agents/report":{"get":{"tags":["agent-keys"],"summary":"Shows, per agent key, what it asked for over the period and how that\nwent.","operationId":"get_agent_report","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"days","in":"query","description":"How many days the report covers, today included: 30, 90 or 365.\nDefaults to 30.","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentReportListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace needs a higher plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/billing":{"get":{"tags":["billing"],"summary":"Shows a workspace's plan and how it is paid for.","operationId":"get_workspace_billing","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceBillingView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/billing/checkout":{"post":{"tags":["billing"],"summary":"Starts paying for a plan. Returns a Stripe Checkout page to send the\nperson to. Only owners may do this, and only while the workspace has no\nsubscription; an existing one is changed in the billing portal. While a\ncheckout is open, asking again for the same plan gives the same page,\nand asking for another plan, or another way of paying, closes the open\none first. Team and Business can be paid per request: no seats, a\nmonthly bill for the requests agents made, and a monthly request cap.","operationId":"start_checkout","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedirectView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"Billing is off, or the workspace already pays or has just paid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The plan cannot be bought","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/billing/portal":{"post":{"tags":["billing"],"summary":"Opens Stripe's billing portal, where an owner changes or ends the plan,\nupdates the card and downloads invoices.","operationId":"open_portal","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedirectView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"Billing is off, or the workspace never paid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/email-preference":{"put":{"tags":["account"],"summary":"Turns your own emails about this workspace on or off: about waiting\nrequests, and the weekly summary. Give at least one. Every member\nchooses for themself; nobody can change it for someone else.","operationId":"set_email_preference","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailPreferenceBody"}}},"required":true},"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/insights":{"get":{"tags":["insights"],"summary":"Shows how approvals went over the period and the one before it: how\nrequests ended, how fast people decided, per action, per person and per\ncurrency. Owners also get the rules worth writing.","operationId":"get_insights","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"days","in":"query","description":"How many days to cover, today included: 7, 30 or 90. Defaults to 30.","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightsView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/insights/dismissals":{"post":{"tags":["insights"],"summary":"Hides the rule suggestion for one agent key and action, for every owner\nof the workspace. Only owners, who see suggestions, may.","operationId":"dismiss_suggestion","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissBody"}}},"required":true},"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/invitations":{"get":{"tags":["members"],"summary":"Lists the invitations that can still be used. Only owners may see them.","operationId":"list_invitations","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"post":{"tags":["members"],"summary":"Creates an invitation. Only workspace owners may do this.","operationId":"create_invitation","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedInvitationView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace needs a higher plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/invitations/{invitation_id}":{"delete":{"tags":["members"],"summary":"Withdraws an invitation, so its link stops working.","operationId":"revoke_invitation","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/members":{"get":{"tags":["members"],"summary":"Lists the people in a workspace, in the order they joined.","operationId":"list_members","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/members/{user_id}":{"delete":{"tags":["members"],"summary":"Removes a person from a workspace. An owner may remove anyone; anyone\nmay remove themselves. The last owner cannot be removed.","operationId":"remove_member","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"They are the last owner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/members/{user_id}/role":{"put":{"tags":["members"],"summary":"Makes someone an owner or a member. Only owners may do this, themselves\nincluded, and the last owner cannot be made a member. The change is kept\nin the activity log; giving someone the role they have changes nothing.","operationId":"change_role","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"They are the last owner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/name":{"put":{"tags":["account"],"summary":"Gives the workspace a new name, which everyone in it sees. The change is\nkept in the activity log. Only workspace owners may do this.","operationId":"rename_workspace","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameWorkspaceBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/notifications":{"put":{"tags":["account"],"summary":"Announces every request that needs a person in a chat channel: Slack,\nMicrosoft Teams or Discord. The webhook replaces any set before, so a\nworkspace announces in one place. It is stored but never shown again.\nOnly workspace owners may set this.","operationId":"set_notifications","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationsBody"}}},"required":true},"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"delete":{"tags":["account"],"summary":"Stops announcing requests and forgets the webhook.","operationId":"clear_notifications","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/pause":{"put":{"tags":["account"],"summary":"Stops every agent in the workspace at once. Any member may do this,\nbecause stopping is always the safe direction.","operationId":"pause","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"delete":{"tags":["account"],"summary":"Lets agents act again on what was approved. Only workspace owners may do\nthis.","operationId":"resume","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/push-devices":{"get":{"tags":["account"],"summary":"Lists the browsers that get your push notifications from this workspace.","operationId":"list_push_devices","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushDeviceListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"post":{"tags":["account"],"summary":"Sends your push notifications for this workspace to this browser.\nSubscribing the same browser again only refreshes it.","operationId":"add_push_device","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushDeviceView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"Push notifications are off on this server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/push-devices/{device_id}":{"delete":{"tags":["account"],"summary":"Stops sending your push notifications for this workspace to a browser.","operationId":"remove_push_device","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"device_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/record/entries":{"get":{"tags":["inbox"],"summary":"Lists the entries of the workspace's sealed record, oldest first, so\nanyone can recompute the chain without trusting this server.","operationId":"list_record_entries","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"after","in":"query","description":"Only entries after this number. Leave out to start at the first.","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"How many to return, 1 to 1000. Defaults to 1000.","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordEntriesView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/record/verify":{"get":{"tags":["inbox"],"summary":"Recomputes the workspace's record chain from its first entry to its\nlatest, and says whether it is intact.","operationId":"verify_record","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordCheckView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/request-cap":{"put":{"tags":["billing"],"summary":"Sets the most requests a month the workspace takes while it pays per\nrequest. Past it, agents are told they are not allowed until the next\nmonth or a higher cap. The cap is kept when the workspace pays another\nway, and applies again if it goes back to paying per request. Only\nowners may do this; the change is logged.","operationId":"set_request_cap","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCapBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The cap is below 100 or above 1,000,000","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/requests":{"get":{"tags":["inbox"],"summary":"Lists a workspace's requests, newest first.","operationId":"list_requests","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","description":"Only requests in this state right now.","required":false,"schema":{"$ref":"#/components/schemas/Status"}},{"name":"settled","in":"query","description":"Only requests that are no longer waiting: decided or expired.","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many to return, 1 to 200. Defaults to 50.","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"agent_key_id","in":"query","description":"Only requests made with this agent key.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"action","in":"query","description":"Only requests for this action, such as `email.send`, or a family such\nas `email.*`.","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Only requests whose summary, agent name or action contains this text,\nignoring case. Up to 200 characters.","required":false,"schema":{"type":"string"}},{"name":"amount_above","in":"query","description":"Only requests whose amount is above this number, in whatever currency\neach states, such as `500`. Requests without an amount are left out.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/requests/export":{"get":{"tags":["inbox"],"summary":"Downloads what was decided or expired, newest first, as CSV.","description":"`record_seq` and `record_hash` name each request's latest entry in the\nsealed record; they are empty for a request from before the seal.\n\nOne file holds at most the 10,000 most recent rows. When older ones were\nleft out, the `x-record-complete` response header is `false`.","operationId":"export_requests","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"headers":{"x-record-complete":{"schema":{"type":"string"},"description":"`false` when rows older than the newest 10,000 were left out"}},"content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace needs a higher plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/requests/{request_id}":{"get":{"tags":["inbox"],"summary":"Shows one request.","operationId":"get_request","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/requests/{request_id}/decision":{"post":{"tags":["inbox"],"summary":"Approves or denies a pending request. A decision is final.","description":"A request a rule sent to certain people may be decided only by them and\nby workspace owners until it escalates; then by any member.","operationId":"decide_request","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace needs a higher plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"A rule sent it to other people, and it has not escalated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"Already decided, or expired, or another approver chose other changes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/rules":{"get":{"tags":["rules"],"summary":"Lists a workspace's rules, oldest first.","operationId":"list_rules","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"post":{"tags":["rules"],"summary":"Writes a rule. Only workspace owners may do this, because an `allow` rule\napproves requests in advance in the owner's name.","operationId":"create_rule","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace needs a higher plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/rules/test":{"post":{"tags":["rules"],"summary":"Shows what a request would get right now, and why: allowed or denied at\nonce, refused, or waiting for a person, with the rules that match. Nothing\nis stored, nobody is told, and nothing counts toward the plan.","operationId":"test_rules","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleTestBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleTestView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"An agent key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/rules/{rule_id}":{"delete":{"tags":["rules"],"summary":"Removes a rule. Requests it already decided stay decided.","operationId":"delete_rule","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/stats":{"get":{"tags":["inbox"],"summary":"Shows what happened in the workspace over the last 30 days.","operationId":"get_stats","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/usage":{"get":{"tags":["account"],"summary":"Shows the workspace's plan and this month's usage.","operationId":"get_usage","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/webhooks":{"get":{"tags":["webhooks"],"summary":"Lists a workspace's webhooks, oldest first. Every member may look.","operationId":"list_webhooks","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]},"post":{"tags":["webhooks"],"summary":"Adds a webhook and returns its signing secret, once. Only owners may add\none, a workspace has at most five, and it needs the Pro plan or higher.","operationId":"create_webhook","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWebhookView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The workspace's plan has no webhooks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/webhooks/{webhook_id}":{"delete":{"tags":["webhooks"],"summary":"Removes a webhook. Nothing more is sent to it, including what was still\nwaiting to be tried again. Only owners may do this.","operationId":"delete_webhook","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/webhooks/{webhook_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"The webhook's latest 50 deliveries, newest first. Every member may look.","operationId":"list_webhook_deliveries","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryListView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/webhooks/{webhook_id}/enabled":{"put":{"tags":["webhooks"],"summary":"Turns a webhook off or on. Only owners may do this.","operationId":"set_webhook_enabled","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEnabledBody"}}},"required":true},"responses":{"204":{},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/webhooks/{webhook_id}/secret":{"post":{"tags":["webhooks"],"summary":"Replaces a webhook's signing secret and returns the new one, once. Only\nowners may do this.","operationId":"rotate_webhook_secret","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecretView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}},"/v1/workspaces/{workspace_id}/webhooks/{webhook_id}/test":{"post":{"tags":["webhooks"],"summary":"Queues a `webhook.test` event for one webhook, whatever events it asked\nfor. It is sent like any other, within seconds. Only owners may do this.","operationId":"test_webhook","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestView"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"The webhook is turned off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{"user":[]}]}}},"components":{"schemas":{"AcceptInvitationBody":{"type":"object","required":["secret"],"properties":{"secret":{"type":"string","description":"The secret from the join link."}},"additionalProperties":false},"ActionInsightView":{"type":"object","description":"How one action's requests ended.","required":["action","requests","approved","denied","expired","waiting","withdrawn"],"properties":{"action":{"type":"string"},"approved":{"type":"integer","format":"int64"},"denied":{"type":"integer","format":"int64"},"expired":{"type":"integer","format":"int64","description":"Nobody answered in time."},"median_decision_seconds":{"type":["number","null"],"format":"double","description":"The middle time from asking to a person's decision, in seconds, or\nnull when no person decided any."},"requests":{"type":"integer","format":"int64"},"waiting":{"type":"integer","format":"int64"},"withdrawn":{"type":"integer","format":"int64"}}},"ActionView":{"type":"object","description":"How often one action was asked for.","required":["action","count"],"properties":{"action":{"type":"string"},"count":{"type":"integer","format":"int64"}}},"ActivityEntryView":{"type":"object","description":"One change to the workspace, as sealed in its record.","required":["seq","at","kind","by","target","details","hash"],"properties":{"at":{"type":"string","format":"date-time"},"by":{"type":"string","description":"Who made the change: a person's email, or `Stripe`."},"by_user_id":{"type":["string","null"],"format":"uuid","description":"The person's id; null when Stripe made the change."},"details":{"type":"object","description":"What this kind adds, such as a key's scope or a rule's effect. A\nwebhook URL or signing secret is never among them."},"hash":{"type":"string","description":"The entry's hash: `hex(SHA-256(prev_hash || payload))`."},"kind":{"type":"string","description":"What changed: `key.created`, `key.revoked`, `key.paused`,\n`key.resumed`, `key.scope_changed`, `rule.created`, `rule.deleted`,\n`workspace.paused`, `workspace.resumed`, `workspace.renamed`,\n`member.joined`, `member.removed`, `member.role_changed`,\n`invitation.created`, `invitation.revoked`, `notifications.changed`,\n`plan.changed`, `plan.cap_changed`, `webhook.created`,\n`webhook.deleted`, `webhook.enabled`, `webhook.disabled` or\n`webhook.secret_rotated`."},"seq":{"type":"integer","format":"int64","description":"The entry's place in the sealed record."},"target":{"type":"string","description":"What it was made to, by name: a key's name, a rule's action, the\nworkspace's name, a person's email, an invitation's role,\n`Slack webhook`, a webhook endpoint's label or a plan."},"target_id":{"type":["string","null"],"format":"uuid"}}},"ActivityListView":{"type":"object","required":["entries"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/ActivityEntryView"},"description":"Newest first."},"next_before":{"type":["integer","null"],"format":"int64","description":"Pass as `before` for the next page; null on the last page."}}},"AgentKeyListView":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/AgentKeyView"}}}},"AgentKeyView":{"type":"object","description":"An agent key, without its secret.","required":["id","name","prefix","created_at","scope"],"properties":{"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time","description":"When the key stops working, if it ever does. After this moment it is\nrefused exactly like a revoked key."},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"paused_at":{"type":["string","null"],"format":"date-time","description":"Set while the key is paused: nothing it asks for is allowed."},"paused_by":{"type":["string","null"],"description":"Email of the person who paused the key, while it is paused."},"prefix":{"type":"string","description":"The first characters of the key, to tell keys apart."},"revoked_at":{"type":["string","null"],"format":"date-time","description":"Set once the key has been revoked and no longer works."},"scope":{"type":"array","items":{"type":"string"},"description":"The action patterns the key may ask for, such as `deploy.*`. Empty\nwhen it may ask for any action."}}},"AgentReportListView":{"type":"object","required":["days","since","agents"],"properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentReportView"},"description":"Busiest agent first."},"days":{"type":"integer","format":"int64","description":"How many days the report covers, today included."},"since":{"type":"string","format":"date","description":"The first day of the period, in UTC, as `YYYY-MM-DD`."}}},"AgentReportView":{"type":"object","description":"What one agent key did in the period.","required":["key_id","name","revoked","requests","approved","denied","expired","waiting","withdrawn","by_rule","by_person","succeeded","failed","not_reported","approved_amounts","top_actions","days"],"properties":{"approved":{"type":"integer","format":"int64"},"approved_amounts":{"type":"array","items":{"$ref":"#/components/schemas/AmountTotal"},"description":"Money approved, one entry per currency."},"by_person":{"type":"integer","format":"int64","description":"Decisions a person made."},"by_rule":{"type":"integer","format":"int64","description":"Decisions a standing rule made."},"days":{"type":"array","items":{"$ref":"#/components/schemas/DayView"},"description":"Requests per UTC day, oldest first. Days without any are left out."},"denied":{"type":"integer","format":"int64"},"expired":{"type":"integer","format":"int64"},"failed":{"type":"integer","format":"int64","description":"Approved actions the agent reported as failed."},"key_id":{"type":"string","format":"uuid"},"last_request_at":{"type":["string","null"],"format":"date-time"},"median_decision_seconds":{"type":["number","null"],"format":"double","description":"Middle time from asking to a person's decision, in seconds, or null\nwhen no person decided anything."},"name":{"type":"string","description":"The name the owner gave the key."},"not_reported":{"type":"integer","format":"int64","description":"Approved actions the agent has said nothing about."},"requests":{"type":"integer","format":"int64"},"revoked":{"type":"boolean","description":"Whether the key has been revoked. A revoked key is listed only when\nit asked for something in the period."},"succeeded":{"type":"integer","format":"int64","description":"Approved actions the agent reported as done."},"top_actions":{"type":"array","items":{"$ref":"#/components/schemas/ActionView"},"description":"Up to five actions, most asked for first."},"waiting":{"type":"integer","format":"int64"},"withdrawn":{"type":"integer","format":"int64"}}},"AgentStatsView":{"type":"object","description":"What one agent key asked for in the period.","required":["approved","denied","expired","waiting","withdrawn","last_request_at"],"properties":{"approved":{"type":"integer","format":"int64"},"denied":{"type":"integer","format":"int64"},"expired":{"type":"integer","format":"int64"},"key_id":{"type":["string","null"],"format":"uuid","description":"The key's id, or null for requests whose key no longer exists."},"last_request_at":{"type":"string","format":"date-time"},"name":{"type":["string","null"],"description":"The name the owner gave the key, or null when the key is gone."},"waiting":{"type":"integer","format":"int64"},"withdrawn":{"type":"integer","format":"int64","description":"Taken back by the agent before anyone decided."}}},"AmountInput":{"oneOf":[{"type":"string","description":"The amount as text, such as `\"129.00\"`. Always read exactly."},{"type":"number","format":"double","description":"The amount as a number, such as `129.5`. A whole number is read\nexactly; one with decimals only below 100,000,000,000."}],"description":"An amount of money as an agent or a person may write it."},"AmountTotal":{"type":"object","description":"Money approved in one currency.","required":["amount","currency"],"properties":{"amount":{"type":"string","description":"The total, as a decimal string such as `\"1250.00\"`."},"currency":{"type":"string"}}},"ApprovalView":{"type":"object","description":"One person's approval.","required":["user_id","by","at"],"properties":{"at":{"type":"string","format":"date-time"},"by":{"type":"string","description":"Email of the person who approved."},"changed_amount":{"type":["string","null"],"description":"The lower amount they approved, in the request's currency, when they\nchanged it."},"changed_summary":{"type":["string","null"],"description":"The wording they approved, when they changed it. Everyone who\napproves after them must approve the same changes."},"note":{"type":["string","null"],"description":"What they said with their approval, if anything."},"user_id":{"type":"string","format":"uuid"}}},"ApprovedView":{"type":"object","description":"What the agent may act on once a request is approved.","required":["changed"],"properties":{"approved_amount":{"type":["string","null"],"description":"Once approved, the most money the action may move, in `currency`:\nthe person's lower amount, or the agent's own. Null when the request\nstates no amount, or is not approved."},"approved_summary":{"type":["string","null"],"description":"Once approved, the wording to act on: the person's change, or the\nagent's own summary when they made none."},"changed":{"type":"boolean","description":"True when the person who approved changed the wording or lowered the\namount. The agent may then do only the changed version: act on\n`approved_summary` and `approved_amount`, never on `summary` and\n`amount`."}}},"AssigneeView":{"type":"object","description":"One person a request is for.","required":["user_id","email"],"properties":{"email":{"type":"string","description":"Their email as it was when the request was asked."},"user_id":{"type":"string","format":"uuid"}}},"BillingView":{"type":"object","description":"Whether plans can be bought on this server.","required":["enabled","plans","per_request_plans"],"properties":{"enabled":{"type":"boolean","description":"False when the server has no payment provider: paid plans are then\narranged by email."},"per_request_plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"},"description":"The plans that can also be paid per request here instead of per\nperson: Team and Business, when their per-request prices are set."},"plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"},"description":"The plans that can be bought here, empty when billing is off."}}},"BudgetTestView":{"type":"object","description":"Where the budget of a covering rule stands.","required":["rule_id","total","used","left","currency","period","fits"],"properties":{"currency":{"type":"string","description":"Three-letter currency code of the three amounts."},"fits":{"type":"boolean","description":"Whether the rule would approve this request out of what is left."},"left":{"type":"string","description":"What is left of it."},"period":{"$ref":"#/components/schemas/Period"},"rule_id":{"type":"string","format":"uuid"},"total":{"type":"string","description":"The most the rule may approve in total per period, such as `500.00`."},"used":{"type":"string","description":"What it has approved in the current period."}}},"ChangesBody":{"type":"object","description":"What to change while approving. The agent may then do only the changed\nversion. Only an approval can carry changes, and an amount can only go\ndown.","properties":{"amount":{"oneOf":[{"$ref":"#/components/schemas/AmountInput","description":"The amount the agent may move instead of what it stated: the same or\nlower, never higher, and only on a request that states one."},{"type":"null"}]},"currency":{"type":["string","null"],"description":"Currency of `amount`. Defaults to the request's own; any other is\nrefused."},"summary":{"type":["string","null"],"description":"The wording the agent must act on instead of its own. Up to 2000\ncharacters."}},"additionalProperties":false},"ChatService":{"type":"string","description":"A chat service a workspace can announce waiting requests in.","enum":["slack","teams","discord"]},"CheckoutBody":{"type":"object","required":["plan"],"properties":{"per_request":{"type":"boolean","description":"Pay for Team or Business per request instead of per person. Pro\ncannot be paid per request."},"plan":{"$ref":"#/components/schemas/Plan","description":"`pro`, `team` or `business`."}},"additionalProperties":false},"CreateAgentKeyBody":{"type":"object","required":["name"],"properties":{"expires_at":{"type":["string","null"],"format":"date-time","description":"When the key stops working: in the future, and at most five years\naway. Leave out for a key that works until it is revoked."},"name":{"type":"string","description":"What the key is for, 1 to 100 characters."},"scope":{"type":"array","items":{"type":"string"},"description":"The actions the key may ask for, in the same patterns as rules:\n`refund.create`, or a family such as `deploy.*`. At most 20. Leave\nout, or send an empty list, for any action."}},"additionalProperties":false},"CreateInvitationBody":{"type":"object","required":["note","role"],"properties":{"note":{"type":"string","description":"Who the invitation is for, 1 to 200 characters. A reminder only: it\nis never checked against who accepts."},"role":{"$ref":"#/components/schemas/Role","description":"The role the person who accepts will get."}},"additionalProperties":false},"CreateRequestBody":{"type":"object","required":["agent","action","summary"],"properties":{"action":{"type":"string","description":"Short machine-friendly name of the action, such as `email.send`."},"agent":{"type":"string","description":"Name of the agent asking, 1 to 200 characters."},"amount":{"oneOf":[{"$ref":"#/components/schemas/AmountInput","description":"The money the action would move, as a string such as `\"129.00\"` or a\nnumber. A string is always read exactly; send one for an amount with\ndecimals at or above 100,000,000,000. Rules with a limit go by it.\nNeeds `currency`."},{"type":"null"}]},"currency":{"type":["string","null"],"description":"Three-letter currency code of `amount`, such as `EUR`."},"details":{"type":["object","null"],"description":"Free-form context shown to the person deciding. Must be a JSON object."},"summary":{"type":"string","description":"What the agent wants to do, written for the person deciding."},"ttl_seconds":{"type":["integer","null"],"format":"int64","description":"How long the request stays open, 10 seconds to 7 days. Defaults to 15\nminutes."},"wait_seconds":{"type":["integer","null"],"format":"int64","description":"Hold the call open for up to this many seconds (0 to 30) while the\nrequest waits for a person, and answer as soon as it is decided.","minimum":0}},"additionalProperties":false},"CreateRuleBody":{"type":"object","required":["action","effect"],"properties":{"action":{"type":"string","description":"An exact action name, or a start followed by `*`. A lone `*` covers\nevery action."},"agent_key_id":{"type":["string","null"],"format":"uuid","description":"Limit the rule to one agent key. Leave out for every agent."},"approvals":{"type":["integer","null"],"format":"int32","description":"For an `ask` rule: how many different people (1 to 3) must approve\nthe requests it covers. Defaults to 1. One denial always stops it.","minimum":0},"budget_amount":{"oneOf":[{"$ref":"#/components/schemas/AmountInput","description":"For an `allow` rule: the most it may approve in total per period, as\na number or a string such as `\"500.00\"`. Once that much is approved,\na person decides until the period starts again. Needs\n`budget_currency` and `budget_period`."},{"type":"null"}]},"budget_currency":{"type":["string","null"],"description":"Three-letter currency code of `budget_amount`."},"budget_period":{"oneOf":[{"$ref":"#/components/schemas/Period","description":"`day`, `week` (from Monday) or `month`, in UTC."},{"type":"null"}]},"deciders":{"type":["array","null"],"items":{"type":"string","format":"uuid"},"description":"For an `ask` rule: the people who decide what it catches, by user id,\n1 to 10 of them, all in this workspace. Until it escalates, only they\nand workspace owners may decide. When several rules route one\nrequest, it goes to everyone they name."},"effect":{"$ref":"#/components/schemas/Effect","description":"`allow` approves at once, `deny` denies at once, `ask` always leaves\nthe request for a person. When rules disagree the most cautious wins:\ndeny, then ask, then allow."},"ends_at":{"type":["string","null"],"format":"date-time","description":"When the rule stops applying, in RFC 3339. Leave out for a rule that\nnever ends. Must be in the future."},"escalate_after_seconds":{"type":["integer","null"],"format":"int64","description":"With `deciders`: after this many seconds (60 to 86400) without a\ndecision, any member may decide, and a notice goes out. Leave out to\nnever escalate. A request that expires first never escalates."},"limit_amount":{"oneOf":[{"$ref":"#/components/schemas/AmountInput","description":"Bound the rule by an amount, as a number or a string such as\n`\"50.00\"`. An `allow` rule then applies only up to it, and only when\nthe request states an amount in the same currency. An `ask` or `deny`\nrule applies above it, and also when the amount cannot be compared.\nNeeds `limit_currency`."},{"type":"null"}]},"limit_currency":{"type":["string","null"],"description":"Three-letter currency code of `limit_amount`, such as `EUR`."}},"additionalProperties":false},"CreateWebhookBody":{"type":"object","required":["url","label","events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"},"description":"The events to send to it: at least one."},"label":{"type":"string","description":"What it is, for people: 1 to 100 characters."},"url":{"type":"string","description":"Where to send events: an `https` address on a public host name, on\nthe standard port, with no user name or password, at most 2,000\ncharacters. Every address the name leads to must be on the public\ninternet. It is kept secret and never shown again."}},"additionalProperties":false},"CreateWorkspaceBody":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"1 to 100 characters."}},"additionalProperties":false},"CreatedAgentKeyView":{"type":"object","required":["key","secret"],"properties":{"key":{"$ref":"#/components/schemas/AgentKeyView"},"secret":{"type":"string","description":"The key itself. Shown only in this response; it cannot be read again."}}},"CreatedInvitationView":{"type":"object","required":["invitation","secret"],"properties":{"invitation":{"$ref":"#/components/schemas/InvitationView"},"secret":{"type":"string","description":"The secret for the join link. Shown only in this response. Whoever\nhas it can join, once, within seven days."}}},"CreatedWebhookView":{"type":"object","required":["webhook","secret"],"properties":{"secret":{"type":"string","description":"The signing secret, `whsec_` and base64. Shown only in this\nresponse; it cannot be read again, only replaced."},"webhook":{"$ref":"#/components/schemas/WebhookView"}}},"DayView":{"type":"object","description":"The requests created on one day, by how they ended.","required":["day","approved","denied","expired","waiting","withdrawn"],"properties":{"approved":{"type":"integer","format":"int64"},"day":{"type":"string","format":"date","description":"The day, in UTC, as `YYYY-MM-DD`."},"denied":{"type":"integer","format":"int64"},"expired":{"type":"integer","format":"int64"},"waiting":{"type":"integer","format":"int64"},"withdrawn":{"type":"integer","format":"int64","description":"Taken back by the agent before anyone decided."}}},"DecisionBody":{"type":"object","required":["verdict"],"properties":{"changes":{"oneOf":[{"$ref":"#/components/schemas/ChangesBody","description":"Narrow what is approved: new wording, or a lower amount. The agent\nmay then do only the changed version. Only with `approve`, and not\nwith `remember`."},{"type":"null"}]},"note":{"type":["string","null"],"description":"Optional reason, shown to the agent and kept in the record."},"remember":{"oneOf":[{"$ref":"#/components/schemas/Remember","description":"Keep this answer for later requests for the same action from the same\nagent key: for an `hour`, a `day`, or `always`. Writes a rule in your\nname, so only owners may. An approved amount is remembered as a limit."},{"type":"null"}]},"verdict":{"$ref":"#/components/schemas/Verdict"}},"additionalProperties":false},"DecisionLinkView":{"type":"object","description":"What an emailed link would do.","required":["workspace","verdict","member","request"],"properties":{"member":{"type":"string","description":"Email of the member the link was sent to. The decision is recorded\nin their name."},"request":{"$ref":"#/components/schemas/RequestView"},"verdict":{"$ref":"#/components/schemas/Verdict","description":"What the link records when confirmed."},"workspace":{"type":"string","description":"Name of the workspace the request is in."}}},"DeleteAccountBody":{"type":"object","required":["email"],"properties":{"email":{"type":"string","description":"The email address the account signs in with, to confirm."}},"additionalProperties":false},"DeleteWorkspaceBody":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"The workspace's name, exactly as it is, to confirm."}},"additionalProperties":false},"DeliveryListView":{"type":"object","required":["deliveries"],"properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryView"}}}},"DeliveryState":{"type":"string","description":"Where a delivery stands.","enum":["pending","retrying","delivered","failed"]},"DeliveryView":{"type":"object","description":"One event sent, or to be sent, to a webhook.","required":["id","event_id","event","created_at","state","attempts"],"properties":{"attempts":{"type":"integer","format":"int32","description":"Attempts made so far, at most six.","minimum":0},"created_at":{"type":"string","format":"date-time"},"error":{"type":["string","null"],"description":"Why the latest attempt got no answer: `timeout`, `dns`,\n`refused_address`, `connect`, `invalid_address`, `disabled` or\n`request`."},"event":{"type":"string","description":"Such as `request.approved`, or `webhook.test`."},"event_id":{"type":"string","format":"uuid","description":"The event's id, sent as `webhook-id` on every attempt."},"id":{"type":"string","format":"uuid"},"last_attempt_at":{"type":["string","null"],"format":"date-time"},"next_attempt_at":{"type":["string","null"],"format":"date-time"},"request_id":{"type":["string","null"],"format":"uuid","description":"The request it is about; null for a test."},"state":{"$ref":"#/components/schemas/DeliveryState"},"status":{"type":["integer","null"],"format":"int32","description":"The HTTP status of the latest answer, if there was one. Its body is\nnever kept.","minimum":0}}},"DismissBody":{"type":"object","description":"A suggestion to hide for good.","required":["key_id","action"],"properties":{"action":{"type":"string","description":"The action the suggestion is for."},"key_id":{"type":"string","format":"uuid","description":"The agent key the suggestion is for."}}},"Effect":{"type":"string","description":"What a rule does to the requests it matches.\n\nThe order is the order of caution: when rules disagree, the greatest wins.","enum":["allow","ask","deny"]},"EmailPreferenceBody":{"type":"object","properties":{"weekly_summary":{"type":["boolean","null"],"description":"Whether to send you the weekly summary of this workspace on Monday\nmornings. Left out, it stays as it is."},"when_waiting":{"type":["boolean","null"],"description":"Whether to email you, with links to approve or deny, when a request\nin this workspace waits for a person. Left out, it stays as it is."}},"additionalProperties":false},"EmailPreferenceView":{"type":"object","description":"Which emails about one workspace the caller gets, as they set them.","required":["when_waiting","weekly_summary"],"properties":{"weekly_summary":{"type":"boolean","description":"The weekly summary on Monday mornings. Until they choose, owners get\nit and members do not."},"when_waiting":{"type":"boolean","description":"An email with Approve and Deny links when a request waits for a\nperson."}}},"ErrorBody":{"type":"object","description":"The body of every error response.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable reason, such as `not_found` or `expired`."},"message":{"type":"string","description":"Explanation for a person. Do not match on this text."}}},"Feature":{"type":"string","description":"Capabilities that require a paid plan when enforcement is enabled.","enum":["rules","edit_before_approving","two_person_approval","routing","agent_reports","audit_export","webhooks"]},"FeatureView":{"type":"object","description":"Availability of a capability, including where to upgrade.","required":["feature","plan","included"],"properties":{"feature":{"$ref":"#/components/schemas/Feature"},"included":{"type":"boolean"},"plan":{"$ref":"#/components/schemas/Plan"}}},"HealthView":{"type":"object","required":["status"],"properties":{"status":{"type":"string","description":"`ok`, or `unavailable` when the database cannot be reached."}}},"InquiryBody":{"type":"object","required":["name","email","company","message"],"properties":{"company":{"type":"string","description":"Their company, up to 100 characters."},"email":{"type":"string","description":"Where to answer, up to 254 characters."},"message":{"type":"string","description":"What they need, up to 4,000 characters."},"name":{"type":"string","description":"Who is writing, up to 100 characters."},"team_size":{"type":"string","description":"Roughly how many people, up to 40 characters. May be empty."},"website":{"type":"string","description":"Leave empty. The form hides it from people, so anything in it is\ntaken for a robot and the inquiry is quietly dropped."}},"additionalProperties":false},"InsightsView":{"type":"object","required":["days","since","current","previous","daily","actions","people","money","suggestions"],"properties":{"actions":{"type":"array","items":{"$ref":"#/components/schemas/ActionInsightView"},"description":"The 20 most asked-for actions, most asked first."},"current":{"$ref":"#/components/schemas/PeriodView","description":"The period asked for, up to now."},"daily":{"type":"array","items":{"$ref":"#/components/schemas/DayView"},"description":"One entry per day of the period, oldest first, including days on\nwhich nothing was asked."},"days":{"type":"integer","format":"int64","description":"How many days the period covers, today included: 7, 30 or 90."},"money":{"type":"array","items":{"$ref":"#/components/schemas/MoneyInsightView"},"description":"Money approved and denied, one entry per currency."},"people":{"type":"array","items":{"$ref":"#/components/schemas/PersonInsightView"},"description":"Every member, and anyone else who decided something, busiest first."},"previous":{"$ref":"#/components/schemas/PeriodView","description":"The period of the same length just before it, for comparison."},"since":{"type":"string","format":"date","description":"The first day of the period, in UTC, as `YYYY-MM-DD`."},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/SuggestionView"},"description":"Rules worth writing, most approved first. Only owners, who write\nrules, are sent any; for everyone else this is empty."}}},"InvitationListView":{"type":"object","required":["invitations"],"properties":{"invitations":{"type":"array","items":{"$ref":"#/components/schemas/InvitationView"}}}},"InvitationView":{"type":"object","description":"An invitation, without its secret.","required":["id","role","note","created_by","created_at","expires_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"created_by":{"type":"string","description":"Email of the owner who created it."},"expires_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"note":{"type":"string","description":"Who it is meant for, as the owner wrote it."},"role":{"$ref":"#/components/schemas/Role","description":"The role the person who accepts will get."}}},"KeyScopeBody":{"type":"object","required":["scope"],"properties":{"scope":{"type":"array","items":{"type":"string"},"description":"The actions the key may ask for, in the same patterns as rules:\n`refund.create`, or a family such as `deploy.*`. At most 20. An\nempty list lets the key ask for any action."}},"additionalProperties":false},"LastDeliveryView":{"type":"object","description":"How the latest attempt to send to an endpoint went.","required":["event","at","delivered"],"properties":{"at":{"type":"string","format":"date-time"},"delivered":{"type":"boolean","description":"Whether the endpoint took it with a 2xx status."},"error":{"type":["string","null"],"description":"Why nothing usable came back: `timeout`, `dns`, `refused_address`,\n`connect`, `invalid_address`, `disabled` or `request`."},"event":{"type":"string","description":"The event it carried, such as `request.approved`."},"status":{"type":["integer","null"],"format":"int32","description":"The HTTP status the endpoint answered with, if it answered.","minimum":0}}},"LinkBody":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"The secret after the `#` in the emailed link."}},"additionalProperties":false},"LinkDecisionBody":{"type":"object","required":["token"],"properties":{"note":{"type":["string","null"],"description":"Optional reason, shown to the agent and kept in the record."},"token":{"type":"string","description":"The secret after the `#` in the emailed link."}},"additionalProperties":false},"MatchView":{"type":"object","description":"A rule that covers the request.","required":["rule_id","effect","deciding"],"properties":{"deciding":{"type":"boolean","description":"True for the one rule that wins: the most cautious, and the first\nwritten among equals."},"effect":{"$ref":"#/components/schemas/Effect","description":"What the rule does to this request. A rule whose budget cannot cover\nit asks instead of allowing."},"rule_id":{"type":"string","format":"uuid"}}},"MeView":{"type":"object","required":["user","workspaces","can_delete_account"],"properties":{"can_delete_account":{"type":"boolean","description":"Whether this server can delete the account itself (`DELETE /v1/me`).\nWhen false, the account is deleted by whoever runs the server, on\nrequest."},"user":{"$ref":"#/components/schemas/UserView"},"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceView"}}}},"MemberListView":{"type":"object","required":["members"],"properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/MemberView"}}}},"MemberView":{"type":"object","description":"A person in a workspace.","required":["user_id","email","role","joined_at"],"properties":{"email":{"type":"string","description":"Their email as it was when they joined."},"joined_at":{"type":"string","format":"date-time"},"role":{"$ref":"#/components/schemas/Role"},"user_id":{"type":"string","format":"uuid"}}},"MoneyInsightView":{"type":"object","description":"Money in one currency, as the agents stated it.","required":["currency","approved","denied"],"properties":{"approved":{"type":"string","description":"The total approved, as a decimal such as `\"1250.00\"`. An approval\nthat lowered the amount counts at the lower amount."},"currency":{"type":"string"},"denied":{"type":"string","description":"The total denied, as a decimal."}}},"NotificationsBody":{"type":"object","description":"One chat webhook. Name exactly one of the three.","properties":{"discord_webhook_url":{"type":["string","null"],"description":"A Discord channel webhook URL, starting with\n`https://discord.com/api/webhooks/`."},"slack_webhook_url":{"type":["string","null"],"description":"A Slack incoming webhook URL, starting with\n`https://hooks.slack.com/services/`."},"teams_webhook_url":{"type":["string","null"],"description":"A Microsoft Teams Workflows webhook URL, on a host ending in\n`.environment.api.powerplatform.com`, with a path starting with\n`/powerautomate/automations/direct/`."}},"additionalProperties":false},"Outcome":{"type":"string","description":"How the approved action went.","enum":["succeeded","failed"]},"OutcomeBody":{"type":"object","required":["outcome"],"properties":{"note":{"type":["string","null"],"description":"What happened, for the record: an id, an error, what was left undone.\nUp to 2,000 characters."},"outcome":{"$ref":"#/components/schemas/Outcome","description":"`succeeded` when the action was carried out as approved, `failed`\nwhen it did not happen or only partly."}},"additionalProperties":false},"PauseScope":{"type":"string","description":"What a pause covers.","enum":["workspace","agent"]},"Period":{"type":"string","description":"How long a budget lasts before it starts again, in UTC.","enum":["day","week","month"]},"PeriodView":{"type":"object","description":"How the requests asked in one period ended, and how long people took.\nThe five ways a request can end add up to `requests`.","required":["requests","by_person","by_rule","expired","withdrawn","waiting","approved","denied"],"properties":{"approved":{"type":"integer","format":"int64","description":"Approved, by a person or a rule."},"by_person":{"type":"integer","format":"int64","description":"Approved or denied by a person."},"by_rule":{"type":"integer","format":"int64","description":"Approved or denied by a standing rule the moment it was asked."},"denied":{"type":"integer","format":"int64","description":"Denied, by a person or a rule."},"expired":{"type":"integer","format":"int64","description":"Missed: nobody answered before the request ran out of time."},"median_decision_seconds":{"type":["number","null"],"format":"double","description":"Half of the decisions people made took longer than this, in seconds.\nNull when no person decided anything."},"p90_decision_seconds":{"type":["number","null"],"format":"double","description":"One in ten of the decisions people made took longer than this, in\nseconds. Null when no person decided anything."},"requests":{"type":"integer","format":"int64","description":"Every request an agent asked for in the period."},"waiting":{"type":"integer","format":"int64","description":"Still waiting for a person."},"withdrawn":{"type":"integer","format":"int64","description":"Taken back by the agent before anyone decided."}}},"PersonInsightView":{"type":"object","description":"What one person decided in the period. Every member is listed, and so is\nanyone who decided something before they left.","required":["user_id","email","decisions"],"properties":{"decisions":{"type":"integer","format":"int64","description":"Approvals and denials they gave. Each approval towards a request that\nneeds several people counts."},"email":{"type":"string","description":"Their email, as the members list shows it."},"median_response_seconds":{"type":["number","null"],"format":"double","description":"The middle time from asking to their decision, in seconds, or null\nwhen they decided nothing."},"user_id":{"type":"string","format":"uuid"}}},"Plan":{"type":"string","description":"The plan a workspace is on.","enum":["free","pro","team","business","enterprise"]},"PushDeviceListView":{"type":"object","required":["devices"],"properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/PushDeviceView"}}}},"PushDeviceView":{"type":"object","description":"A browser that gets push notifications.","required":["id","device","created_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"device":{"type":"string","description":"Its browser and system, such as \"Chrome on macOS\", as they were when\nit subscribed."},"id":{"type":"string","format":"uuid"}}},"PushKeysBody":{"type":"object","description":"The keys of a browser's push subscription, as `PushSubscription.toJSON()`\ngives them.","required":["p256dh","auth"],"properties":{"auth":{"type":"string","description":"The browser's authentication secret, base64url."},"p256dh":{"type":"string","description":"The browser's public key, base64url."}},"additionalProperties":false},"PushSubscriptionBody":{"type":"object","required":["endpoint","keys"],"properties":{"endpoint":{"type":"string","description":"Where the browser's push service takes messages for it. Only the\npush services of Chrome, Safari, Firefox and Edge are accepted."},"keys":{"$ref":"#/components/schemas/PushKeysBody"}},"additionalProperties":false},"PushView":{"type":"object","description":"Whether this server sends push notifications.","properties":{"public_key":{"type":["string","null"],"description":"The key browsers subscribe with (`applicationServerKey`), or `null`\nwhen push notifications are off on this server."}}},"ReasonCode":{"type":"string","description":"One reason for the outcome.","enum":["key_revoked","key_expired","out_of_scope","requests_used_up","workspace_paused","key_paused","no_rule","rule","over_budget"]},"ReasonView":{"type":"object","description":"One reason, and the rule it is about when there is one.","required":["code"],"properties":{"code":{"$ref":"#/components/schemas/ReasonCode"},"rule_id":{"type":["string","null"],"format":"uuid"}}},"RecordCheckView":{"type":"object","required":["ok","checked","checked_at"],"properties":{"broken_at":{"type":["integer","null"],"format":"int64","description":"The number of the first entry that does not hold, when one does not."},"checked":{"type":"integer","format":"int64","description":"How many entries were checked and found in order."},"checked_at":{"type":"string","format":"date-time"},"latest_hash":{"type":["string","null"],"description":"The latest entry's hash: the seal over everything before it. Note it\ndown to be able to tell later that nothing before it changed."},"latest_seq":{"type":["integer","null"],"format":"int64","description":"The number of the latest entry, or null for a record with none yet."},"ok":{"type":"boolean","description":"Whether every entry up to the latest one checks out."},"problem":{"oneOf":[{"$ref":"#/components/schemas/RecordProblem"},{"type":"null"}]}}},"RecordEntriesView":{"type":"object","required":["entries"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/RecordEntryView"},"description":"Oldest first."},"next_after":{"type":["integer","null"],"format":"int64","description":"Pass as `after` for the next page; null on the last page."}}},"RecordEntryView":{"type":"object","description":"One entry of the sealed record, as it was hashed.","required":["seq","payload","prev_hash","hash"],"properties":{"hash":{"type":"string","description":"`hex(SHA-256(prev_hash || payload))`."},"payload":{"type":"string","description":"The canonical JSON text that was hashed, exactly."},"prev_hash":{"type":"string"},"seq":{"type":"integer","format":"int64"}}},"RecordProblem":{"type":"string","description":"What was wrong at the first entry that does not hold.","enum":["missing","altered"]},"RedirectView":{"type":"object","description":"Where to send the person next.","required":["url"],"properties":{"url":{"type":"string"}}},"Remember":{"type":"string","description":"How long a remembered answer lasts.","enum":["hour","day","always"]},"RenameWorkspaceBody":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"1 to 100 characters."}},"additionalProperties":false},"RequestCapBody":{"type":"object","required":["cap"],"properties":{"cap":{"type":"integer","format":"int32","description":"The most requests a month, from 100 to 1,000,000.","minimum":0}},"additionalProperties":false},"RequestListView":{"type":"object","required":["requests"],"properties":{"requests":{"type":"array","items":{"$ref":"#/components/schemas/RequestView"}}}},"RequestView":{"allOf":[{"$ref":"#/components/schemas/ApprovedView"},{"type":"object","required":["id","agent","action","summary","details","status","allowed","paused","by_rule","created_at","expires_at","approvals_needed","approvals"],"properties":{"action":{"type":"string","description":"Short machine-friendly name of the action, such as `email.send`."},"agent":{"type":"string","description":"Name the agent gave itself. It can be anything, so it proves nothing."},"agent_key_id":{"type":["string","null"],"format":"uuid","description":"The key the agent asked with, while it exists. Shown to people in the\nworkspace only."},"allowed":{"type":"boolean","description":"True only after an approval: by a person, or by an `allow` rule a\nworkspace owner wrote in advance. Always false while the workspace is\npaused. Agents must act on this field alone."},"amount":{"type":["string","null"],"description":"The money the action would move, as the agent stated it, such as\n`129.00`. Rules with a limit go by it."},"approvals":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalView"},"description":"Who has approved it so far, first first."},"approvals_needed":{"type":"integer","format":"int32","description":"How many different people must approve it before `allowed` can be\ntrue. One denial is always enough to stop it.","minimum":0},"by_rule":{"type":"boolean","description":"True when a standing rule made the decision, even if that rule has\nsince been removed."},"created_at":{"type":"string","format":"date-time"},"currency":{"type":["string","null"],"description":"Three-letter currency code of `amount`."},"decided_at":{"type":["string","null"],"format":"date-time","description":"When it was decided, or withdrawn."},"decided_by":{"type":["string","null"],"description":"Email of the person who decided, or who wrote the rule that did."},"decision_note":{"type":["string","null"]},"details":{"type":"object","description":"Free-form context supplied by the agent."},"expires_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"key_name":{"type":["string","null"],"description":"Name of the key the agent asked with, as an owner wrote it. The agent\ncannot choose it, and rules go by it."},"outcome":{"oneOf":[{"$ref":"#/components/schemas/Outcome","description":"How the approved action went, once the agent reported it."},{"type":"null"}]},"outcome_at":{"type":["string","null"],"format":"date-time"},"outcome_note":{"type":["string","null"],"description":"What the agent said about how it went."},"pause":{"oneOf":[{"$ref":"#/components/schemas/PauseScope","description":"What is paused, while `paused` is true: every agent in the workspace,\nor just this agent."},{"type":"null"}]},"paused":{"type":"boolean","description":"True while the workspace is under an emergency stop, or the agent's\nkey is paused. Nothing is allowed until an owner resumes it."},"routing":{"oneOf":[{"$ref":"#/components/schemas/RoutingView","description":"Who it is for, when a rule sent it to certain people. Shown to people\nin the workspace only; absent when any member may decide it."},{"type":"null"}]},"rule_id":{"type":["string","null"],"format":"uuid","description":"The standing rule that decided this request, when one did and it\nstill exists."},"status":{"$ref":"#/components/schemas/Status"},"summary":{"type":"string","description":"What the agent wants to do, written for a person."}}}],"description":"An approval request."},"Role":{"type":"string","description":"A person's role in a workspace.","enum":["owner","member"]},"RoleBody":{"type":"object","required":["role"],"properties":{"role":{"$ref":"#/components/schemas/Role","description":"`owner` or `member`."}},"additionalProperties":false},"RoutedTestView":{"type":"object","description":"Who a waiting request would be for, when a rule routes it.","required":["assigned_to"],"properties":{"assigned_to":{"type":"array","items":{"$ref":"#/components/schemas/AssigneeView"},"description":"The people it would be for. Empty when everyone the rules name has\nleft the workspace; then only owners may decide until it escalates."},"escalates_after_seconds":{"type":["integer","null"],"format":"int64","description":"How long until any member may decide it, for a request with the\ndefault time limit of 15 minutes; null when it would not escalate\nbefore it expires."}}},"RoutingView":{"type":"object","description":"Who a request is for, when a rule sent it to certain people. Until it\nescalates only they and workspace owners may decide it.","required":["assigned_to"],"properties":{"assigned_to":{"type":"array","items":{"$ref":"#/components/schemas/AssigneeView"},"description":"The people it is for. Empty when everyone the rule named has left the\nworkspace; then only owners may decide until it escalates."},"escalated_at":{"type":["string","null"],"format":"date-time","description":"When it escalated, if it did before it was settled."},"escalates_at":{"type":["string","null"],"format":"date-time","description":"When any member may decide it, or null when it never escalates."}}},"RuleListView":{"type":"object","required":["rules"],"properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/RuleView"}}}},"RuleTestBody":{"type":"object","required":["action"],"properties":{"action":{"type":"string","description":"The action, such as `refund.create`, checked as a real request's is."},"amount":{"oneOf":[{"$ref":"#/components/schemas/AmountInput","description":"The money the action would move, as a string such as `\"129.00\"` or a\nnumber, read as a real request's is. Needs `currency`."},{"type":"null"}]},"currency":{"type":["string","null"],"description":"Three-letter currency code of `amount`, such as `EUR`."},"key_id":{"type":["string","null"],"format":"uuid","description":"The agent key the request would come with. Leave it out for a key no\nrule names: then only rules for every agent apply."}},"additionalProperties":false},"RuleTestView":{"type":"object","description":"What a request would get right now, and why. Nothing was stored.","required":["outcome","reasons","rules","budgets"],"properties":{"approvals_needed":{"type":["integer","null"],"format":"int32","description":"While it would wait: how many different people must approve it.","minimum":0},"budgets":{"type":"array","items":{"$ref":"#/components/schemas/BudgetTestView"},"description":"The budgets of the rules that cover it."},"outcome":{"$ref":"#/components/schemas/TestOutcome"},"reasons":{"type":"array","items":{"$ref":"#/components/schemas/ReasonView"},"description":"Why, in order: first what refuses the request before the rules (a\nrevoked or expired key, an action outside its scope, or this month's\nrequests used up), then a pause, which lets nothing be allowed, then\nwhat the rules say."},"routed":{"oneOf":[{"$ref":"#/components/schemas/RoutedTestView","description":"While it would wait and a rule routes it: who it would be for."},{"type":"null"}]},"rules":{"type":"array","items":{"$ref":"#/components/schemas/MatchView"},"description":"The rules that cover the request, in the order they were written."}}},"RuleView":{"type":"object","description":"A standing rule.","required":["id","action","effect","approvals","deciders","created_by","created_at"],"properties":{"action":{"type":"string","description":"An exact action name such as `email.send`, or a start followed by\n`*` such as `email.*`."},"agent_key_id":{"type":["string","null"],"format":"uuid","description":"The one agent key the rule is for, or null for every agent."},"approvals":{"type":"integer","format":"int32","description":"How many different people must approve a request this rule sends to\nthe inbox. More than one only for an `ask` rule.","minimum":0},"budget_amount":{"type":["string","null"],"description":"For an `allow` rule: the most it may approve in total per period,\nsuch as `500.00`."},"budget_currency":{"type":["string","null"],"description":"Three-letter currency code of `budget_amount`."},"budget_period":{"oneOf":[{"$ref":"#/components/schemas/Period","description":"How long the budget lasts before it starts again, in UTC."},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"created_by":{"type":"string","description":"Email of the person who wrote the rule."},"deciders":{"type":"array","items":{"type":"string","format":"uuid"},"description":"For an `ask` rule: the people who decide what it catches, by user id.\nEmpty when any member may."},"effect":{"$ref":"#/components/schemas/Effect"},"ends_at":{"type":["string","null"],"format":"date-time","description":"When the rule stops applying, or null when it never does."},"escalate_after_seconds":{"type":["integer","null"],"format":"int64","description":"How long they have before any member may decide, or null for never."},"id":{"type":"string","format":"uuid"},"limit_amount":{"type":["string","null"],"description":"An amount that bounds the rule, such as `50.00`. An `allow` rule\napplies up to it; an `ask` or `deny` rule applies above it."},"limit_currency":{"type":["string","null"],"description":"Three-letter currency code of `limit_amount`."}}},"StatsView":{"type":"object","required":["days","approved","denied","expired","waiting","withdrawn","by_rule","agents"],"properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentStatsView"},"description":"Busiest agent first."},"approved":{"type":"integer","format":"int64"},"by_rule":{"type":"integer","format":"int64","description":"How many of the decisions in the period a standing rule made."},"days":{"type":"array","items":{"$ref":"#/components/schemas/DayView"},"description":"One entry per day for the last 30 days, oldest first, including days\non which nothing was asked."},"denied":{"type":"integer","format":"int64"},"expired":{"type":"integer","format":"int64"},"waiting":{"type":"integer","format":"int64"},"withdrawn":{"type":"integer","format":"int64","description":"Taken back by the agent before anyone decided."}}},"Status":{"type":"string","description":"Where an approval request stands.","enum":["pending","approved","denied","expired","withdrawn"]},"SuggestionView":{"type":"object","description":"An `allow` rule worth writing: one agent key asked for one action again\nand again, and a person approved every request as asked. Nothing is\nwritten until an owner saves the rule themselves.","required":["key_id","key_name","action","approved"],"properties":{"action":{"type":"string"},"approved":{"type":"integer","format":"int32","description":"How many requests a person approved that the rule would have answered.","minimum":0},"key_id":{"type":"string","format":"uuid"},"key_name":{"type":"string","description":"The name the owner gave the key."},"limit_amount":{"type":["string","null"],"description":"The largest amount approved, as a decimal: the rule would allow up to\nit. Null when no request stated an amount."},"limit_currency":{"type":["string","null"]}}},"TestOutcome":{"type":"string","description":"What would happen to the request right now.","enum":["allowed","denied","waits","refused"]},"UnsubscribeBody":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"The secret from the summary's unsubscribe link."}},"additionalProperties":false},"UnsubscribedView":{"type":"object","description":"What an unsubscribe link turned off.","required":["workspace"],"properties":{"workspace":{"type":"string","description":"Name of the workspace whose weekly summary is now off."}}},"UsageView":{"type":"object","required":["plan","features","period_start","requests","agent_keys","agent_keys_limit","enforced","per_request"],"properties":{"agent_keys":{"type":"integer","format":"int64","description":"Agent keys that are not revoked.","minimum":0},"agent_keys_limit":{"type":"integer","format":"int32","description":"The most active keys the workspace may have.","minimum":0},"billed_requests":{"type":["integer","null"],"format":"int64","description":"While the plan is paid per request, this month's requests that are\nbilled. Null otherwise.","minimum":0},"enforced":{"type":"boolean","description":"Whether going past a limit is refused. When false the limits are\nshown but nothing is turned away. A per-request workspace's cap is\nrefused either way."},"features":{"type":"array","items":{"$ref":"#/components/schemas/FeatureView"}},"members_limit":{"type":["integer","null"],"format":"int32","minimum":0},"per_request":{"type":"boolean","description":"Whether the plan is paid per request rather than per person."},"period_start":{"type":"string","format":"date-time","description":"Start of the month the request count covers, in UTC."},"plan":{"$ref":"#/components/schemas/Plan"},"request_cap":{"type":["integer","null"],"format":"int32","description":"While the plan is paid per request, the most requests a month the\nworkspace takes; past it, requests are refused. Null otherwise.","minimum":0},"requests":{"type":"integer","format":"int64","description":"Requests agents created this month.","minimum":0},"requests_limit":{"type":["integer","null"],"format":"int32","description":"The most requests the plan allows in a month, or null for no limit.","minimum":0}}},"UserView":{"type":"object","required":["id","email"],"properties":{"email":{"type":"string"},"id":{"type":"string","format":"uuid"}}},"Verdict":{"type":"string","description":"What a person chose.","enum":["approve","deny"]},"WebhookEnabledBody":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean","description":"False stops sending to it, including what was waiting to be tried\nagain; true starts again with the next event."}},"additionalProperties":false},"WebhookEvent":{"type":"string","description":"What happened to a request, as an endpoint can ask to hear about it.","enum":["request.waiting","request.approved","request.denied","request.expired","request.withdrawn","request.outcome"]},"WebhookListView":{"type":"object","required":["webhooks"],"properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookView"}}}},"WebhookSecretView":{"type":"object","required":["secret"],"properties":{"secret":{"type":"string","description":"The new signing secret. Shown only in this response. The old one\nstops working at once: every later message is signed with this one."}}},"WebhookTestView":{"type":"object","required":["event_id"],"properties":{"event_id":{"type":"string","format":"uuid","description":"The test event's id, sent as `webhook-id`. Its delivery shows in the\nwebhook's deliveries within seconds."}}},"WebhookView":{"type":"object","description":"A webhook endpoint, without its URL or signing secret.","required":["id","label","host","events","enabled","created_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"enabled":{"type":"boolean","description":"While false, nothing is sent to it."},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"},"description":"The events it is sent."},"host":{"type":"string","description":"The host of its URL, such as `hooks.example.com`. The rest of the\nURL is never shown again."},"id":{"type":"string","format":"uuid"},"label":{"type":"string","description":"What it is, for people."},"last_delivery":{"oneOf":[{"$ref":"#/components/schemas/LastDeliveryView","description":"How the latest attempt went; null until something was sent."},{"type":"null"}]},"secret_rotated_at":{"type":["string","null"],"format":"date-time","description":"When its signing secret was last replaced, if ever."}}},"WorkspaceBillingView":{"allOf":[{"$ref":"#/components/schemas/BillingView"},{"type":"object","required":["plan","subscribed","has_billing_account","per_request"],"properties":{"has_billing_account":{"type":"boolean","description":"Whether the workspace has paid before, so the billing portal has\ninvoices to show."},"per_request":{"type":"boolean","description":"Whether the plan is paid per request rather than per person."},"plan":{"$ref":"#/components/schemas/Plan"},"subscribed":{"type":"boolean","description":"Whether the workspace has a subscription. Changing or ending it\nhappens in the billing portal."}}}],"description":"A workspace's plan and whether it pays for it."},"WorkspaceView":{"type":"object","required":["id","name","role","paused","notifies","emails_me","email_preference"],"properties":{"email_preference":{"$ref":"#/components/schemas/EmailPreferenceView","description":"Which emails about this workspace the caller gets."},"emails_me":{"type":"boolean","description":"Whether the caller is emailed when a request waits for a person,\nwith links to approve or deny it. The same as\n`email_preference.when_waiting`, kept for older clients."},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"notifies":{"type":"boolean","description":"Whether waiting requests are announced in a chat channel."},"notifies_in":{"oneOf":[{"$ref":"#/components/schemas/ChatService","description":"The chat service waiting requests are announced in, or `null` when\nthey are not announced in chat."},{"type":"null"}]},"paused":{"type":"boolean","description":"True while the workspace is under an emergency stop and no agent in\nit is allowed to act."},"paused_by":{"type":["string","null"],"description":"Email of the person who paused it, while it is paused."},"role":{"$ref":"#/components/schemas/Role","description":"The caller's role in this workspace."}}}},"securitySchemes":{"agent":{"type":"http","scheme":"bearer","description":"An agent key (`gl_…`) created in a workspace's settings."},"user":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"A Supabase Auth access token for a signed-in person."}}},"tags":[{"name":"account","description":"The signed-in person and their workspaces"},{"name":"inbox","description":"Requests waiting for, or holding, a decision"},{"name":"agent-keys","description":"Keys that let agents ask for approval"},{"name":"members","description":"Who is in a workspace, and inviting more"},{"name":"activity","description":"Who changed what in a workspace: keys, rules, people, settings and plan"},{"name":"rules","description":"Answers given in advance: allow, deny or always ask"},{"name":"insights","description":"How approvals are going, and rules worth writing"},{"name":"webhooks","description":"Signed events about requests, sent to your own systems"},{"name":"agent","description":"What an agent calls"},{"name":"billing","description":"Paying for a plan"},{"name":"contact","description":"Writing to the team about Enterprise"},{"name":"health","description":"Probes for load balancers"}],"servers":[{"url":"https://api.variantgate.com"}]}