API REFERENCE

Sign in verified administrator

POST/api/v1/auth/login

Returns bearer token and only active authorized businesses. Session lifetime is 7 days. This implemented foundation endpoint is administrator-only; driver authentication is not implemented. Limit 20 per connection IP per minute.

Authentication

No bearer token required. This does not remove validation or rate limits.

Parameters

No path or query parameters.

Request

FieldTypeDescription & constraints
emailRequiredstringAccount email address.Format: email
passwordRequiredstringPrivate chosen password; never expose it in client bundles or logs.Write only

Example JSON body

{
  "email": "dispatcher@example.com",
  "password": "Example-passphrase-42!"
}
Request schema
{
  "$ref": "#/components/schemas/LoginRequest"
}

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/auth/login' \
  --header 'Content-Type: application/json' \
  --data '{"email":"dispatcher@example.com","password":"Example-passphrase-42!"}' \
  --output response.bin

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
tokenRequiredstringOpaque bearer session token. Keep private.
userRequiredobjectResource-specific value; see the related workflow and schema.
businessesRequiredarray<object>Resource-specific value; see the related workflow and schema.
user fields
FieldTypeDescription & constraints
user.idRequiredstringIdentifier unique within its authorized business. Some create operations generate it when omitted.Format: uuid
user.emailRequiredstringAccount email address.Format: email
user.display_nameRequiredstringResource-specific value; see the related workflow and schema.
businesses[] fields
FieldTypeDescription & constraints
businesses.idRequiredstringIdentifier unique within its authorized business. Some create operations generate it when omitted.Format: uuid
businesses.nameRequiredstringHuman-readable name shown in the workspace.
businesses.time_zoneRequiredstringNamed IANA time zone, validated by the backend.
businesses.deleted_atstring | nullSystem-managed UTC soft-deletion instant; null for active records.Format: date-time
businesses.deleted_bystring | nullDeletion actor retained for history.Format: uuid
Illustrative response
{
  "token": "REPLACE_WITH_TOKEN",
  "user": {
    "id": "11111111-1111-4111-8111-111111111111",
    "email": "dispatcher@example.com",
    "display_name": "Alex"
  },
  "businesses": [
    {
      "id": "11111111-1111-4111-8111-111111111111",
      "name": "Example Services",
      "time_zone": "Europe/Warsaw",
      "deleted_at": "2026-11-02T09:00:00Z",
      "deleted_by": "11111111-1111-4111-8111-111111111111"
    }
  ]
}
Response schema
{
  "$ref": "#/components/schemas/LoginResponse"
}

400 · Axum extraction rejects invalid JSON/type, oversized body, or malformed UUID before the domain handler. These responses may be text/plain rather than the domain Error object.

text/plain

Binary response. Save the returned bytes to a file; do not parse as JSON.

401 · Invalid credentials, missing bearer token, or expired/unverified session.

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": "Invalid credentials, missing bearer token, or expired/unverified session."
  }
}
Response schema
{
  "$ref": "#/components/schemas/Error"
}

413 · Axum extraction rejects invalid JSON/type, oversized body, or malformed UUID before the domain handler. These responses may be text/plain rather than the domain Error object.

text/plain

Binary response. Save the returned bytes to a file; do not parse as JSON.

415 · Axum extraction rejects invalid JSON/type, oversized body, or malformed UUID before the domain handler. These responses may be text/plain rather than the domain Error object.

text/plain

Binary response. Save the returned bytes to a file; do not parse as JSON.

429 · Connection-address request limit reached. Retry after the stated interval.

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": "rate_limited",
    "message": "Connection-address request limit reached. Retry after the stated interval."
  }
}
Response schema
{
  "$ref": "#/components/schemas/Error"
}

503 · Required persistence or credential operation 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 or credential operation unavailable."
  }
}
Response schema
{
  "$ref": "#/components/schemas/Error"
}
← All endpointsIntegration workflows →