Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Reason Organizations API
version: 3.0.0
description: 'The Reason HTTP API. Drive cloud software-engineering agents: open sessions against your repositories, stream their work, and manage the secrets, skills, and automations they run with.
Authenticate with a Reason API key sent as a bearer token. New keys use `reason_`; legacy `ara_` keys remain accepted. Every resource is scoped to an organization; resolve your `org_id` once with `GET /v3/self`.'
servers:
- url: https://api.reasonmachines.com
security:
- reasonApiKey: []
tags:
- name: Organizations
description: The top-level tenant. Create, read, update, and delete organizations.
paths:
/v3/organizations:
get:
operationId: listOrganizations
x-reason-mcp-description: Lists the workspaces this connection can act on, each with `id`, `slug`, `name` and the caller's `membership_role`, to confirm which workspace calls reach and what the caller may do there. A connection bound to one workspace lists only that one. Reading changes nothing.
tags:
- Organizations
summary: List organizations
description: 'Returns the organizations the current principal can access.
Scope: `org:read`'
responses:
'200':
description: Organizations.
content:
application/json:
schema:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/Organization'
description: Workspaces this connection can act on.
total:
type: integer
description: Number of workspaces in `items`.
has_next_page:
type: boolean
description: 'Always false: every workspace is returned in one page.'
end_cursor:
type: 'null'
description: 'Always null: there is no further page.'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
security:
- reasonApiKey:
- org:read
post:
operationId: createOrganization
x-reason-open-world: true
x-reason-mcp-description: Creates a workspace owned by the caller from a non-empty `name`; the server generates the slug. Returns it under `organization` with the number of invitations sent as `invited`. An OAuth connection is refused with 403 `oauth_org_bound`.
tags:
- Organizations
summary: Create an organization
description: 'Creates a workspace owned by the caller from a non-empty name. The server generates its slug; a supplied slug is not applied. Returns an organization envelope and invited count. Workspace-bound MCP OAuth grants receive 403 oauth_org_bound. Existing API keys remain bound to their original workspace.
Scope: `org:write`'
responses:
'201':
description: Created.
content:
application/json:
schema:
$ref: '#/components/schemas/OrganizationCreateResult'
example:
organization:
id: org_example
name: Example workspace
slug: example-workspace
membership_role: owner
invited: 0
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOrganization'
example:
name: Example workspace
security:
- reasonApiKey:
- org:write
/v3/organizations/{orgId}:
parameters:
- $ref: '#/components/parameters/orgId'
get:
operationId: getOrganization
x-reason-mcp-description: 'Returns the workspace this connection acts on, under `organization`: its `id`, `slug`, `name` and the caller''s `membership_role`, which decides which writes are allowed (rename: owner or admin; delete: owner). Use it to confirm the target workspace before a write. Reading changes nothing.'
tags:
- Organizations
summary: Retrieve an organization
description: 'Returns the accessible workspace inside an organization envelope, including the caller''s membership_role. Workspace-bound credentials cannot access other workspaces.
Scope: `org:read`'
responses:
'200':
description: The organization.
content:
application/json:
schema:
$ref: '#/components/schemas/OrganizationResult'
example:
organization:
id: org_example
name: Example workspace
slug: example-workspace
membership_role: owner
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
security:
- reasonApiKey:
- org:read
patch:
operationId: updateOrganization
x-reason-destructive: true
x-reason-mcp-description: Renames the connected workspace and returns it under `organization`. Requires the owner or admin role and a non-empty `name`. The slug is derived again from the new name, so a rename changes the slug as well; no other field changes.
tags:
- Organizations
summary: Update an organization
description: 'Renames the workspace and derives its slug from the new name. Requires the owner or admin role and a non-empty name; a supplied slug is ignored. Returns the renamed organization.
Scope: `org:write`'
responses:
'200':
description: Updated.
content:
application/json:
schema:
$ref: '#/components/schemas/OrganizationResult'
example:
organization:
id: org_example
name: Example workspace
slug: example-workspace
membership_role: owner
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The workspace's new display name, not blank. The server derives a new slug from it, so the slug changes with every rename.
slug:
type: string
description: Ignored; accepted only so older clients keep working. The slug always follows the new name, so leave it out.
example:
name: Acme Corporation
security:
- reasonApiKey:
- org:write
delete:
operationId: deleteOrganization
x-reason-open-world: true
x-reason-mcp-description: Permanently deletes the connected workspace; it cannot be undone. Requires the owner role and a `name` equal to the current workspace name, as `getOrganization` returns it. A personal workspace is refused, and 409 means retention, pending charges or settlement blocked the deletion.
tags:
- Organizations
summary: Delete an organization
description: 'Irreversibly deletes a workspace. Requires the owner role and a JSON body whose name matches the current workspace name. Personal workspaces cannot be deleted here. HTTP 409 means accounting retention, pending charges or busy settlement blocked deletion; resolve the reason instead of blindly retrying.
Scope: `org:write`'
responses:
'200':
$ref: '#/components/responses/Ok'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
description: Deletion is blocked by accounting retention, pending charges, or busy settlement.
'429':
$ref: '#/components/responses/RateLimited'
'503':
description: A large workspace is still being erased in steps; it remains until a repeated request finishes the deletion.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteOrganization'
example:
name: Acme Inc
security:
- reasonApiKey:
- org:write
/v3/organizations/{orgId}/ephemeral-workspaces:
parameters:
- $ref: '#/components/parameters/orgId'
post:
operationId: createEphemeralWorkspace
x-reason-mcp: false
tags:
- Organizations
summary: Create a single-use benchmark workspace
description: 'Create a single-use benchmark workspace: an empty workspace for one trial, owned by the caller, with one scoped key. The parent workspace pays for its usage.
Creates an empty workspace for one trial, owned by the caller, with one scoped key. The parent pays for its usage: the workspace budget (credits) is held on the parent''s wallet and settled for actual consumption after retirement; runs use the parent''s connected provider accounts. It admits exactly one Session, created with mode ephemeral, and is retired at expiry or by the retire operation.
Scope: `org:write`'
responses:
'200':
description: Replayed an identical request.
content:
application/json:
schema:
$ref: '#/components/schemas/EphemeralWorkspaceCreated'
example:
organization_id: 22222222-2222-4222-8222-222222222222
parent_organization_id: 11111111-1111-4111-8111-111111111111
reference: harbor-0b6c
expires_at: '2026-10-03T04:00:00.000Z'
retired_at: null
api_key: reason_illustrative
'201':
description: Created.
content:
application/json:
schema:
$ref: '#/components/schemas/EphemeralWorkspaceCreated'
example:
organization_id: 22222222-2222-4222-8222-222222222222
parent_organization_id: 11111111-1111-4111-8111-111111111111
reference: harbor-0b6c
expires_at: '2026-10-03T04:00:00.000Z'
retired_at: null
api_key: reason_illustrative
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
description: 'The parent pays: it needs paid model access and enough credits for the workspace budget.'
'403':
$ref: '#/components/responses/Forbidden'
'409':
description: Reference conflict, retired workspace, or active limit reached.
'429':
$ref: '#/components/responses/RateLimited'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateEphemeralWorkspace'
security:
- reasonApiKey:
- org:write
/v3/organizations/{orgId}/ephemeral-workspaces/{workspaceId}/retire:
parameters:
- $ref: '#/components/parameters/orgId'
- name: workspaceId
description: The single-use benchmark workspace to retire, by the `organization_id` that `POST /v3/organizations/{orgId}/ephemeral-workspaces` (REST only, not an MCP tool) returned when it was created under this workspace. Only a workspace created under the connected one can be retired; any other workspace, this one included, returns 404.
in: path
required: true
schema:
type: string
format: uuid
post:
operationId: retireEphemeralWorkspace
x-reason-destructive: true
x-reason-idempotent: true
x-reason-open-world: true
x-reason-mcp-description: 'Retires a single-use benchmark workspace created under this one, finished or not: hard-cancels its live Sessions, revokes its Devices and deletes its key; it and its transcripts stay until purged. Owner or admin only. Returns it with `retired_at` and the saved `outcome`; a repeat returns the same.'
tags:
- Organizations
summary: Retire a single-use benchmark workspace
description: 'Cancels live work, revokes devices and deletes the workspace key. The workspace and its transcripts are kept for analysis until purged. Returns organization_id, parent_organization_id, reference, expires_at, retired_at and the saved outcome (nullable), containing reason, cancelled_runs and revoked_devices counts, and errors. Idempotent: an already-retired workspace returns its saved result.
Scope: `org:write`'
responses:
'200':
description: Retired (or already retired).
content:
application/json:
schema:
$ref: '#/components/schemas/EphemeralWorkspaceRetired'
example:
organization_id: 22222222-2222-4222-8222-222222222222
parent_organization_id: 11111111-1111-4111-8111-111111111111
reference: harbor-0b6c
expires_at: '2026-10-03T04:00:00.000Z'
retired_at: '2026-10-03T01:12:00.000Z'
outcome:
reason: requested
cancelled_runs: 0
revoked_devices: 1
errors: []
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: No ephemeral workspace of this parent has that id.
'429':
$ref: '#/components/responses/RateLimited'
security:
- reasonApiKey:
- org:write
components:
responses:
NotFound:
description: Resource not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: session_not_found
BadRequest:
description: Invalid request.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: prompt_required
Unauthorized:
description: Missing, invalid, or expired key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: missing_bearer
message: Authorization required
Forbidden:
description: The key lacks the required scope or role.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: missing_scope
required_scope: sessions:read
Ok:
description: Success.
content:
application/json:
schema:
type: object
properties:
ok:
type: boolean
const: true
description: 'Always true: the operation succeeded.'
required:
- ok
example:
ok: true
RateLimited:
description: Too many requests. Retry after the number of seconds in the `Retry-After` response header.
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
minimum: 1
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
type: rate_limited
message: This API key exceeded its request-rate limit
schemas:
Error:
type: object
properties:
error:
oneOf:
- type: string
- type: object
required:
- type
- message
properties:
type:
type: string
message:
type: string
request_id:
type:
- string
- 'null'
message:
type: string
required_scope:
type: string
description: The capability required when the request was denied for a missing scope.
OrganizationResult:
type: object
properties:
organization:
$ref: '#/components/schemas/Organization'
required:
- organization
CreateOrganization:
type: object
properties:
name:
type: string
description: Display name for the new workspace.
slug:
type: string
description: Compatibility input; ignored. The server generates the slug from the name.
required:
- name
OrganizationCreateResult:
type: object
properties:
organization:
$ref: '#/components/schemas/Organization'
invited:
type: integer
description: Number of invitation emails sent with the new workspace.
required:
- organization
- invited
EphemeralWorkspaceCreated:
type: object
properties:
organization_id:
type: string
format: uuid
pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
description: Id of the ephemeral workspace.
parent_organization_id:
type: string
format: uuid
pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
description: Id of the workspace that created it and pays for it.
reference:
type: string
description: The caller's trial identifier given at creation.
expires_at:
type: string
description: When the workspace is retired automatically.
retired_at:
description: When it was retired; null while it is still live.
type:
- string
- 'null'
api_key:
type: string
description: 'Key for the new workspace only. Scopes: run, sessions:read, devices:read, devices:write, devices:use, deployment:read.'
required:
- organization_id
- parent_organization_id
- reference
- expires_at
- retired_at
- api_key
DeleteOrganization:
type: object
properties:
name:
type: string
description: Exact current organization name confirming irreversible deletion.
required:
- name
EphemeralWorkspaceRetired:
type: object
properties:
organization_id:
type: string
format: uuid
pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
description: Id of the ephemeral workspace.
parent_organization_id:
type: string
format: uuid
pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
description: Id of the workspace that created it and pays for it.
reference:
type: string
description: The caller's trial identifier given at creation.
expires_at:
type: string
description: When the workspace is retired automatically.
retired_at:
type: string
description: When it was retired; always set, also when it was already retired before this call.
outcome:
description: What retirement did, saved when it ran; null if no outcome was saved.
type:
- object
- 'null'
properties:
reason:
type: string
enum:
- requested
- expired
description: Whether it was retired on request or at expiry.
cancelled_runs:
type: integer
description: Runs that were still live and were cancelled.
revoked_devices:
type: integer
description: Devices whose enrollment was revoked.
errors:
type: array
items:
type: string
description: Cleanup steps that failed; empty when retirement completed cleanly.
required:
- reason
- cancelled_runs
- revoked_devices
- errors
required:
- organization_id
- parent_organization_id
- reference
- expires_at
- retired_at
- outcome
CreateEphemeralWorkspace:
type: object
properties:
reference:
type: string
minLength: 1
maxLength: 200
pattern: ^[A-Za-z0-9._:-]+$
description: Caller trial identifier. The same request replays the same workspace and key; a different request with this reference conflicts.
ttl_minutes:
description: Lifetime before the workspace is retired automatically. Defaults to 240.
type: integer
minimum: 5
maximum: 720
credits:
description: Workspace budget in credits ($0.04 each), held on the parent's wallet and charged for actual use after retirement. Decimal string, defaults to 250, maximum 2,500; 0 runs only on the parent's connected provider accounts (BYOK).
type: string
rcus:
deprecated: true
description: 'Deprecated: use `credits`. The same budget in the ledger''s former unit (1 = 8.33 credits): defaults to 30, maximum 300. Sending both is refused unless they are equal.'
type: string
required:
- reference
Organization:
type: object
properties:
id:
type: string
description: Workspace id; the `orgId` other workspace tools take.
name:
type: string
description: Display name of the workspace.
slug:
type: string
description: URL-safe handle the server derives from the name.
membership_role:
type: string
enum:
- owner
- admin
- member
- viewer
description: The caller's membership role in this organization. This is not an app-wide product role.
parameters:
orgId:
name: orgId
in: path
required: true
description: Organization id or slug. Resolve it with `GET /v3/self`.
schema:
type: string
securitySchemes:
loopWebhookKey:
type: http
scheme: bearer
description: A Loop's webhook key, returned once by the createReasonLoop or updateReasonLoop call that adds the webhook. It only delivers events to that Loop's webhook; every other operation rejects it.
loopWebhookSignature:
type: apiKey
in: header
name: X-Signature-256
description: 'An HMAC-SHA256 of the exact request body keyed with the Loop''s webhook key or its stored signing secret: hex in `X-Signature-256` (optionally `sha256=`-prefixed), or the sender''s own header (`X-Hub-Signature-256`, `Stripe-Signature`, `Webhook-Signature`, `Svix-Signature`, `Linear-Signature`, `Sentry-Hook-Signature`, `X-Shopify-Hmac-Sha256`).'
reasonMachineToken:
type: http
scheme: bearer
bearerFormat: rmt_<hex>
description: A Machine token from createMachineToken. It can only create enrollment tickets for its own Machine; every other operation rejects it.
reasonUserOAuth:
type: http
scheme: bearer
description: A workspace-bound human user OAuth grant with org:write scope. The user must be an organization owner/admin. API keys and browser sessions are not accepted.
reasonApiKey:
type: http
scheme: bearer
bearerFormat: 'reason_<hex> (legacy: ara_<hex>)'
description: 'Your Reason API key from Settings › API keys. New keys use `reason_`; legacy `ara_` keys remain accepted. Keys are capability-scoped: run, mcp:read, mcp:write, secrets:read, secrets:write, sessions:read, sessions:debug, devices:read, devices:write, devices:use, computers:read, computers:write, ssh:write, knowledge:read, memory:read, memory:write, skills:read, skills:write, pages:read, pages:write, repos:read, repos:write, reviews:read, reviews:write, deployment:read, analytics:read, org:read, org:write, attachments:read, attachments:write, guardrails:read, guardrails:write, network:read, network:write, automations:read, automations:write, agent_auth:read. devices:write, devices:use, computers:read, computers:write, ssh:write, network:read and network:write are opt-in, excluded from default keys. computers:read lists visible cloud and connected computers without waking them or granting execution access. devices:read discovers local Device targets; devices:use separately consents to local execution, so a discover-and-run local workflow needs both. devices:write manages enrollment and device grants; computers:write creates or deletes cloud computers; ssh:write manages retained SSH access. network:read reads the saved workspace network policy; network:write replaces custom allowed hosts and requires a current organization owner/admin. Legacy project PATCH requests containing network_allowed_hosts also require network:write plus their existing run scope and project management permission; saved project hosts do not affect current session egress. Only owners/admins can mint or manage keys with network:write; keys cannot grant themselves more authority. See /docs/network-policies for replacement semantics and runtime applicability. mcp:write manages MCP server configuration only; it does not authorize remote MCP-tool execution. sessions:read reads sessions, including the assistant, reasoning and tool activity in their events. sessions:debug is privileged: only for organization owners/admins, it expands session events to the full diagnostic projection (diagnostic event kinds, status text and raw event metadata).'