Authentication
You'll need to authenticate the API to access any endpoint of ParceLabs.
In this guide we'll see how authentication works.
ParceLabs offers two ways to authenticate API requests: API Key via URL and API Key via Header (recommended).
API keys are issued separately for production and development and can be bound to roles/scopes and IP/domain allowlists to reduce security risks.
In this mode the API key is embedded directly in the request URL (e.g. https://api.parcelabs.com/v2/endpoint/{API_KEY}). It is documented because it exists and remains supported for compatibility with API version 1.x, but it should not be the default choice: for new integrations the strongly recommended approach is API Key via header to avoid exposing the key in logs/URLs.
Loading...
Please do not commit your ParceLabs API key to GitHub!
The recommended way to authenticate with the ParceLabs APIs is to send the API key in the headers.
Keys are issued per environment (production and development), with roles/scopes already configured and IP/domain allowlists to limit improper use. You can send it as Authorization: Bearer {API_KEY} (recommended) or as X-API-Key: {API_KEY}. Some integrations may also include an HMAC SHA-256 signature header such as X-Signature to verify the origin of the payload. Here's how to add the token to the request:
This example shows how to use the Authorization: Bearer {API_KEY} header
Authorization: Bearer sk_live_abc123def456
Content-Type: application/json
This example shows how to use the X-API-Key: {API_KEY} header
X-API-Key: sk_live_abc123def456
Content-Type: application/json
Always keep your token safe and reset it if you suspect it has been compromised.