How to authenticate against the Clarus API — OAuth 2.0 bearer tokens with the tenant subdomain header, or the legacy sign-in with your subdomain API URL — and the headers to send on every request.
The Clarus API is authenticated, and every request must identify both the user and your environment. There are two ways to do this:
OAuth 2.0: an OAuth bearer token, sent with the X-Clarus-Subdomain header to https://clarus-api.com.
Legacy sign-in: a token from signing in with an email address and password, sent to your subdomain’s own API URL. Integrations that are not yet on OAuth use this method.
The endpoints, payloads and responses are the same for both. Only the base URL and the headers differ.
Authenticating requests
OAuth 2.0
Legacy sign-in
OAuth 2.0
The API uses OAuth 2.0 bearer tokens. Obtain an access token and send it on every request as an Authorization: Bearer <token> header.
URL
Authorize
https://clarus-api.com/oauth/authorize
Token
https://clarus-api.com/oauth/token
Request the scopes your integration requires.
The subdomain header
ClarusWMS is multi-tenant. Every request must include the X-Clarus-Subdomain header identifying which tenant’s data you are operating on — it is sent in addition to the bearer token, not instead of it.
Request headers
Send these headers on every request, whether you are calling REST or GraphQL:
Header
Value
Authorization
Bearer <access-token>
X-Clarus-Subdomain
your tenant subdomain
Content-Type
application/json
Using the playground
When you try calls from the Operations playground, the Authorize panel exposes both requirements:
BearerAuth — paste an access token (or complete the OAuth flow if configured).
ClarusSubdomain — enter your tenant subdomain; it is sent as the X-Clarus-Subdomain header on every request.
Both are required, so requests sent from the playground carry the token and the subdomain header together.
Your API URL
Each Clarus environment has its own API URL, built from your subdomain:
https://{subdomain}.api.clarus.ws
For example, if your subdomain is acme, your API URL is https://acme.api.clarus.ws. If you’re not sure of your subdomain, ask Clarus support.
Path
Use it for
/users/sign_in
Signing in to get a token
/api/...
REST endpoints, e.g. https://acme.api.clarus.ws/api/products
/graphql
GraphQL queries
If you have a sandbox environment, it has its own subdomain. Swap that subdomain into the URL to point your integration at the sandbox.
When you’re working from the Operations reference, replace https://clarus-api.com with your API URL. You don’t need the X-Clarus-Subdomain header, because the URL already identifies your environment.
Sign in and authenticate requests
1
Sign in
Send the API user’s email address and password to /users/sign_in:
The Bearer prefix is also accepted, as long as the email is included: Authorization: Bearer token="…", email="…".
3
Reuse the token
Store the token and reuse it for every call. Sign in again only when a request returns 401 Unauthorized.
Each sign-in replaces the token
A user has only one legacy token at a time. Every sign-in issues a new token and invalidates the previous one, and a sign-in to the WMS front-end with the same account can do the same. Signing out through /users/sign_out also invalidates the token.This means:
Use a dedicated API user. If someone signs in to the front-end with the integration’s account, the integration’s token stops working. See Use a dedicated user account below.
Don’t sign in on every request. Signing in on every call cuts off any other process that is using the same account. Reuse the stored token, and sign in again only after a 401.
Give each system its own user. Two integrations sharing one account keep invalidating each other’s tokens.
The Operations playground uses OAuth 2.0, so you can’t try legacy sign-in calls there. Use curl, Postman or your own client instead.
Use a dedicated user account
Create a separate user account specifically for API access, distinct from any account used to log into the WMS front-end.
Signing into the front-end with the same account the integration uses can end the existing session — and running integration calls while someone is logged in on that account can knock them out of the system. Keeping them separate avoids being logged out mid-task.
The same logic applies if you have multiple developers or systems hitting the API: ideally each environment (development, test, production) gets its own account, so auditing, throttling, and troubleshooting can be done independently.
Treat credentials as secrets
Store API credentials — passwords, client secrets and tokens — in a secrets manager, environment variables, or your platform’s equivalent. Don’t commit them to source control or paste them into shared documents.
Assistant
Responses are generated using AI and may contain mistakes.