- DevCraft Platform
- Documentation
- REST API
Reference
REST API
This is the reference for the DevCraft Platform REST API, version 1. It lists the conventions every endpoint shares (authentication, errors, headers, pagination) and then every route the backend registers, grouped by area, with the role it requires. It is written for developers who build integrations or extend the SPA; the route list is taken from backend/routes/api.php and the controllers.
Conventions
| Topic | Rule |
|---|---|
| Base path | /api/v1. Breaking changes go to a new /api/v2 group; additive changes stay in v1 and are optional for clients. |
| Format | JSON request and response bodies (Accept: application/json). Response keys are camelCase (pageSize, timeZone); timestamps are ISO 8601 with offset; identifiers are UUIDs (v7). XML transfer and package endpoints exchange application/xml. |
| Resources | Single objects are returned unwrapped: no data envelope. Paginated lists use { items, total, page, pageSize }. |
| Errors | RFC 9457 application/problem+json with a stable machine-readable code. Branch on code, never on title or detail. |
| Rate limits | throttle:api: 120 requests per minute per user (or IP) on the meta, table, portal and remote groups. throttle:login: 5 attempts per minute per e-mail and IP. Both are configurable (PLATFORM_RATE_LIMIT_API, PLATFORM_RATE_LIMIT_LOGIN). Exceeding a limit answers 429 rate_limited with Retry-After. |
| Route parameters | Table, field and layout names must match [a-z][a-z0-9_]{0,79} (layouts also allow -). The dictionary decides whether a name exists; unknown and unreadable tables look the same (404 unknown_table). |
Headers
X-Request-Id- On every response. Send your own (8 to 64 characters of
[A-Za-z0-9._-]) to have it echoed and logged; otherwise the server generates one. Problem responses repeat it asrequestId. X-Correlation-Id- Same format. Identifies one client operation across several requests; when absent it equals the request id. Echoed on every response and stored on system log events. See Operations.
X-Change-Set- The id of the update set that configuration writes in this request are captured into. Without the header the user's saved current set is used, else the scope's Default set. A value that is not a UUID answers 400
invalid_query; a set that is no longer in progress makes the configuration write fail with 422metadata_invalid(it is never redirected elsewhere). See Update sets. X-XSRF-TOKEN- Required on state-changing requests of a cookie session (see below).
Authentication
The API uses Laravel Sanctum in two modes. Every endpoint except /api/v1/health and /api/v1/auth/login requires one of them.
| Mode | Used by | How |
|---|---|---|
| Session cookie | The SPA, from an origin in SANCTUM_STATEFUL_DOMAINS | GET /sanctum/csrf-cookie sets the XSRF-TOKEN cookie; send its value as X-XSRF-TOKEN on POST, PUT, PATCH and DELETE. Then POST /api/v1/auth/login starts the session. A missing or stale token answers 419 csrf_token_mismatch. |
| Bearer token | Integrations, scripts, remote instances | Authorization: Bearer <token>. Create a token with POST /api/v1/auth/tokens while signed in. |
Sign-in protections: 5 attempts per minute per e-mail and IP, and the account is locked after PLATFORM_LOCKOUT_ATTEMPTS (5) failures (423 account_locked; an administrator unlocks it). An unknown e-mail, a wrong password and an inactive account all give the same 422 message, so the API does not reveal which accounts exist.
Token abilities and expiry
| Ability | Checked today |
|---|---|
table:write | Yes: Table API create, update and delete, XML import, portal request creation. Without it the answer is 403 forbidden. |
remote:read | Yes: the /api/v1/remote/* provider routes. |
table:read, meta:read | Stored on the token for the planned API scopes; not yet checked separately. Reads are governed by table and field access. |
A token gets all four abilities unless you pass a subset. It expires after expires_in_days (1 to 365, default 90). The plain token is returned once; only a hash is stored. POST /api/v1/auth/logout with a bearer token revokes that token. A session has every ability. Roles are the user's effective roles (direct grants plus group roles); admin is never derived from groups. See Access control.
Errors
App\Platform\Kernel\Http\ProblemDetails renders every exception under /api/* as a problem document with Content-Type: application/problem+json:
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
X-Request-Id: 0192f3c4-8a1b-7c2d-9e0f-1a2b3c4d5e6f
{
"type": "about:blank",
"title": "Validation failed.",
"status": 422,
"detail": "Urgency must be one of: 1, 2, 3.",
"instance": "/api/v1/table/incident/0192f1a2-7d3e-7000-8000-000000000101",
"code": "validation_failed",
"requestId": "0192f3c4-8a1b-7c2d-9e0f-1a2b3c4d5e6f",
"errors": {
"urgency": ["Urgency must be one of: 1, 2, 3."]
}
}
Members: type, title, status, detail, instance (request path), code, requestId, plus code-specific members such as errors, currentVersion, referrers, outcome and details. Empty members are omitted. A 500 hides the exception message unless APP_DEBUG is on; quote the request id instead.
Stable error codes
| Code | Status | Meaning and extra members |
|---|---|---|
bad_request | 400 | Generic malformed request. |
invalid_query | 400 | Invalid list parameters (page, sort, filters, operator for a field type, unknown field), malformed X-Change-Set. |
xml_invalid | 400 | Malformed or refused record XML (for example a DOCTYPE or entity), or a value XML cannot carry on export. |
package_invalid | 400 | Malformed update set package. |
unauthenticated | 401 | No valid session or token; expired or revoked token. |
forbidden | 403 | Missing role, table access or token ability; writes to platform-managed tables. |
not_found | 404 | Record, layout or object does not exist (or is not visible to the caller). |
unknown_table | 404 | Table does not exist, is retired, or the caller may not read it. |
method_not_allowed | 405 | HTTP method not supported on the path. |
conflict | 409 | Optimistic lock failed; currentVersion holds the record's current version. |
reference_in_use | 409 | Delete refused by a restricting reference; referrers lists { table, field, count }. |
preview_expired | 410 | Package preview is past its lifetime. |
transfer_too_large | 413 | XML export or import above the configured limits. |
package_too_large | 413 | Package above the size or change limits. |
csrf_token_mismatch | 419 | Cookie session without a valid X-XSRF-TOKEN. |
validation_failed | 422 | Field validation; errors maps field names to messages. |
metadata_invalid | 422 | Invalid or conflicting metadata, invalid update set operation, stale current update set; errors per attribute. |
xml_unsupported_version | 422 | Record document of an unsupported format or major version. |
package_unsupported_version | 422 | Package of an unsupported format version. |
package_not_exportable | 422 | Update set cannot be exported (for example not completed), with the reason. |
account_locked | 423 | Too many failed sign-ins. |
rate_limited | 429 | Rate limit exceeded; see Retry-After. |
internal_error | 500 | Unhandled exception; logged with the request id. |
http_error | other | Any other HTTP status raised by the framework. |
Remote instance and remote update set codes are remote_<outcome>, with outcome and sanitised details members. They never contain credentials or authorization headers.
| Code | Status | Meaning |
|---|---|---|
remote_no_credential, remote_inactive, remote_blocked_url, remote_unreachable, remote_timeout, remote_auth_failed, remote_forbidden, remote_not_found, remote_remote_error, remote_invalid_response, remote_incompatible, remote_identity_mismatch, remote_too_large | 422 | Classified outcome of a connection to another instance (remote_not_found is 404 when a change does not exist in a set). |
remote_busy | 409 | The remote update set is being processed by another run. |
remote_stale_decision | 409 | The change was decided or re-assessed since the page loaded; details.currentVersion. |
remote_stale_comparison | 409 | The comparison is out of date with the package or the local object; compare again. |
remote_stale_approval | 409 | The approval token no longer matches the plan; review it again. |
remote_invalid_transition | 422 | Lifecycle transition not allowed in the current state. |
remote_integrity, remote_package_missing, remote_package_unreadable | 422 | Stored package fails its checksum, was removed by retention, or cannot be read; retrieve it again. |
remote_resolution_not_allowed, remote_merge_invalid | 422 | Conflict decision not available for the change; merged object not valid here. |
remote_not_eligible | 422 | The set is not eligible for application; details.reasons. |
remote_target_missing, remote_unsupported_operation, remote_content_changed, remote_verification_failed | 422 | An application run stopped on one change and was rolled back. |
Per-record outcomes of an XML import are not errors: the import answers 200 and lists each record's outcome and reason. See Operations.
Lists, filters and pagination
The Table API list endpoint (GET /api/v1/table/{table}) takes these query parameters:
| Parameter | Format | Limits |
|---|---|---|
page | integer, from 1 | 1 to 100,000 |
pageSize | integer | 1 to 500; default is the list layout's page size (25) |
sort | field:asc|desc, comma-separated; -field means descending | at most 4 fields |
filters | JSON array of { "field", "operator", "value" } | at most 32 conditions |
match | and (default) or or | how the filters combine |
search | text over the table's searchable fields | 200 characters |
list | name of a list layout | default default; its default filter applies |
Operators: eq, neq, contains, startsWith, in (1 to 100 values), isEmpty, isNotEmpty, lt, lte, gt, gte. Each field type supports a subset; a wrong combination answers 400 invalid_query. Filters, sorts and search run on the caller's field projection, so a field you cannot read cannot be filtered or sorted on.
The SPA's encoded query in the URL (?q=state=1^short_descriptionCONTAINSprinter) is a client-side notation. The SPA decodes it against the dictionary and sends filters and match; the API never receives the q string.
Response:
{
"items": [
{
"id": "0192f1a2-7d3e-7000-8000-000000000101",
"table": "incident",
"class": "incident",
"version": 3,
"display": "INC0010001",
"createdAt": "2026-10-11T08:12:04+00:00",
"updatedAt": "2026-10-11T08:40:51+00:00",
"createdBy": { "id": "0192…", "display": "example.agent", "table": "sys_user" },
"updatedBy": { "id": "0192…", "display": "example.agent", "table": "sys_user" },
"values": {
"number": "INC0010001",
"short_description": "Printer on floor 2 does not print",
"state": "2",
"urgency": "2",
"caller_id": { "id": "0192…", "display": "example.caller", "table": "sys_user" }
}
}
],
"total": 1,
"page": 1,
"pageSize": 25
}
table is the table the record was read through, class its actual class: a query on task returns incidents, problems and change requests. Reference values are expanded to { id, display, table }. Pagination is page/offset based and counts the total. Other paginated endpoints (update sets, package changes, remote update sets) use the same envelope with their own page, pageSize, search and sort parameters.
Endpoints: authentication, users and roles
| Method | Path | Purpose | Requires |
|---|---|---|---|
POST | /api/v1/auth/login | Body { email, password, remember? }. Starts a cookie session and returns the Session payload. | none (throttled) |
GET | /api/v1/auth/session | Current Session: user { id, name, initials, email, roles, locale, timeZone }, environment, workspace, issuedAt, platform { dateFormat, dateTimeFormat, timeZone }. | authenticated |
POST | /api/v1/auth/logout | Ends the session; revokes the bearer token when one was used. 204. | authenticated |
POST | /api/v1/auth/tokens | Body { name, abilities?, expires_in_days? }. 201 with { id, name, abilities, expiresAt, token }; the token is shown once. | authenticated |
GET | /api/v1/admin/roles | List of platform roles. | role admin |
There is no dedicated user management endpoint. Users, groups and memberships are records of sys_user, sys_user_group and related tables and are read and written through the Table API under each table's access rules.
Endpoints: metadata
Read endpoints only show tables the caller may read, projected to the fields the caller may see. Admin write endpoints go through MetadataWriter, which validates everything and invalidates the metadata cache. Payloads are described in Metadata engine.
| Method | Path | Purpose | Requires |
|---|---|---|---|
GET | /api/v1/meta/tables | Readable, non-retired tables. | authenticated |
GET | /api/v1/meta/tables/{table} | One table's effective definition, detailed. | table read access |
GET | /api/v1/meta/tables/{table}/fields | The table's visible fields, including column defaults for lists. | table read access |
GET | /api/v1/meta/tables/{table}/forms | Form layouts of the table (nearest ancestor's when it has none). | table read access |
GET | /api/v1/meta/tables/{table}/forms/{form} | One rendered form definition. | table read access |
GET | /api/v1/meta/tables/{table}/lists | List layouts of the table. | table read access |
GET | /api/v1/meta/tables/{table}/lists/{list} | One rendered list definition. | table read access |
POST | /api/v1/admin/meta/tables | Create a table. | role admin |
PATCH | /api/v1/admin/meta/tables/{table} | Change a table. | role admin |
POST | /api/v1/admin/meta/tables/{table}/fields | Add a field. | role admin |
PATCH | /api/v1/admin/meta/tables/{table}/fields/{field} | Change a field declared on this table. | role admin |
PUT | /api/v1/admin/meta/tables/{table}/overrides/{field} | Override an inherited field for this child table (label, mandatory, read-only, default, choices). | role admin |
PUT | /api/v1/admin/meta/tables/{table}/forms/{form} | Save a form layout. | role admin |
PUT | /api/v1/admin/meta/tables/{table}/lists/{list} | Save a list layout. | role admin |
GET | /api/v1/admin/config/versions?objectTable=…&objectId=… | Version history of one configuration object (both parameters required). | role admin |
POST | /api/v1/admin/config/versions/{version}/restore | Restore an object to a recorded version. | role admin |
Endpoints: Table API, XML transfer and system logs
One generic API for the records of every table. Reads go through RecordQuery, writes through RecordWriter; there is no other path. Access is per table (read, write and delete role lists, deny by default; admin bypasses role lists) and per field. Tables with managed_by are read-only for everyone.
| Method | Path | Purpose | Requires |
|---|---|---|---|
GET | /api/v1/table/{table} | Paginated list with filters, sort and search (above). Includes records of child classes. | table read access |
POST | /api/v1/table/{table} | Body { "values": { … } }. Creates a record; 201 with the record. | table write access + table:write |
GET | /api/v1/table/{table}/{id} | One record. | table read access |
PATCH | /api/v1/table/{table}/{id} | Body { "values": { … }, "expectedVersion"?: n }. Changes the given fields; with expectedVersion a concurrent change answers 409 conflict. | table write access + table:write |
DELETE | /api/v1/table/{table}/{id} | Deletes a record; 204. 409 reference_in_use when restricted. | table delete access + table:write |
GET | /api/v1/table/{table}/{id}/export | One record as devcraft-record-xml (attachment). | table read access |
POST | /api/v1/table/{table}/export | Body { ids } or { filters?, match?, search? }. Streamed XML document, at most 5,000 records. | table read access |
POST | /api/v1/table/{table}/import?mode=insert|update|upsert&dryRun=1|0&atomic=1|0 | XML body or multipart file. Plans (default dryRun=1) or applies the document; per-record outcomes. | table write access on every class touched + table:write |
Writes return the record projected to the fields the caller may see. Values are sent as the field types accept them: choice values (not labels), reference ids, ISO dates. Read-only fields and system fields are refused per field in errors; numbering fields such as number are assigned by the platform. Writes to records of configuration tables are captured into the current update set (see X-Change-Set).
System logs have no separate endpoint. Read them as records of the syslog table: GET /api/v1/table/syslog and GET /api/v1/table/syslog/{id}, role admin only. Writes answer 403 because the platform manages the rows. See Operations. Update set items and configuration versions are also read through the Table API (sys_change_set_item, sys_config_version), and remote instance records are written through it (sys_remote_instance).
Endpoints: update sets and packages
All routes below sit in the /api/v1/admin group and require the role admin. Background: Update sets and Promotion.
Local update sets
| Method | Path | Purpose |
|---|---|---|
GET | /admin/config/change-sets/current | The caller's current set, the scope's Default set, and whether the selection is stale. |
PUT | /admin/config/change-sets/current | Body { id: uuid|null }. Selects the current set (must be in progress). |
GET | /admin/config/change-sets | Paginated list; page, pageSize, sort (name, state, sys_updated_at, completed_at), state, owner, search, kind. |
POST | /admin/config/change-sets | Body { name, description? }. Creates a set. |
GET | /admin/config/change-sets/{id} | One set. |
PATCH | /admin/config/change-sets/{id} | Body { name?, description? }. |
POST | /admin/config/change-sets/{id}/complete | Completes a set (not the Default set). |
POST | /admin/config/change-sets/{id}/reopen | Reopens a completed set on the environment it was created on. |
POST | /admin/config/change-sets/{id}/items/move | Body { target, items: [ids] }. Moves captured changes to another set of the same scope. |
Update set packages
| Method | Path | Purpose |
|---|---|---|
GET | /admin/config/change-sets/{id}/export | A completed set as a devcraft-update-set-xml package (attachment, X-Package-Id). 422 package_not_exportable otherwise. |
GET | /admin/config/packages/previews | The caller's previews that have not expired. |
POST | /admin/config/packages/previews | Upload a package (XML body or multipart file) and validate it without applying anything. |
GET | /admin/config/packages/previews/{id} | One preview with its validation outcome. |
POST | /admin/config/packages/previews/{id}/validate | Re-run the validation against this instance now. |
GET | /admin/config/packages/previews/{id}/changes | Paginated changes; status, operation, kind, search, sort. |
GET | /admin/config/packages/previews/{id}/changes/{seq} | One change with payload and comparison. |
GET | /admin/config/packages/previews/{id}/report | The validation report as a downloadable JSON file. |
DELETE | /admin/config/packages/previews/{id} | Discard a preview. |
Previews belong to the user who uploaded them, expire after 24 hours (410 preview_expired) and are limited to 20 per user. An uploaded package is never applied directly; application goes through remote update sets.
Endpoints: remote instances and remote update sets
Provider side (what another instance reads)
These routes serve the DevCraft remote protocol to another instance. They require a bearer token with the remote:read ability, held by a service account with the role admin, and are rate-limited by throttle:api.
| Method | Path | Purpose |
|---|---|---|
GET | /api/v1/remote/identity | Identity and capabilities of this instance. |
GET | /api/v1/remote/update-sets | Completed update sets only; page, pageSize, search, sort (completed_at, name). |
GET | /api/v1/remote/update-sets/{id}/package | One completed set as a package document. |
Remote instances (consumer side)
Role admin. The instance records themselves are Table API writes on sys_remote_instance.
| Method | Path | Purpose |
|---|---|---|
POST | /api/v1/admin/config/remote-instances/validate-url | Body { url }. The outbound URL policy's verdict, without contacting anything. |
GET | /api/v1/admin/config/remote-instances/{id}/status | Stored connection state. |
PUT | /api/v1/admin/config/remote-instances/{id}/credential | Body { token }. Stores the service account token encrypted; it is never returned. |
DELETE | /api/v1/admin/config/remote-instances/{id}/credential | Removes the stored credential. |
POST | /api/v1/admin/config/remote-instances/{id}/test | Server-side connection test. |
GET | /api/v1/admin/config/remote-instances/{id}/update-sets | Discovery of the remote's completed update sets (pageSize up to 100). |
POST | /api/v1/admin/config/remote-instances/{id}/retrieve | Body { ids: [uuid], replace?: bool }. Retrieves sets as validated packages. |
Remote update sets
Role admin. Prefix /api/v1/admin/config/remote-update-sets/{id}. One run at a time per set (409 remote_busy).
| Method | Path suffix | Purpose |
|---|---|---|
GET | (none) | The retrieved set. |
POST | /validate | Validate the stored package. |
POST | /compare | Compare every change with this instance. |
POST | /refresh | Body { replace? }. Retrieve the same set again. |
POST | /review | Body { note? }. Mark as reviewed. |
POST | /reject | Body { reason? }. Reject; package content is pruned after the retention period. |
GET | /changes | Paginated assessment; filters classification, conflict, validation, operation, kind, category, severity, plan, resolution, search, sort. |
GET | /changes/{seq} | One change with the incoming and the local payload. |
POST | /changes/{seq}/resolve | Body { resolution, version, note? }. Decide a conflict: keep_local, accept_remote, merge, skip or unresolved. |
GET | /changes/{seq}/merge | Field-level merge proposal; nothing stored. |
POST | /assess | Recompute readiness and dependency blockers. |
GET | /plan | The application plan. |
GET | /decisions | Append-only decision history. |
GET | /history | Audit trail of lifecycle and retrievals. |
GET | /apply | Eligibility verdict, ordered plan and approval token. |
POST | /apply | Body { approval, note? }. Applies the set in one transaction with verification and rollback. |
GET | /applications | Application runs, newest first. |
GET | /applications/{runId} | One run with per-operation results. |
POST | /preview | Create a package preview of the stored document for the caller. |
GET | /package | The stored package document. |
Endpoints: background scripts, portal and health
| Method | Path | Purpose | Requires |
|---|---|---|---|
GET | /api/v1/admin/scripts/runtime | Runner configuration and reachability, scopes, source limit. | role admin |
POST | /api/v1/admin/scripts/run | Body { source, scope?, allowWrites? } (scope global). Runs a script in the isolated runner; returns the recorded execution. Status unavailable when no runner answers; nothing is executed. | role admin, a person (not a machine account) |
GET | /api/v1/admin/scripts/executions?limit= | Recent executions without their source (limit 1 to 100, default 20). | role admin |
GET | /api/v1/portal/items?kind=all|requests|tasks&pageSize= | The caller's own requests and assigned tasks, scoped on the server. | authenticated person |
GET | /api/v1/portal/items/{table}/{id} | One of the caller's items with the portal field projection; anything else is 404. | authenticated person |
POST | /api/v1/portal/requests | Body { shortDescription, description?, urgency? }. Raises an incident for the caller through RecordWriter. | authenticated person + table:write |
GET | /api/v1/health | Liveness plus database check; 503 when degraded. | none |
GET | /up | Framework liveness probe (outside /api/v1). | none |
The Service Portal's catalogue and knowledge articles are illustrative client data and have no API yet. Machine accounts have no portal (403). Script execution details: Scripting and flows.
Examples
The examples assume the local stack on http://localhost:8000 and an origin listed in SANCTUM_STATEFUL_DOMAINS. Credentials come from your environment; never put them in scripts you commit.
Sign in and create a token
- Get the CSRF cookie. The
Originheader makes Sanctum treat the request as the SPA.API=http://localhost:8000 ORIGIN=http://localhost:5173 curl -s -c jar.txt -b jar.txt -H "Origin: $ORIGIN" -H "Accept: application/json" "$API/sanctum/csrf-cookie" XSRF=$(awk '$6 == "XSRF-TOKEN" {print $7}' jar.txt | python3 -c "import sys, urllib.parse; print(urllib.parse.unquote(sys.stdin.read().strip()))") - Sign in. The password is read from
PLATFORM_ADMIN_PASSWORDin your shell.
The answer is thecurl -s -c jar.txt -b jar.txt -H "Origin: $ORIGIN" -H "X-XSRF-TOKEN: $XSRF" \ -H "Accept: application/json" -H "Content-Type: application/json" \ -d "{\"email\": \"$PLATFORM_ADMIN_EMAIL\", \"password\": \"$PLATFORM_ADMIN_PASSWORD\"}" \ "$API/api/v1/auth/login"Sessionpayload. A wrong e-mail or password answers 422validation_failedwitherrors.email. - Create a token for an integration that only reads.
curl -s -c jar.txt -b jar.txt -H "Origin: $ORIGIN" -H "X-XSRF-TOKEN: $XSRF" \ -H "Accept: application/json" -H "Content-Type: application/json" \ -d '{"name": "reporting-integration", "abilities": ["table:read", "meta:read"], "expires_in_days": 30}' \ "$API/api/v1/auth/tokens"
Store the token in a secret store and use it as{ "id": 7, "name": "reporting-integration", "abilities": ["table:read", "meta:read"], "expiresAt": "2026-11-10T09:00:00+00:00", "token": "<shown once>" }Authorization: Bearer $TOKEN. Because it lackstable:write, every write with it answers 403.
List records with a filter
Open and in-progress incidents whose short description contains "printer", newest first. The SPA would show this as /incident/list?q=stateIN1,2^short_descriptionCONTAINSprinter; the API receives the structured filters:
curl -s -G -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" \
--data-urlencode 'filters=[{"field":"state","operator":"in","value":["1","2"]},{"field":"short_description","operator":"contains","value":"printer"}]' \
--data-urlencode 'match=and' \
--data-urlencode 'sort=sys_created_at:desc' \
-d page=1 -d pageSize=25 \
"$API/api/v1/table/incident"
The answer is the { items, total, page, pageSize } envelope shown in Lists, filters and pagination. An unknown field or an operator the field type does not support answers 400 invalid_query.
Create a record
curl -s -H "Authorization: Bearer $WRITE_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" \
-d '{"values": {"short_description": "Printer on floor 2 does not print", "caller_id": "0192f1a2-7d3e-7000-8000-0000000000aa", "urgency": "2"}}' \
"$API/api/v1/table/incident"
HTTP/1.1 201 Created
Content-Type: application/json
X-Request-Id: 0192f3c4-…
{
"id": "0192f1a2-7d3e-7000-8000-000000000101",
"table": "incident",
"class": "incident",
"version": 1,
"display": "INC0010001",
"values": {
"number": "INC0010001",
"short_description": "Printer on floor 2 does not print",
"caller_id": { "id": "0192f1a2-7d3e-7000-8000-0000000000aa", "display": "example.caller", "table": "sys_user" },
"urgency": "2",
"state": "1"
}
}
The response is shortened. The number comes from the table's numbering, defaults (here state) are applied, and the write is audited. caller_id and short_description are mandatory on incidents.
Update with a validation error
curl -s -i -X PATCH -H "Authorization: Bearer $WRITE_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" \
-d '{"values": {"urgency": "9"}, "expectedVersion": 1}' \
"$API/api/v1/table/incident/0192f1a2-7d3e-7000-8000-000000000101"
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
X-Request-Id: 0192f3c4-…
{
"type": "about:blank",
"title": "Validation failed.",
"status": 422,
"detail": "Urgency must be one of: 1, 2, 3.",
"instance": "/api/v1/table/incident/0192f1a2-7d3e-7000-8000-000000000101",
"code": "validation_failed",
"requestId": "0192f3c4-…",
"errors": { "urgency": ["Urgency must be one of: 1, 2, 3."] }
}
Nothing was written. If someone else had changed the record since version 1, the same request would answer 409 conflict with currentVersion; reload and try again.
Planned API work
Planned The REST API milestone (ROADMAP M6) extends the current API so integrations get the same capabilities and security as the UI. None of the following exists yet:
| Item | Status | Scope |
|---|---|---|
| OpenAPI 3.1 document | Planned | Generated from the controllers and the field type registry, published at /api/docs for authenticated users; contract tests validate every response against it. |
| Aggregates | Planned | POST /api/v1/aggregate/{table}: count, group by, min, max, avg, sum through the same query compiler and access rules. |
| Idempotency keys | Planned | Replaying a POST with the same Idempotency-Key returns the original response and creates no second record. |
| Keyset pagination | Planned | Stable paging under concurrent inserts, as an alternative to page numbers. |
| Query and representation options | Planned | A fields parameter, display=value|both, a POST search endpoint for long filters, If-Match/ETag based on the record version. |
| Token management | Planned | Enforced read scopes, last-used tracking, revocation and a token management page, per-token rate limits. |