POST /v1/auth/token and for any other API operation that supports partner-key authentication.
Required headers
Partner-authenticated requests use these headers:
For
SINGLE_USER integrations, omit X-Meridian-User-Id. Meridian uses the single configured user for that partner key.
When to send X-Meridian-User-Id
Your integration model determines whether X-Meridian-User-Id is required:
MULTI_USER: required on partner-key callsSINGLE_USER: must be omitted on partner-key calls
Constructing the signature
Meridian authenticates partner-key requests with an HMAC SHA-256 signature.X-Meridian-Program-Id is required on the request, but it is not part of the canonical string used for signing.
Canonical string
Build the canonical string by concatenating these values in this exact order:API KeyTimestampHTTP methodRequest pathRequest body
POST /v1/auth/token:
- the method is
POST - the path is
/v1/auth/token - the body is the exact JSON string sent on the wire
How to compute the signature
- Read your Meridian API Key and API Secret for the environment you are calling.
- Generate a timestamp in milliseconds and send it as
X-Meridian-Timestamp. - Serialize the JSON request body exactly as it will be sent.
- Concatenate the API Key, timestamp, method, path, and serialized body to form the canonical string.
- Compute the HMAC SHA-256 of that canonical string using your API Secret as the key.
- Hex-encode the result and send it as
X-Meridian-Signature.
Example
If your request is:X-Meridian-Signature.
Example code
Token minting flow
UsePOST /v1/auth/token when your backend needs a Meridian access token for a user.
SINGLE_USER: omitX-Meridian-User-Id; Meridian uses the user configured for that partner integrationMULTI_USER: includeX-Meridian-User-Idto identify the target Meridian user
- use
client_credentialsfor a target user - use
refresh_tokento exchange a refresh token for a new access token
MULTI_USER flow, create the Meridian user first with POST /v1/auth/users, then mint the token for that userId.
If POST /v1/auth/users fails because externalId already belongs to an existing Meridian user, retry token creation only if you already know the stored userId from your own customer-to-user mapping.
Partner-key access beyond token minting
Some Meridian Accounts endpoints support direct partner-key authentication in addition to JWT bearer authentication. When the OpenAPI for an endpoint lists both partner API Key security and JWT security, your backend may call that endpoint directly with HMAC-signed partner credentials. For client-facing account access, prefer JWT bearer authentication even when partner-key auth is technically supported.Common authentication errors
The most common causes of HMAC authentication failures are:- omitting
X-Meridian-Api-Keyor another required partner header - concatenating canonical string fields in the wrong order
- signing a different JSON string than the one actually sent
- including
X-Meridian-Program-Idin the canonical string - sending
X-Meridian-User-Idfor aSINGLE_USERintegration - omitting
X-Meridian-User-Idfor aMULTI_USERintegration - using a timestamp outside the allowed 60-second window
- using Sandbox credentials against production, or production credentials against Sandbox