# IOC Desk API reference

The [bundled OpenAPI 3.1 contract](openapi.json) contains the team API schemas and parameter constraints. The compact examples below use synthetic values. Replace IDs, tokens, revisions, digests and server origins with values returned by your installation.

Set `IOCDESK_ORIGIN` to the exact team HTTPS origin and read `IOCDESK_TOKEN` from a private credential source. Send it in the `Authorization: Bearer` header. Use `Content-Type: application/json` for JSON bodies. An HTTP loopback origin also works for local use.

| Status | Meaning |
| --- | --- |
| 400 | Invalid Host, credential query parameter, malformed request, or unavailable manual refresh. |
| 401 | Missing, invalid, expired by rotation, or revoked bearer credential. |
| 403 | Insufficient role or entitlement, or a browser Origin that differs from the configured origin. |
| 404 / 405 | Record absent or HTTP method unsupported. |
| 408 | JSON body read exceeded 120 seconds. |
| 409 | Revision, digest, lease, idempotency, or state conflict. Fetch current state before retrying. |
| 413 / 415 / 422 | Body size, content type, or validation rejected. |
| 429 | Per-member collaboration limit reached. |
| 500 / 503 | Operation error or service capacity. `server_busy` includes `Retry-After: 1`. |

The general JSON ceiling is 32 MiB. Collaboration writes, agent management and job writes use 32 KiB. Eight API requests and eight blocking API operations can be admitted concurrently. The per-member one-minute limits are 360 sync/history requests combined, 30 chat sends, and 60 graph reads. Set connection and header read limits at the HTTPS reverse proxy.

Error response example

```json
{"error":{"code":"revision_conflict","message":"Reload the current workflow."},"revision":9}
```

## Public team endpoints

The public endpoints use the team Host check and carry no authentication or entitlement requirement. GET routes also support HEAD. The assets are embedded in the server executable.

| Request | Response |
| --- | --- |
| `GET /health` | 200 with `{"status":"ok"}`. Use the correct Host for readiness probes. |
| `GET /` | 200 with the team sign-in HTML. |
| `GET /app.js` | 200 with the bundled JavaScript. |
| `GET /style.css` | 200 with the stylesheet. |
| `GET /favicon.svg` | 200 with the bundled SVG app icon as `image/svg+xml`. |

```bash
curl -i "$IOCDESK_ORIGIN/health"
```

A Host mismatch returns 400. Unknown team paths return 404. Responses use the service's cache and browser security headers.

## Authenticated team endpoints

### `GET /api`

Discover API and authenticated identity.

Any valid current access token, including feed and external-agent tokens. This grants no access to other operations. The capability list describes server features, not grants to this token.

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api"
```

HTTP 200 uses `ApiDiscovery` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "name": "IOC Desk team API",
  "version": "0.5.1",
  "openapi": "/api/openapi.json",
  "identity": "/api/me",
  "authentication": {
    "type": "bearer",
    "header": "Authorization",
    "tokens_in_urls": false
  },
  "user": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "role": "viewer",
    "kind": "human"
  },
  "capabilities": [
    "workflows",
    "review",
    "feeds"
  ],
  "note": "Sample"
}
```

### `GET /api/openapi.json`

Download this OpenAPI contract.

Any valid current access token, including feed and external-agent tokens. This grants no access to other operations.

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/openapi.json"
```

HTTP 200 uses object.

Example response excerpt

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "IOC Desk team API",
    "version": "0.5.1"
  },
  "paths": {
    "…": {}
  },
  "components": {
    "…": {}
  }
}
```

### `GET /api/me`

Read own identity and server license status.

Any valid current access token, including feed and external-agent tokens. This grants no access to other operations. The checkout field is public purchase metadata for the matching publisher build, or null.

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/me"
```

HTTP 200 uses `Identity` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "user": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "role": "viewer",
    "kind": "human",
    "created_at": "2026-11-29T18:00:00Z",
    "revoked_at": null
  },
  "license": {
    "pro": true,
    "label": "Enterprise",
    "message": "Sample",
    "expires_at": null
  },
  "read_only": false,
  "team": {},
  "checkout": null
}
```

### `POST /api/license/refresh`

Refresh the server subscription license.

Human administrator. Developer test licenses require a new owner signature instead. One manual refresh runs at a time. An accepted refresh completes after a client disconnects.

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/license/refresh"
```

HTTP 200 uses `license` (LicenseStatus required), `read_only` (boolean required).

Example response

```json
{
  "license": {
    "pro": true,
    "label": "Enterprise",
    "message": "Sample",
    "expires_at": null
  },
  "read_only": false
}
```

HTTP 502. Authority could not issue a verified current entitlement.

### `GET /api/users`

List stable team identities.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded.

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/users"
```

HTTP 200 uses `users` (array of User required).

Example response

```json
{
  "users": []
}
```

### `POST /api/users`

Create a human member and return its token once.

Human administrator; an active Enterprise entitlement is required. Reuse existing identities; duplicate active names are rejected.

Request JSON uses `CreateUser` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "name": "Sample",
  "role": "reviewer"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/users"
```

HTTP 200 uses `CredentialResult` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "user": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "role": "viewer",
    "kind": "human",
    "created_at": "2026-11-29T18:00:00Z",
    "revoked_at": null
  },
  "token": "<one-time token>"
}
```

### `PUT /api/users/{id}`

Change a human member role.

Human administrator; an active Enterprise entitlement is required. Agent accounts must be managed in Agents.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | Yes |

Request JSON uses `role` (viewer / reviewer / publisher / admin / feed_reader required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "role": "reviewer"
}
```

```bash
curl -sS -X PUT -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/users/8d5bc255-4ee3-4006-bc79-e101139116df"
```

HTTP 200 uses `TeamUserResult` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "user": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "role": "viewer",
    "kind": "human",
    "created_at": "2026-11-29T18:00:00Z",
    "revoked_at": null
  }
}
```

### `DELETE /api/users/{id}`

Revoke a member or agent while retaining attribution.

Human administrator; available after license expiry. The last active administrator is protected.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | Yes |

```bash
curl -sS -X DELETE -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/users/8d5bc255-4ee3-4006-bc79-e101139116df"
```

HTTP 200 uses `TeamUserResult` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "user": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "role": "viewer",
    "kind": "human",
    "created_at": "2026-11-29T18:00:00Z",
    "revoked_at": null
  }
}
```

### `POST /api/users/{id}/rotate`

Replace an existing human or external-agent access token.

Human administrator; an active Enterprise entitlement is required. Managed agents have no exported token. Old tokens stop working immediately.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | Yes |

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/users/8d5bc255-4ee3-4006-bc79-e101139116df/rotate"
```

HTTP 200 uses `CredentialResult` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "user": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "role": "viewer",
    "kind": "human",
    "created_at": "2026-11-29T18:00:00Z",
    "revoked_at": null
  },
  "token": "<one-time token>"
}
```

### `GET /api/workflows`

List workflow names and revisions.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. Returns workflow summaries.

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows"
```

HTTP 200 uses `workflows` (array of WorkflowSummary required).

Example response

```json
{
  "workflows": []
}
```

### `POST /api/workflows`

Create a reusable shared workflow.

Human administrator; an active Enterprise entitlement is required. The URL path segments "." and ".." cannot be workflow IDs.

Request JSON uses `config` (WorkflowConfig required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  }
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `GET /api/workflows/{id}`

Read workflow, current review, attribution, and gates.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/incident-0042"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `PUT /api/workflows/{id}`

Update workflow configuration at the expected revision.

Human administrator; an active Enterprise entitlement is required. ID is immutable; prepare a new complete snapshot after configuration changes.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

Request JSON uses `expected_revision` (int64 required), `config` (WorkflowConfig required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  }
}
```

```bash
curl -sS -X PUT -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `POST /api/workflows/{id}/prepare`

Import complete source snapshots.

Human reviewer, publisher, or administrator; active Enterprise required. Supply the current revision to avoid overwriting another analyst. Server time is authoritative; do not supply as_of.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

Request JSON uses `PrepareWorkflow` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "inputs": [
    {
      "name": "feed",
      "format": "csv",
      "content": "type,indicator,context,case\ndomain,collector.example,Configuration endpoint from training sample,IR-0042\nurl,hxxps://payload.example/Stage?ID=AbC,First stage download observed in training notes,IR-0042\nipv4,198.51.100.42,Training network observation,IR-0042\nsha256,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,Synthetic hash-shaped training value,IR-0042\ndomain,shared-service.example,Shared service requiring analyst context,IR-0042\n"
    }
  ]
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042/prepare"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `POST /api/workflows/{id}/decisions`

Record human IOC decisions.

Human reviewer, publisher, or administrator; active Enterprise required. Supply the current revision to avoid overwriting another analyst.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

Request JSON uses `DecideWorkflow` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "ids": [
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  ],
  "state": "keep",
  "reason": "Confirmed in the evidence"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042/decisions"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `POST /api/workflows/{id}/renew`

Renew selected indicator validity.

Human reviewer, publisher, or administrator; active Enterprise required. Supply the current revision to avoid overwriting another analyst.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

Request JSON uses `RenewWorkflow` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "ids": [
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  ],
  "reason": "Confirmed in the evidence"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042/renew"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `POST /api/workflows/{id}/verify`

Independently verify current decisions.

Human publisher or administrator; active Enterprise required. A person cannot independently verify their own decision. This optional evidence check is not required for publication.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

Request JSON uses `VerifyWorkflow` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "expected_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "ids": [
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  ]
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042/verify"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `POST /api/workflows/{id}/publish`

Publish the exact gated reviewed candidate.

Human publisher or administrator; active Enterprise required. Current publication gates must pass. May approve and publish their own reviewed work; independent decision verification is optional.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

Request JSON uses `PublishWorkflow` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "expected_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042/publish"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `GET /api/workflows/{id}/validate`

Read publication gates, approval status, and current candidate digest.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. Gate and digests are null before a review has been prepared.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/incident-0042/validate"
```

HTTP 200 uses `revision` (int64 required), `gate` (object or null required), `candidate_digest` (string or null required), `expected_digest` (string or null required), `publication_request` (PublicationRequest or null required).

Example response

```json
{
  "revision": 1,
  "gate": null,
  "candidate_digest": null,
  "expected_digest": null,
  "publication_request": null
}
```

### `GET /api/workflows/{id}/publication-requests`

Read the latest publication approval requests.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. Returns the latest 100 requests, newest first, including resolved requests.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/incident-0042/publication-requests"
```

HTTP 200 uses `requests` (array of PublicationRequest required), `has_more` (boolean required).

Example response

```json
{
  "requests": [],
  "has_more": false
}
```

### `POST /api/workflows/{id}/publication-requests`

Submit the exact reviewed candidate for Publisher approval.

Human reviewer, publisher, or administrator; active Enterprise required. Supply the current revision to avoid overwriting another analyst. Saves an attributed pending request without changing the published feed. A Reviewer cannot approve it. Changes to the candidate make the request outdated.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

Request JSON uses `RequestPublication` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "expected_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042/publication-requests"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `POST /api/workflows/{id}/publication-requests/{request_id}/approve`

Approve a pending request and publish its exact candidate.

Human publisher or administrator; active Enterprise required. Current publication gates must pass. May approve and publish their own reviewed work; independent decision verification is optional. Requires the current revision and the pending request candidate digest. Approval and release publication are atomic; the response also includes release. A changed candidate cannot inherit approval of an older request. A lost-response replay requires the original resolver and same effective trimmed note; changed approval payloads return conflict.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |
| `request_id` | path | uuid | Yes |

Request JSON uses `ApprovePublication` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "expected_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042/publication-requests/8d5bc255-4ee3-4006-bc79-e101139116df/approve"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `POST /api/workflows/{id}/publication-requests/{request_id}/reject`

Reject a pending publication request with a reason.

Human publisher or administrator; active Enterprise required. Requires the current revision and a pending request, but not passing publication gates. Records the resolver and reason. Does not change existing published feeds; the reviewer can prepare and submit a corrected candidate.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |
| `request_id` | path | uuid | Yes |

Request JSON uses `RejectPublication` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "reason": "Confirmed in the evidence"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/incident-0042/publication-requests/8d5bc255-4ee3-4006-bc79-e101139116df/reject"
```

HTTP 200 uses `WorkflowDetail` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "revision": 1,
  "config": {
    "schema_version": 1,
    "id": "incident-0042",
    "name": "Incident 0042 — reviewed indicators",
    "profile": {
      "schema_version": 1,
      "id": "incident-response",
      "name": "Incident response",
      "allowed_types": [
        "ipv4",
        "ipv6",
        "domain",
        "url",
        "email",
        "md5",
        "sha1",
        "sha256",
        "sha512"
      ],
      "warning_lists": [],
      "require_reason_for_warnings": true,
      "require_all_reviewed": true,
      "export": {
        "defang": true,
        "columns": [
          {
            "field": "type",
            "heading": "type"
          },
          {
            "field": "value",
            "heading": "indicator"
          },
          {
            "field": "decision",
            "heading": "decision"
          },
          {
            "field": "reason",
            "heading": "reason"
          }
        ]
      }
    },
    "sources": [
      {
        "id": "feed",
        "format": "csv",
        "complete_snapshot": true,
        "mapping": {
          "value_field": "indicator",
          "type_field": "type",
          "fixed_kind": null
        }
      }
    ],
    "policy": {
      "client_id": "training-client",
      "ttl_days": 30,
      "max_removal_percent": 25,
      "allow_empty": false,
      "require_separate_publisher": true,
      "require_reason_for_kept": true,
      "block_import_issues": true
    }
  },
  "config_stale": false,
  "reanalysis_required": false,
  "run": null,
  "candidate_digest": null,
  "expected_digest": null,
  "gate": null,
  "decision_actors": {},
  "decision_approvals": {},
  "latest_release": null,
  "publication_request": null
}
```

### `GET /api/workflows/{id}/releases`

List immutable published releases.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/incident-0042/releases"
```

HTTP 200 uses `releases` (array of ReleaseSummary required).

Example response

```json
{
  "releases": []
}
```

### `GET /api/workflows/{id}/releases/{release_id}`

Read an immutable release.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |
| `release_id` | path | string | Yes |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/incident-0042/releases/release-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
```

HTTP 200 uses `release` (Release required), `actor_id` (uuid required), `note` (string required), `revision` (int64 required).

Example response

```json
{
  "release": {
    "schema_version": 1,
    "id": "Sample",
    "workflow_id": "incident-0042",
    "client_id": "Sample",
    "candidate_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "created_at": "2026-11-29T18:00:00Z",
    "indicators": [],
    "delta": {
      "baseline_id": null,
      "added": [],
      "updated": [],
      "removed": []
    },
    "digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "actor_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
  "note": "Sample",
  "revision": 1
}
```

### `GET /api/workflows/{id}/releases/{release_id}/bundle`

Download the frozen release ZIP.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |
| `release_id` | path | string | Yes |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/incident-0042/releases/release-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bundle"
```

HTTP 200 returns raw ZIP bytes with `Content-Disposition: attachment`.

### `GET /api/workflows/{id}/feed/{format}`

Read the latest approved feed with ETag support.

Human or feed-reader token; external-agent tokens excluded. Returns only already-published immutable content; current candidate changes do not alter this feed.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |
| `format` | path | csv / txt / json / stix / delta | Yes |
| `If-None-Match` | header | string | No |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/incident-0042/feed/json"
```

HTTP 200 returns the selected format. JSON example follows. See the contract for CSV, TXT, STIX, and delta types.

```json
{
  "schema_version": 1,
  "release_id": "release-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "indicators": []
}
```

HTTP 304. The ETag matches; no response body.

### `GET /api/audit`

Read persistent audit events.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. Use next_after while has_more is true. Pages may stop before the requested count to keep full record details within 8 MiB, with one record guaranteed if events remain.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `after` | query | integer | No |
| `limit` | query | integer | No |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/audit"
```

HTTP 200 uses `events` (array of AuditEvent required), `next_after` (int64 required), `has_more` (boolean required).

Example response

```json
{
  "events": [],
  "next_after": 1,
  "has_more": false
}
```

### `GET /api/workflows/{id}/audit`

Read persistent audit events.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. Use next_after while has_more is true. Pages may stop before the requested count to keep full record details within 8 MiB, with one record guaranteed if events remain.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |
| `after` | query | integer | No |
| `limit` | query | integer | No |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/incident-0042/audit"
```

HTTP 200 uses `events` (array of AuditEvent required), `next_after` (int64 required), `has_more` (boolean required).

Example response

```json
{
  "events": [],
  "next_after": 1,
  "has_more": false
}
```

### `POST /api/collaboration/sync`

Heartbeat, current identity, and bounded live messages/activity/job status.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. Poll about every two seconds. user is the current authenticated identity; clients should refresh role controls from it without discarding drafts. Reset cursors when changing rooms. A zero cursor returns the latest100 messages/events; presence expires after30 seconds. Live audit details are bounded to16KiB per event; full audit endpoints retain original details.

Request JSON uses `SyncRequest` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "session_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
  "view": "overview"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/collaboration/sync"
```

HTTP 200 uses `SyncResult` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "server_time": "2026-11-29T18:00:00Z",
  "enterprise": false,
  "activity": [],
  "messages": [],
  "presence": [],
  "next_activity": 1,
  "next_message": 1,
  "user": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "role": "viewer",
    "kind": "human",
    "created_at": "2026-11-29T18:00:00Z",
    "revoked_at": null
  }
}
```

### `POST /api/collaboration/leave`

Remove this identity's specified presence session.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded.

Request JSON uses `session_id` (uuid required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "session_id": "8d5bc255-4ee3-4006-bc79-e101139116df"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/collaboration/leave"
```

HTTP 200 uses `left` (true required).

Example response

```json
{
  "left": true
}
```

### `GET /api/chat/messages`

Read older messages in one room.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. Results are oldest first. Request the next older page with before=next_before.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `workflow_id` | query | string | No |
| `before` | query | integer | No |
| `limit` | query | integer | No |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/chat/messages"
```

HTTP 200 uses `messages` (array of Message required), `next_before` (int64 or null required), `has_more` (boolean required).

Example response

```json
{
  "messages": [],
  "next_before": null,
  "has_more": false
}
```

### `POST /api/chat/messages`

Send, mention people, reply, or explicitly ask one agent.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. New messages require Enterprise. Keep client_message_id and content unchanged on retry. Reply and IOC attachment must belong to the same room. Only explicit agent_id queues one agent response; an @name string alone does not. External agents cannot post unsolicited messages.

Request JSON uses `SendMessage` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "client_message_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
  "body": "Please summarize the attached evidence."
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/chat/messages"
```

HTTP 200 uses `message` (Message required), `deduplicated` (boolean required), `agent_job` (AgentJob or null required).

Example response

```json
{
  "message": {
    "id": 1,
    "client_message_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "workflow_id": null,
    "actor_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "actor_name": "Sample",
    "body": "Please summarize the attached evidence.",
    "created_at": "2026-11-29T18:00:00Z",
    "actor_kind": "human",
    "indicator": null,
    "reply_to": null,
    "mentions": [],
    "agent_request": null,
    "agent": null,
    "edited_at": null,
    "edit_version": 0
  },
  "deduplicated": false,
  "agent_job": null
}
```

### `PUT /api/chat/messages/{id}`

Edit a message authored by the current human member.

Only the original human author may edit. Requires an active Enterprise entitlement and a matching edit version. Agent-invoking messages are immutable. Trims whitespace and rejects an empty body, >4,000 characters, >16,000 UTF-8 bytes, and unsupported control characters. Emits a chat edit event and audit entry; does not overwrite earlier published evidence.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | int64 | Yes |

Request JSON uses `body` (string required), `expected_edit_version` (int64 required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "body": "Please summarize the attached evidence.",
  "expected_edit_version": 0
}
```

```bash
curl -sS -X PUT -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/chat/messages/1"
```

HTTP 200 uses `message` (Message required), `unchanged` (boolean required).

Example response

```json
{
  "message": {
    "id": 1,
    "client_message_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "workflow_id": null,
    "actor_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "actor_name": "Sample",
    "body": "Please summarize the attached evidence.",
    "created_at": "2026-11-29T18:00:00Z",
    "actor_kind": "human",
    "indicator": null,
    "reply_to": null,
    "mentions": [],
    "agent_request": null,
    "agent": null,
    "edited_at": null,
    "edit_version": 0
  },
  "unchanged": false
}
```

### `POST /api/chat/read`

Advance the current member’s per-room read cursor.

Human viewer, reviewer, publisher, or administrator. Without last_read_message_id, the server acknowledges the latest message in this room. Requested cursors are capped to the room latest and never decrease. Does not mark other rooms read.

Request JSON uses `workflow_id` (string or null), `last_read_message_id` (int64 or null).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/chat/read"
```

HTTP 200 uses `last_read_id` (int64 required), `rooms` (array of ChatRoomSummary required), `notifications` (array of ChatNotification required).

Example response

```json
{
  "last_read_id": 0,
  "rooms": [],
  "notifications": []
}
```

### `GET /api/chat/rooms`

List team and workflow chat rooms with per-member unread counters.

Human viewer, reviewer, publisher, or administrator. Includes the shared team room and all workflows accessible on this team server; read positions are specific to this member.

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/chat/rooms"
```

HTTP 200 uses `rooms` (array of ChatRoomSummary required).

Example response

```json
{
  "rooms": []
}
```

### `GET /api/chat/notifications`

Get recent incoming notifications for one room.

Human viewer, reviewer, publisher, or administrator. At most 30 latest incoming messages, mentions, or replies. Omit workflow_id to query the shared team room.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `workflow_id` | query | string | No |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/chat/notifications"
```

HTTP 200 uses `notifications` (array of ChatNotification required).

Example response

```json
{
  "notifications": []
}
```

### `GET /api/graph`

Read graph relationships, evidence, and human attribution.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded. Derived URL/email components are labeled. No external lookup occurs. Node/edge/workflow/response-size omissions are disclosed.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `workflow_id` | query | string | No |
| `q` | query | string | No |
| `limit` | query | integer | No |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/graph"
```

HTTP 200 uses `Graph` in the [OpenAPI contract](openapi.json).

Example response

```json
{
  "nodes": [],
  "edges": [],
  "counts": {},
  "truncated": false,
  "truncation": {}
}
```

### `GET /api/agents`

List available named agents without provider secrets.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded.

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/agents"
```

HTTP 200 uses `agents` (array of Agent required).

Example response

```json
{
  "agents": []
}
```

### `POST /api/agents`

Create a managed model or external service-agent identity.

Human administrator; an active Enterprise entitlement is required. Managed keys are write-only. External agents receive assigned context through claim/complete/fail only.

Request JSON uses `AgentConfig` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "name": "Sample",
  "kind": "managed",
  "endpoint": "http://127.0.0.1:11434/v1",
  "model": "YOUR_CONFIGURED_MODEL"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/agents"
```

HTTP 200 uses `agent` (Agent required), `token` (string).

Example response

```json
{
  "agent": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "user_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "kind": "managed",
    "enabled": false,
    "api_key_configured": false,
    "config_revision": 1
  }
}
```

### `PUT /api/agents/{id}`

Update, enable, or disable a named agent.

Human administrator; an active Enterprise entitlement is required. Submit the complete configuration. Omitted non-secret settings take their defaults and kind is immutable. On a URL change, replace the existing key or clear it explicitly. Reconfiguration invalidates outstanding jobs.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | Yes |

Request JSON uses `AgentConfig` in the [OpenAPI contract](openapi.json).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "name": "Sample",
  "kind": "managed",
  "endpoint": "http://127.0.0.1:11434/v1",
  "model": "YOUR_CONFIGURED_MODEL"
}
```

```bash
curl -sS -X PUT -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/agents/8d5bc255-4ee3-4006-bc79-e101139116df"
```

HTTP 200 uses `agent` (Agent required).

Example response

```json
{
  "agent": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "user_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "name": "Sample",
    "kind": "managed",
    "enabled": false,
    "api_key_configured": false,
    "config_revision": 1
  }
}
```

### `GET /api/agent-jobs`

Read agent requests in the selected chat room.

Human viewer, reviewer, publisher, or administrator. Agent and feed credentials are excluded.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `workflow_id` | query | string | No |
| `limit` | query | integer | No |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/agent-jobs"
```

HTTP 200 uses `jobs` (array of AgentJob required).

Example response

```json
{
  "jobs": []
}
```

### `POST /api/agent-jobs/{id}/cancel`

Cancel an explicit agent request.

The requesting human or an administrator. Cancellation is available in read-only mode and discards late output. An already-started provider request may still incur charges.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | integer | Yes |

Request JSON uses `expected_attempt` (integer required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_attempt": 1
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/agent-jobs/1/cancel"
```

HTTP 200 uses `job` (AgentJob required).

Example response

```json
{
  "job": {
    "id": 1,
    "agent_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "workflow_id": null,
    "trigger_message_id": 1,
    "requested_by": {
      "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
      "name": "Sample"
    },
    "status": "queued",
    "attempt": 1
  }
}
```

### `POST /api/agent-jobs/{id}/retry`

Retry an explicit agent request.

The requesting human or an administrator. Retry requires Enterprise and is limited to three attempts. Repeating the same expected_attempt is idempotent.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | integer | Yes |

Request JSON uses `expected_attempt` (integer required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_attempt": 1
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/agent-jobs/1/retry"
```

HTTP 200 uses `job` (AgentJob required).

Example response

```json
{
  "job": {
    "id": 1,
    "agent_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "workflow_id": null,
    "trigger_message_id": 1,
    "requested_by": {
      "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
      "name": "Sample"
    },
    "status": "queued",
    "attempt": 1
  }
}
```

### `POST /api/agent-jobs/claim`

Claim one explicitly assigned external-agent job.

An enabled external-agent identity with active Enterprise. Reuse client_claim_id after an unknown response. Context contains the human request, explicit reply ancestors, and attached IOC evidence. Idle returns job:null.

Request JSON uses `client_claim_id` (uuid required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "client_claim_id": "8d5bc255-4ee3-4006-bc79-e101139116df"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/agent-jobs/claim"
```

HTTP 200 uses `job` (AgentJob or null required), `lease_token` (uuid), `lease_expires_at` (date-time), `context` (object).

Example response

```json
{
  "job": null
}
```

### `POST /api/agent-jobs/{id}/complete`

Post one answer under the active assigned lease.

Assigned external-agent token, current lease and active Enterprise for new answers. An identical completed answer is idempotent. A changed answer for a completed lease returns 409.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | integer | Yes |

Request JSON uses `lease_token` (uuid required), `body` (string required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "lease_token": "8d5bc255-4ee3-4006-bc79-e101139116df",
  "body": "Please summarize the attached evidence."
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/agent-jobs/1/complete"
```

HTTP 200 uses `job` (AgentJob required), `message` (Message required), `deduplicated` (boolean required).

Example response

```json
{
  "job": {
    "id": 1,
    "agent_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "workflow_id": null,
    "trigger_message_id": 1,
    "requested_by": {
      "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
      "name": "Sample"
    },
    "status": "queued",
    "attempt": 1
  },
  "message": {
    "id": 1,
    "client_message_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "workflow_id": null,
    "actor_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "actor_name": "Sample",
    "body": "Please summarize the attached evidence.",
    "created_at": "2026-11-29T18:00:00Z",
    "actor_kind": "human",
    "indicator": null,
    "reply_to": null,
    "mentions": [],
    "agent_request": null,
    "agent": null,
    "edited_at": null,
    "edit_version": 0
  },
  "deduplicated": false
}
```

### `POST /api/agent-jobs/{id}/fail`

Mark the assigned external-agent attempt failed.

External-agent token for this job only. No automatic provider retry is performed.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | integer | Yes |

Request JSON uses `lease_token` (uuid required), `error` (string required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "lease_token": "8d5bc255-4ee3-4006-bc79-e101139116df",
  "error": "Sample"
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/agent-jobs/1/fail"
```

HTTP 200 uses `job` (AgentJob required).

Example response

```json
{
  "job": {
    "id": 1,
    "agent_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "workflow_id": null,
    "trigger_message_id": 1,
    "requested_by": {
      "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
      "name": "Sample"
    },
    "status": "queued",
    "attempt": 1
  }
}
```

### `GET /api/workflows/{id}/enrichment`

Read the last shared advisory reputation report and lookup status.

Authorized human viewers can read team-scoped results. The stale flag indicates that the workflow review changed after the external lookup.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

```bash
curl -sS -X GET -H "Authorization: Bearer $IOCDESK_TOKEN" "$IOCDESK_ORIGIN/api/workflows/Sample/enrichment"
```

HTTP 200 uses `workflow_id` (string), `providers` (array of string), `job` (object or null).

Example response

```json
{
  "workflow_id": "incident-0042",
  "providers": [],
  "job": null
}
```

### `POST /api/workflows/{id}/enrichment`

Start a bounded, human-consented reputation lookup for 1–100 indicator IDs.

Requires a reviewer/publisher/admin and active Enterprise entitlement. Provider credentials are configured in the team server process environment, never supplied by the client. External lookups execute in the background without holding the team database lock. Results are advisory and cannot change decisions or publish a feed.

| Field | Location | Type | Required |
| --- | --- | --- | --- |
| `id` | path | string | Yes |

Request JSON uses `expected_revision` (integer required), `ids` (array of string required), `consent` (true required).

Save this sample as `request.json` and substitute current identifiers and revisions.

```json
{
  "expected_revision": 1,
  "ids": [
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  ],
  "consent": true
}
```

```bash
curl -sS -X POST -H "Authorization: Bearer $IOCDESK_TOKEN" -H 'Content-Type: application/json' --data-binary @request.json "$IOCDESK_ORIGIN/api/workflows/Sample/enrichment"
```

HTTP 202 uses object.

Example response

```json
{
  "job": {
    "id": "8d5bc255-4ee3-4006-bc79-e101139116df",
    "status": "running"
  },
  "workflow_id": "incident-0042"
}
```

## Vendor licensing authority

The publisher-operated service is separate from the team server. All requests use its pinned Host. Browser Origin, if present, must match exactly. The three POST endpoints use the relevant Polar license credential in JSON and the publisher's server-side Polar access token. Client requests need no team bearer token.

| Request | Body | Success |
| --- | --- | --- |
| `GET /healthz` | None | 200 with `{"status":"ok"}`. |
| `POST /v1/licenses/activate` | Schema version 1, key, installation UUID, nonce UUID, optional activation UUID or null | 200 with a signed activation envelope. |
| `POST /v1/licenses/refresh` | Same fields with an existing activation UUID | 200 with a signed refresh envelope. |
| `POST /v1/licenses/deactivate` | Same fields with an existing activation UUID | 204 with an empty body. |

Send `Content-Type: application/json` and read the key from a private request file. Use `activation_id: null` for an initial activation. The other methods use the saved activation UUID. The application's licensing client sets a fresh nonce and verifies the response.

```json
{
  "schema_version": 1,
  "key": "<customer license key>",
  "installation_id": "8d5bc255-4ee3-4006-bc79-e101139116df",
  "nonce": "36071d43-de8f-4477-9891-663d069bcb7b",
  "activation_id": null
}
```

```bash
curl -i "$IOCDESK_AUTHORITY_ORIGIN/healthz"
curl -i -H "Content-Type: application/json" --data-binary @private-activate.json "$IOCDESK_AUTHORITY_ORIGIN/v1/licenses/activate"
curl -i -H "Content-Type: application/json" --data-binary @private-existing-activation.json "$IOCDESK_AUTHORITY_ORIGIN/v1/licenses/refresh"
curl -i -H "Content-Type: application/json" --data-binary @private-existing-activation.json "$IOCDESK_AUTHORITY_ORIGIN/v1/licenses/deactivate"
```

The signature and payload are hex. The payload contains the signed lease claims. The values below show the shape of an envelope.

```json
{"schema_version":1,"key_id":"<16 hex characters>","payload":"<hex UTF-8 lease JSON>","signature":"<128 hex characters>"}
```

Error bodies contain string fields `error` and `message`. 400 covers invalid body or missing activation UUID, 403 covers authoritative denial, 421 covers Host or Origin, 429 covers rate limits, and 503 covers upstream/configuration errors, capacity, timeout or unavailable activation. For example `{"error":"denied","message":"This key or activation does not grant IOC Desk Enterprise."}`.

The authority admits 16 inbound requests and four upstream jobs, accepts up to 64 KiB of request JSON, and has a 90-second ingress deadline. The rate limiter allows 60 requests per minute globally and 12 per license-key fingerprint. Retry responses include `Retry-After: 60`. See the [vendor operations guide](../licensing-authority/README.md).
