Sub-workspaces API
POST, GET, PATCH and DELETE /v1/workspaces — partner mode sub-workspaces, one per customer of your app, addressed by your external_id.
Partner mode only (guide). Authenticate with your API key. {ref} is the sub-workspace's id or ext:<external_id>.
Create or update
POST https://api.dcision.io/v1/workspaces| Field | Type | |
|---|---|---|
external_id | string | Required. Your id for the customer: 1–128 characters [A-Za-z0-9._:-] |
name | string | Required. 1–80 characters |
metadata | object | Up to 20 string pairs you keep on it |
limits | object | max_decisions, monthly_decisions (null = your default) |
seed | object | On creation only: { "decisions": ["slug"], "deploy": true } copies your deployed decisions |
201 when created, 200 when it already existed (the name, metadata and limits sent are updated):
{
"id": "0b0c1d2e-6a1f-4c55-9b0e-3f6d7a8c9e01",
"external_id": "acme",
"name": "Acme Inc",
"metadata": {},
"limits": { "max_decisions": 10, "monthly_decisions": null },
"usage": { "decisions": 1, "period_used": 0, "period_start": "2026-10-01T00:00:00.000Z", "period_end": "2026-11-01T00:00:00.000Z" },
"created_at": "2026-10-09T12:00:00.000Z",
"seed": { "created": [{ "slug": "lead-qualification", "id": "dec_…", "deployed": true }], "skipped": [] }
}Errors: 403 FORBIDDEN (partner_disabled — turn on partner mode; key_without_author), 402 PLAN_LIMIT_REACHED (scope: "workspaces").
List, get, update, delete
| Request | |
|---|---|
GET /v1/workspaces?limit=&cursor=&external_id= | { "data": [ … ], "next_cursor" } |
GET /v1/workspaces/{ref} | One sub-workspace |
PATCH /v1/workspaces/{ref} | name, metadata, limits |
DELETE /v1/workspaces/{ref} | 204: deletes it with its decisions and executions |
An unknown {ref} — or another workspace's — answers 404 WORKSPACE_NOT_FOUND.
List executions
GET /v1/executions — recent runs of your decisions with answers, action, reason and metrics, filtered by decision and status and paginated with a cursor. Inputs are never returned.
Embed sessions API
POST /v1/embed/sessions — open the embeddable editor for one of your end users in their sub-workspace; revoke sessions. Server-side only.