Authorization header.
Your first authenticated request
Every API request needs this header:Bearer and the key. A complete curl example looks like this:
hsg_live_key_. Test keys start with hsg_test_key_. The complete value is a secret, just like a password.
Where the key should live
Save the key in a server-side secret manager or environment variable. Your request flow should look like this:Environments
The key and URL must belong to the same environment. There is no environment field in the request body.
- Test key + sandbox URL: correct.
- Live key + live URL: correct.
- Test key + live URL:
401 ENVIRONMENT_MISMATCH. - Live key + sandbox URL:
401 ENVIRONMENT_MISMATCH.
Scopes
A scope is one permission attached to an API key. For example, a read-only dashboard may needdeliveries:read but not deliveries:write.
If the key is valid but lacks the needed scope, the API returns
403 INSUFFICIENT_SCOPE. Create or rotate a key with the correct scope in the developer portal; scopes cannot be added by sending them in an API request.
Key lifecycle
Creating a key
The developer portal shows a new key once. Copy it immediately into your secret manager. HaulStow cannot show the complete key again.Rotating a key
Rotation creates a new key but leaves the old one working. This lets you update your server without downtime:- Create the replacement key.
- Save it in your secret manager.
- Deploy your server with the replacement.
- Confirm requests are working.
- Revoke the old key.
Revoked or expired keys
- A revoked key returns
401 API_KEY_REVOKED. - An expired key returns
401 API_KEY_EXPIRED. - A disabled developer application makes all its keys invalid.
If authentication fails
Check these in order:- The header begins with
Authorization: Bearer. - You copied the complete key without extra spaces or quotation marks.
- The test/live key matches the sandbox/live URL.
- The key has the scope shown on the endpoint’s reference page.
- The key is not expired or revoked and the application is active.
