API REFERENCE

Move/reorder/change draft stop

PATCH/api/v1/businesses/{id}/plans/{plan}/stops/{order}

Same manual adjustment/publication warning contract. Does not edit actual timestamps. Integration permission: planning.edit. Administrator membership grants management access only to this business.

Authentication

Authorized business administrator session, or a business API key with planning.edit.

Parameters

ParameterInTypeDescription
idRequiredpathstringAuthorized business context. Never inferred from client record IDs.Format: uuid
planRequiredpathstring
orderRequiredpathstring

Request

FieldTypeDescription & constraints
order_idstringResource-specific value; see the related workflow and schema.
scheduled_atstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
vehicle_idstringAssigned or selected vehicle ID in this business.
driver_idstring | nullAssigned driver ID; stop-specific assignments can change after a handover.
positionintegerResource-specific value; see the related workflow and schema.
statuscreated | on_road | in_progress | completed | unable_to_complete | cancelledCurrent execution or operation state. Planned/unplanned is separate from execution.

Example JSON body

{
  "order_id": "job-1001",
  "scheduled_at": "2026-11-02T09:30:00Z",
  "vehicle_id": "van-01",
  "driver_id": "driver-01",
  "position": 0,
  "status": "created"
}
Request schema
{
  "type": "object",
  "properties": {
    "order_id": {
      "type": "string"
    },
    "scheduled_at": {
      "type": "string",
      "format": "date-time",
      "description": "RFC3339 UTC instant or explicit offset; business wall times are resolved separately."
    },
    "vehicle_id": {
      "type": "string"
    },
    "driver_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "position": {
      "type": "integer"
    },
    "status": {
      "enum": [
        "created",
        "on_road",
        "in_progress",
        "completed",
        "unable_to_complete",
        "cancelled"
      ]
    }
  }
}

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 PATCH 'https://route-api.okok.space/api/v1/businesses/11111111-1111-4111-8111-111111111111/plans/plan-01/stops/job-1001' \
  --header 'Authorization: Bearer REPLACE_WITH_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"order_id":"job-1001","scheduled_at":"2026-11-02T09:30:00Z","vehicle_id":"van-01","driver_id":"driver-01","position":0,"status":"created"}'

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

FieldTypeDescription & constraints
idRequiredstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
vehicle_idRequiredstringAssigned or selected vehicle ID in this business.
driver_idstring | nullAssigned driver ID; stop-specific assignments can change after a handover.
revisionRequiredintegerCurrent version used to detect stale edits or publication.
stateRequiredplanning | published | supersededPlanning/published version state or event visibility state.
start_atstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
end_atstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
stopsRequiredarray<object>Ordered planned route stops.
return_legobjectResource-specific value; see the related workflow and schema.
warningsarray<string>Constraint warnings requiring review where applicable.
unplanned_order_idsarray<string>Resource-specific value; see the related workflow and schema.
publishedobject | nullResource-specific value; see the related workflow and schema.
received_atstring | nullResource-specific value; see the related workflow and schema.
Illustrative response
{
  "id": "example-id",
  "vehicle_id": "van-01",
  "driver_id": "driver-01",
  "revision": 1,
  "state": "planning",
  "start_at": "2026-11-02T08:00:00Z",
  "end_at": "2026-11-02T16:00:00Z",
  "stops": [
    {}
  ],
  "return_leg": {},
  "warnings": [
    "example"
  ],
  "unplanned_order_ids": [
    "example"
  ],
  "published": {},
  "received_at": "2026-11-02T09:00:00Z"
}
Response schema
{
  "$ref": "#/components/schemas/Plan"
}

401 · Missing/invalid/revoked token

application/json

FieldTypeDescription & constraints
errorRequiredobjectResource-specific value; see the related workflow and schema.
error fields
FieldTypeDescription & constraints
error.codeRequiredvalidation | unauthorized | not_found | conflict | unavailable | rate_limitedPrivate activation or recovery code supplied to the driver.
error.messageRequiredstringResource-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

FieldTypeDescription & constraints
errorRequiredobjectResource-specific value; see the related workflow and schema.
error fields
FieldTypeDescription & constraints
error.codeRequiredvalidation | unauthorized | not_found | conflict | unavailable | rate_limitedPrivate activation or recovery code supplied to the driver.
error.messageRequiredstringResource-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

FieldTypeDescription & constraints
errorRequiredobjectResource-specific value; see the related workflow and schema.
error fields
FieldTypeDescription & constraints
error.codeRequiredvalidation | unauthorized | not_found | conflict | unavailable | rate_limitedPrivate activation or recovery code supplied to the driver.
error.messageRequiredstringResource-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

FieldTypeDescription & constraints
errorRequiredobjectResource-specific value; see the related workflow and schema.
error fields
FieldTypeDescription & constraints
error.codeRequiredvalidation | unauthorized | not_found | conflict | unavailable | rate_limitedPrivate activation or recovery code supplied to the driver.
error.messageRequiredstringResource-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

FieldTypeDescription & constraints
errorRequiredobjectResource-specific value; see the related workflow and schema.
error fields
FieldTypeDescription & constraints
error.codeRequiredvalidation | unauthorized | not_found | conflict | unavailable | rate_limitedPrivate activation or recovery code supplied to the driver.
error.messageRequiredstringResource-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

FieldTypeDescription & constraints
errorRequiredobjectResource-specific value; see the related workflow and schema.
error fields
FieldTypeDescription & constraints
error.codeRequiredvalidation | unauthorized | not_found | conflict | unavailable | rate_limitedPrivate activation or recovery code supplied to the driver.
error.messageRequiredstringResource-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"
}
← All endpointsIntegration workflows →