Base URL
Recommended: use the JavaScript SDK
The SDK signs the exact request URL and JSON body, adds the required headers, and maps HTTP failures to typed errors.Generate a bearer token manually
Generate tokens manually only when you can’t use the official SDK to send the request. The token is request-bound: generate it from the relative URL path and the same body object that will be sent, then create a new token for the next request. The examples below accept either a PEM private key or a hex-encoded PKCS#8 DER private key. They intentionally use the DER-encoded ECDSA signature produced by the PrimeVault SDKs. Do not replace the signing step with a generic JWT helper unless it can emit that signature format.Required headers
Header names are case-insensitive at the HTTP layer, but use the spelling above in examples and diagnostics.
How request signing works
1
Build the relative request URL, excluding the scheme and host. The query string may be included; the verifier compares the path component.
2
Canonically serialize the request body with recursively sorted keys and compact JSON separators. Use an empty object for a request without a body.
3
Hash that canonical body with SHA-256 and create a short-lived payload containing
iat, exp, urlPath, userId, body, and a unique jti.4
Base64url-encode the header and payload, then sign
header.payload with P-256 and SHA-256.5
Send the resulting bearer token with the same API-user key in the
Api-Key header.Generate a new token for every request. Changing the path, body keys, or body values after token generation invalidates the request binding.
Credential and key safety
- Store credentials in a secret manager or protected server environment variables.
- Do not log bearer tokens, API keys, private keys, or complete bank-account details.
- Rotate credentials immediately if they may have been exposed.
- Keep server time synchronized. Tokens expire 120 seconds after they are issued, so clock skew causes 401 errors.
- Restrict source IPs where appropriate; see API user IP whitelisting.
- Use the least-privileged API user required by the integration.