Unified Order Service
Home
Getting Started
  • Core API
  • Drone API
Resources
Home
Getting Started
  • Core API
  • Drone API
Resources
  • Introduction

    • Getting Started
    • System Overview
    • Authentication
  • Core Concepts

    • Working with Orders
    • Working with Channels
    • Places
    • Storage Locations
    • Places Management Dashboard
  • Integration

    • Webhooks
    • Order Status Workflows
    • FCM Push Notifications
  • Advanced Topics

    • API Keys
    • Order Versioning
    • Picking App Integration Guide
    • Subscriptions
    • Cancellation Reasons

API Keys

This guide explains how to manage API keys in the Unified Order Service (UOS).

Authentication Methods

UOS supports two authentication methods:

  1. API Keys (covered in this guide) - For service-to-service integrations
  2. MSAL Authentication - For user-facing applications with Azure AD integration

For information about MSAL authentication, see the Authentication Guide.

What are API Keys?

API keys are used to authenticate requests to the UOS API for service-to-service integrations and automated systems. Each API key has a scope that determines what operations it can perform and which channels it can access.

API Key Scopes

UOS supports three API key scopes:

ScopeDescription
readCan only perform GET operations
writeCan perform GET, POST, PUT, PATCH operations
adminHas full access to all operations

Channel-Based Access Control

API keys can be restricted to specific channels through the channel_ids property. This allows you to create keys with granular access control:

  • Keys with specific channel IDs can only access those channels
  • Keys with an empty channel_ids array have no channel access
  • Admin-scoped keys can access all channels regardless of channel_ids

Creating an API Key

Naveo Support Required

API key creation requires system-level authentication and must be performed by the Naveo support team. Contact Naveo Support at gsd@maginus.atlassian.net to request new API keys.

To create a new API key, send a POST request to the /v1/api-keys endpoint. (Requires system-level authentication)

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"],
    "created_by": "admin@example.com"
  }'

The response will include the new API key:

{
  "id": "key-uuid",
  "key": "som_xxxxxxxxxxxxx",
  "name": "Store Operations Manager",
  "client_name": "SOM",
  "scope": "write",
  "channel_ids": ["channel-123", "channel-456"],
  "created_at": "2024-03-27T12:00:00Z",
  "is_active": true
}

Listing API Keys

To retrieve a list of all API keys, send a GET request to the /v1/api-keys endpoint. (Requires system-level authentication)

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

Getting API Key Details

To retrieve details about a specific API key, send a GET request to the /v1/api-keys/{keyId} endpoint. (Requires system-level authentication)

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

Updating an API Key

To update an existing API key, send a PUT request to the /v1/api-keys/{keyId} endpoint. (Requires system-level authentication)

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": "Updated Key Name",
    "description": "Updated description",
    "scope": "read",
    "channel_ids": ["channel-123"],
    "expires_at": "2025-12-31T23:59:59Z"
  }'

Deactivating an API Key

To deactivate an API key, send a DELETE request to the /v1/api-keys/{keyId} endpoint. (Requires system-level authentication)

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

This doesn't actually delete the key but sets its is_active property to false, preventing it from being used for authentication.

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

Best Practices

Security

  • Use the principle of least privilege - assign the minimum scope necessary
  • Regularly rotate API keys to minimize security risks
  • Set expiration dates for temporary access
  • Deactivate unused keys
  • Never share API keys between different applications or users

Organization

  • Use descriptive names for easy identification
  • Include the purpose or application in the description
  • Use client_name as a prefix for better key organization
  • Document who requested each key and for what purpose

Monitoring

  • Review the last_used_at property to identify inactive keys
  • Monitor API key usage through server logs
  • Set up alerts for unusual API key usage patterns
  • Conduct regular audits of active API keys
Last Updated: 12/1/25, 11:31 AM
Next
Order Versioning