API REFERENCE

Update admins

PUT/api/v1/businesses/{id}/admins/{record_id}

This is a managed resource: generic creation or updates are rejected. Use the dedicated workflow. Resource-dependent: orders.read/write; schemas=settings.read/write; drivers=accounts.manage; webhooks=integrations.manage; scenarios=scenarios.read/write; plans=planning.read; others=resources.read/write. PUT/PATCH merge supplied editable fields; system identity/metadata and actual execution timestamps cannot be overwritten. Deleted records are read-only; delete actions use soft deletion and enforce active-work/publication protections. Working-hour updates use the preview/apply workflow. Driver deactivation immediately revokes business-specific access without changing active work.

Managed resource: use its dedicated workflow. Generic writes are not a supported way to create or edit this record.

Authentication

Authorized business administrator session, or a business API key with accounts.manage.

Parameters

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

Request

FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
created_atstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
updated_atstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
revisionintegerCurrent version used to detect stale edits or publication.
deleted_atstring | nullSystem-managed UTC soft-deletion instant; null for active records.Format: date-time
deleted_bystring | nullDeletion actor retained for history.Format: uuid

Example JSON body

{
  "email": "colleague@example.com",
  "display_name": "Taylor"
}
Request schema
{
  "$ref": "#/components/schemas/Record"
}

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 PUT 'https://route-api.okok.space/api/v1/businesses/11111111-1111-4111-8111-111111111111/admins/job-1001' \
  --header 'Authorization: Bearer REPLACE_WITH_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"email":"colleague@example.com","display_name":"Taylor"}'

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
idstringOptional on creation; generated if absent. Unique within authorized business; duplicates409 even if payload matches.Max length: 120
typetask | breakRecord or field type; choose one of the listed values.
locationRequiredobjectService or record location, using latitude/longitude in decimal degrees.
duration_secondsRequiredintegerTime needed to do the work, excluding travel, in seconds.Min: 1
window_startRequiredstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
window_endRequiredstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
statuscreated | on_road | in_progress | completed | unable_to_complete | cancelledLive execution status. Administrator changes become pending_status until publication.
pending_statuscreated | on_road | in_progress | completed | unable_to_complete | cancelled | nullResource-specific value; see the related workflow and schema.
scheduled_atstring | nullPlanned service-start instant; absence indicates unplanned work.
vehicle_idstring | nullAssigned or selected vehicle ID in this business.
driver_idstring | nullAssigned driver ID; stop-specific assignments can change after a handover.
replacement_driver_idstring | nullAdministrator-selected replacement driver for a handover break.
custom_fieldsobjectValues keyed by the business-defined custom field IDs. Existing orders retain their schema version.
schema_snapshotobjectImmutable field definition/type/permission version for this order.Response only
actual_started_atstring | nullResource-specific value; see the related workflow and schema.
actual_completed_atstring | nullResource-specific value; see the related workflow and schema.
location fields
FieldTypeDescription & constraints
location.latitudeRequirednumberLatitude in decimal degrees, from -90 to 90.Min: -90 · Max: 90
location.longitudeRequirednumberLongitude in decimal degrees, from -180 to 180.Min: -180 · Max: 180
FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
nameRequiredstringHuman-readable name shown in the workspace.
warehouse_idRequiredstringWarehouse used as this vehicle’s route origin/return location.
driver_idstring | nullAssigned driver ID; stop-specific assignments can change after a handover.
colorstringResource-specific value; see the related workflow and schema.
height_metersnumber | nullResource-specific value; see the related workflow and schema.
weight_kgnumber | nullResource-specific value; see the related workflow and schema.
working_hoursobjectVehicle availability: weekly weekday intervals plus calendar-date overrides.
working_hours fields
FieldTypeDescription & constraints
working_hours.weeklyRequiredobject0=Monday through6=Sunday
working_hours.overridesRequiredobjectCalendar-date keys replace that entire date, including prior-night carryover. Empty array means unavailable.
working_hours.gap_policyreturn_to_warehouse | waitResource-specific value; see the related workflow and schema.
FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
nameRequiredstringHuman-readable name shown in the workspace.
emailRequiredstringAccount email address.Format: email
activebooleanWhether this account or integration is enabled.
duty_statusonline | offlineResource-specific value; see the related workflow and schema.
locationobject | nullService or record location, using latitude/longitude in decimal degrees.
duty_started_atstring | nullResource-specific value; see the related workflow and schema.
activation_codestringReturned once during provisioning/reset; administrator delivers it to driver.Response only
FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
nameRequiredstringHuman-readable name shown in the workspace.
locationRequiredobjectService or record location, using latitude/longitude in decimal degrees.
location fields
FieldTypeDescription & constraints
location.latitudeRequirednumberLatitude in decimal degrees, from -90 to 90.Min: -90 · Max: 90
location.longitudeRequirednumberLongitude in decimal degrees, from -180 to 180.Min: -180 · Max: 180
FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
nameRequiredstringHuman-readable name shown in the workspace.
fieldsRequiredarray<object>Custom-field definitions captured for new orders.
fields[] fields
FieldTypeDescription & constraints
fields.idRequiredstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
fields.nameRequiredstringHuman-readable name shown in the workspace.
fields.typeRequiredtext | number | date | datetime | boolean | selectRecord or field type; choose one of the listed values.
fields.requiredbooleanWhether a value is mandatory.
fields.driver_visiblebooleanWhether drivers can see the field.
fields.driver_editablebooleanWhether drivers can edit the field; hidden fields cannot be editable.
fields.multiplebooleanAllow multiple dropdown choices when true.
fields.choicesarray<object>Allowed dropdown options with stable IDs and labels.
fields.choices[] fields
FieldTypeDescription & constraints
fields.choices.idRequiredstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
fields.choices.labelRequiredstringResource-specific value; see the related workflow and schema.
FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
nameRequiredstringHuman-readable name shown in the workspace.
urlRequiredstringHTTPS destination for webhook deliveries.Format: uri
eventsRequiredarray<string>Subscribed event names; use * for all supported events.
activebooleanWhether this account or integration is enabled.
secretstringPrivate shared webhook-signing secret.
FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
nameRequiredstringHuman-readable name shown in the workspace.
geometryRequiredobjectGeoJSON Polygon; coordinates are longitude/latitude.
statusnot_installed | queued | running | installing | ready | failed | buildingCurrent execution or operation state. Planned/unplanned is separate from execution.
job_idstring | nullResource-specific value; see the related workflow and schema.
dataset_versionstring | nullResource-specific value; see the related workflow and schema.
errorstring | nullResource-specific value; see the related workflow and schema.
geometry fields
FieldTypeDescription & constraints
geometry.typePolygonRecord or field type; choose one of the listed values.
geometry.coordinatesarray<array<array<number>>>Resource-specific value; see the related workflow and schema.
FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
nameRequiredstringHuman-readable name shown in the workspace.
nodesRequiredarray<object>Graph vertices.
edgesRequiredarray<object>Directed graph connections with travel costs.
ordersarray<object>Resource-specific value; see the related workflow and schema.
warehousesarray<object>Resource-specific value; see the related workflow and schema.
vehiclesarray<object>Resource-specific value; see the related workflow and schema.
driversarray<object>Resource-specific value; see the related workflow and schema.
nodes[] fields
FieldTypeDescription & constraints
nodes.idRequiredstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
nodes.xRequirednumberResource-specific value; see the related workflow and schema.
nodes.yRequirednumberResource-specific value; see the related workflow and schema.
edges[] fields
FieldTypeDescription & constraints
edges.idRequiredstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
edges.fromRequiredstringResource-specific value; see the related workflow and schema.
edges.toRequiredstringResource-specific value; see the related workflow and schema.
edges.time_secondsRequirednumberResource-specific value; see the related workflow and schema.
edges.distance_metersRequirednumberResource-specific value; see the related workflow and schema.
edges.bidirectionalbooleanResource-specific value; see the related workflow and schema.
edges.reverse_time_secondsnumberResource-specific value; see the related workflow and schema.
edges.reverse_distance_metersnumberResource-specific value; see the related workflow and schema.
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.
FieldTypeDescription & constraints
idstringIdentifier unique within its authorized business. Some create operations generate it when omitted.
created_atstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
updated_atstringRFC3339 UTC instant or explicit offset; business wall times are resolved separately.Format: date-time
revisionintegerCurrent version used to detect stale edits or publication.
deleted_atstring | nullSystem-managed UTC soft-deletion instant; null for active records.Format: date-time
deleted_bystring | nullDeletion actor retained for history.Format: uuid
Illustrative response
{
  "email": "colleague@example.com",
  "display_name": "Taylor"
}
Response schema
{
  "$ref": "#/components/schemas/ResourceRecord"
}

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 →