Unified Order Service
Home
Getting Started
  • Core API
  • Drone API
Resources
Home
Getting Started
  • Core API
  • Drone API
Resources
    • Core API Reference
    • Orders API Reference
    • Order Items API
    • Channels API Reference
    • Places API Reference
    • Storage Locations API Reference
    • Webhooks API Reference
      • Order Failed Webhook - Operation Type Specification
    • API Keys Reference

API Keys Reference

This page documents the API Keys endpoints in the Core API.

List API Keys

Returns a list of all API keys.

URL: /v1/api-keys

Method: GET

Auth required: Yes (system authentication)

Example Request:

curl -X GET "https://api.uos.example.com/v1/api-keys" \
  -H "Authorization: Bearer SYSTEM_API_TOKEN"

Success Response:

  • Code: 200 OK
  • Content:
{
  "data": [
    {
      "id": "key-123",
      "key": "som_xxxxx",
      "name": "Store Operations Manager",
      "client_name": "SOM",
      "description": "API key for SOM integration",
      "scope": "write",
      "channel_ids": ["channel-123", "channel-456"],
      "created_at": "2023-06-01T10:00:00Z",
      "expires_at": "2024-06-01T10:00:00Z",
      "last_used_at": "2023-06-01T12:00:00Z",
      "created_by": "admin@example.com",
      "is_active": true
    },
    {
      "id": "key-456",
      "key": "pos_xxxxx",
      "name": "Point of Sale Integration",
      "client_name": "POS",
      "description": "API key for POS integration",
      "scope": "read",
      "channel_ids": ["channel-123"],
      "created_at": "2023-06-01T11:00:00Z",
      "expires_at": null,
      "last_used_at": "2023-06-01T14:00:00Z",
      "created_by": "admin@example.com",
      "is_active": true
    }
  ],
  "count": 2
}

Get API Key Details

Returns details about a specific API key.

URL: /v1/api-keys/{keyId}

Method: GET

Auth required: Yes (system authentication)

Example Request:

curl -X GET "https://api.uos.example.com/v1/api-keys/key-123" \
  -H "Authorization: Bearer SYSTEM_API_TOKEN"

Success Response:

  • Code: 200 OK
  • Content:
{
  "id": "key-123",
  "key": "som_xxxxx",
  "name": "Store Operations Manager",
  "client_name": "SOM",
  "description": "API key for SOM integration",
  "scope": "write",
  "channel_ids": ["channel-123", "channel-456"],
  "created_at": "2023-06-01T10:00:00Z",
  "expires_at": "2024-06-01T10:00:00Z",
  "last_used_at": "2023-06-01T12:00:00Z",
  "created_by": "admin@example.com",
  "is_active": true,
  "metadata": {
    "usage_notes": "For store operations management integration"
  }
}

Error Responses:

  • Code: 404 Not Found
    • Content: { "error": "API key not found" }

Create API Key

Creates a new API key.

URL: /v1/api-keys

Method: POST

Auth required: Yes (system authentication)

Request Body:

FieldTypeRequiredDescription
namestringYesHuman-readable name for the API key
client_namestringYesName of the client/organization
descriptionstringNoOptional description of the API key usage
scopestringNoAccess scope: "read", "write", or "admin" (default: "read")
channel_idsarrayNoChannel IDs this key has access to
expires_atstringNoOptional expiration date (ISO 8601 format)
created_bystringYesWho is creating this API key
metadataobjectNoAdditional metadata

Example Request:

curl -X POST "https://api.uos.example.com/v1/api-keys" \
  -H "Authorization: Bearer SYSTEM_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Store Operations Manager",
    "client_name": "SOM",
    "description": "API key for SOM integration",
    "scope": "write",
    "channel_ids": ["channel-123", "channel-456"],
    "expires_at": "2024-06-01T10:00:00Z",
    "created_by": "admin@example.com",
    "metadata": {
      "usage_notes": "For store operations management integration"
    }
  }'

Success Response:

  • Code: 201 Created
  • Content:
{
  "id": "key-123",
  "key": "som_a1b2c3d4e5f6g7h8i9j0",
  "name": "Store Operations Manager",
  "client_name": "SOM",
  "description": "API key for SOM integration",
  "scope": "write",
  "channel_ids": ["channel-123", "channel-456"],
  "created_at": "2023-06-01T10:00:00Z",
  "expires_at": "2024-06-01T10:00:00Z",
  "created_by": "admin@example.com",
  "is_active": true,
  "metadata": {
    "usage_notes": "For store operations management integration"
  }
}

Error Responses:

  • Code: 400 Bad Request
    • Content: { "error": "Missing required fields or invalid scope" }

Update API Key

Updates an existing API key configuration.

URL: /v1/api-keys/{keyId}

Method: PUT

Auth required: Yes (system authentication)

Request Body:

FieldTypeRequiredDescription
namestringNoHuman-readable name for the API key
descriptionstringNoOptional description of the API key usage
scopestringNoAccess scope: "read", "write", or "admin"
channel_idsarrayNoChannel IDs this key has access to
expires_atstringNoOptional expiration date (ISO 8601 format)
is_activebooleanNoWhether the API key is active
metadataobjectNoAdditional metadata

Example Request:

curl -X PUT "https://api.uos.example.com/v1/api-keys/key-123" \
  -H "Authorization: Bearer SYSTEM_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SOM Integration Key",
    "description": "Updated API key for SOM integration",
    "scope": "write",
    "channel_ids": ["channel-123", "channel-456", "channel-789"],
    "expires_at": "2025-06-01T10:00:00Z",
    "is_active": true
  }'

Success Response:

  • Code: 200 OK
  • Content:
{
  "id": "key-123",
  "key": "som_xxxxx",
  "name": "SOM Integration Key",
  "client_name": "SOM",
  "description": "Updated API key for SOM integration",
  "scope": "write",
  "channel_ids": ["channel-123", "channel-456", "channel-789"],
  "created_at": "2023-06-01T10:00:00Z",
  "expires_at": "2025-06-01T10:00:00Z",
  "last_used_at": "2023-06-01T12:00:00Z",
  "created_by": "admin@example.com",
  "is_active": true,
  "updated_at": "2023-06-01T15:00:00Z"
}

Error Responses:

  • Code: 404 Not Found
    • Content: { "error": "API key not found" }

Deactivate API Key

Deactivates an API key (soft delete).

URL: /v1/api-keys/{keyId}

Method: DELETE

Auth required: Yes (system authentication)

Example Request:

curl -X DELETE "https://api.uos.example.com/v1/api-keys/key-123" \
  -H "Authorization: Bearer SYSTEM_API_TOKEN"

Success Response:

  • Code: 204 No Content

Error Responses:

  • Code: 404 Not Found
    • Content: { "error": "API key not found" }

API Key Properties

PropertyTypeDescription
idstringUnique identifier for the API key
keystringThe actual API key value (prefixed with client name)
namestringHuman-readable name for the API key
client_namestringName of the client/organization using this API key
descriptionstringOptional description of the API key usage
scopestringAccess scope: read, write, or admin
channel_idsarrayArray of channel IDs this API key has access to
created_atstringWhen the API key was created
expires_atstringOptional expiration date for the API key
last_used_atstringWhen the API key was last used
created_bystringWho created this API key
is_activebooleanWhether the API key is currently active
metadataobjectAdditional metadata about the API key

Access Scopes

ScopeDescriptionPermissions
readRead-only accessCan only perform GET operations
writeRead and write accessCan perform GET, POST, PUT, PATCH operations
adminFull accessCan perform all operations, including API key management

Empty channel_ids array means no channel access. Admin scope can access all channels regardless of channel_ids.

Last Updated: 12/1/25, 11:31 AM