API REFERENCE
Publish reviewed planning/status changes
/api/v1/businesses/{id}/plans/publishAtomic protected-plan validation: stale changes to live in-progress work block the affected publication; explicit administrator lifecycle override is allowed subject to invariants. Warned manual plans require acknowledgement. order_ids permits publishing pending statuses for unplanned orders with no route. Confirmed cancellation releases capacity at publication; unscheduling already released it earlier. Integration permission: planning.publish. Administrator membership grants management access only to this business.
Authentication
Authorized business administrator session, or a business API key with planning.publish.
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
idRequired | path | string | Authorized business context. Never inferred from client record IDs.Format: uuid |
Request
| Field | Type | Description & constraints |
|---|---|---|
plan_ids | array<string> | Plans to publish or act on within this business. |
order_ids | array<string> | Order IDs included in the action. |
expected_revision | array<object> | Expected plan ID/revision pairs from the reviewed planning snapshot. |
acknowledge_warnings | boolean | Confirm only after an operator reviews the indicated constraint warnings. |
expected_revision[] fields
| Field | Type | Description & constraints |
|---|---|---|
expected_revision.idRequired | string | Identifier unique within its authorized business. Some create operations generate it when omitted. |
expected_revision.revisionRequired | integer | Current version used to detect stale edits or publication. |
Example JSON body
{
"plan_ids": [
"plan-01"
],
"expected_revision": [
{
"id": "plan-01",
"revision": 1
}
],
"acknowledge_warnings": false
}Request schema
{
"type": "object",
"properties": {
"plan_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"order_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"expected_revision": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"revision": {
"type": "integer"
}
},
"required": [
"id",
"revision"
]
}
},
"acknowledge_warnings": {
"type": "boolean"
}
}
}Example request
Replace synthetic identifiers and credentials. Example dates, coordinates, revisions, and IDs are not production defaults. Read the workflow guide before making a write.
curl --request POST 'https://route-api.okok.space/api/v1/businesses/11111111-1111-4111-8111-111111111111/plans/publish' \
--header 'Authorization: Bearer REPLACE_WITH_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"plan_ids":["plan-01"],"expected_revision":[{"id":"plan-01","revision":1}],"acknowledge_warnings":false}'Responses
Examples illustrate the documented shape; optional fields and current state can differ. JSON extraction/body-limit errors may be plain text.
200 · Successful response
application/json
| Field | Type | Description & constraints |
|---|---|---|
id | string | Identifier unique within its authorized business. Some create operations generate it when omitted. |
created_at | string | RFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time |
updated_at | string | RFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time |
revision | integer | Current version used to detect stale edits or publication. |
deleted_at | string | null | System-managed UTC soft-deletion instant; null for active records.Format: date-time |
deleted_by | string | null | Deletion actor retained for history.Format: uuid |
Illustrative response
{
"id": "example-id",
"created_at": "2026-11-02T09:00:00Z",
"updated_at": "2026-11-02T09:00:00Z",
"revision": 1,
"deleted_at": "2026-11-02T09:00:00Z",
"deleted_by": "11111111-1111-4111-8111-111111111111"
}Response schema
{
"$ref": "#/components/schemas/Record"
}401 · Missing/invalid/revoked token
application/json
| Field | Type | Description & constraints |
|---|---|---|
errorRequired | object | Resource-specific value; see the related workflow and schema. |
error fields
| Field | Type | Description & constraints |
|---|---|---|
error.codeRequired | validation | unauthorized | not_found | conflict | unavailable | rate_limited | Private activation or recovery code supplied to the driver. |
error.messageRequired | string | Resource-specific value; see the related workflow and schema. |
Illustrative response
{
"error": {
"code": "unauthorized",
"message": "Missing/invalid/revoked token"
}
}Response schema
{
"$ref": "#/components/schemas/Error"
}403 · Business membership or required API-key scope denied
application/json
| Field | Type | Description & constraints |
|---|---|---|
errorRequired | object | Resource-specific value; see the related workflow and schema. |
error fields
| Field | Type | Description & constraints |
|---|---|---|
error.codeRequired | validation | unauthorized | not_found | conflict | unavailable | rate_limited | Private activation or recovery code supplied to the driver. |
error.messageRequired | string | Resource-specific value; see the related workflow and schema. |
Illustrative response
{
"error": {
"code": "unauthorized",
"message": "Business membership or required API-key scope denied"
}
}Response schema
{
"$ref": "#/components/schemas/Error"
}404 · Record not found in authorized business
application/json
| Field | Type | Description & constraints |
|---|---|---|
errorRequired | object | Resource-specific value; see the related workflow and schema. |
error fields
| Field | Type | Description & constraints |
|---|---|---|
error.codeRequired | validation | unauthorized | not_found | conflict | unavailable | rate_limited | Private activation or recovery code supplied to the driver. |
error.messageRequired | string | Resource-specific value; see the related workflow and schema. |
Illustrative response
{
"error": {
"code": "not_found",
"message": "Record not found in authorized business"
}
}Response schema
{
"$ref": "#/components/schemas/Error"
}409 · Duplicate identifier, stale revision, expired reservation, protected publication or unavailable capacity
application/json
| Field | Type | Description & constraints |
|---|---|---|
errorRequired | object | Resource-specific value; see the related workflow and schema. |
error fields
| Field | Type | Description & constraints |
|---|---|---|
error.codeRequired | validation | unauthorized | not_found | conflict | unavailable | rate_limited | Private activation or recovery code supplied to the driver. |
error.messageRequired | string | Resource-specific value; see the related workflow and schema. |
Illustrative response
{
"error": {
"code": "conflict",
"message": "Duplicate identifier, stale revision, expired reservation, protected publication or unavailable capacity"
}
}Response schema
{
"$ref": "#/components/schemas/Error"
}422 · Domain validation rejected the operation
application/json
| Field | Type | Description & constraints |
|---|---|---|
errorRequired | object | Resource-specific value; see the related workflow and schema. |
error fields
| Field | Type | Description & constraints |
|---|---|---|
error.codeRequired | validation | unauthorized | not_found | conflict | unavailable | rate_limited | Private activation or recovery code supplied to the driver. |
error.messageRequired | string | Resource-specific value; see the related workflow and schema. |
Illustrative response
{
"error": {
"code": "validation",
"message": "Domain validation rejected the operation"
}
}Response schema
{
"$ref": "#/components/schemas/Error"
}503 · Required persistence, map/routing or other infrastructure unavailable
application/json
| Field | Type | Description & constraints |
|---|---|---|
errorRequired | object | Resource-specific value; see the related workflow and schema. |
error fields
| Field | Type | Description & constraints |
|---|---|---|
error.codeRequired | validation | unauthorized | not_found | conflict | unavailable | rate_limited | Private activation or recovery code supplied to the driver. |
error.messageRequired | string | Resource-specific value; see the related workflow and schema. |
Illustrative response
{
"error": {
"code": "unavailable",
"message": "Required persistence, map/routing or other infrastructure unavailable"
}
}Response schema
{
"$ref": "#/components/schemas/Error"
}