Request headers
These are the headers you should include when making requests:Header | Required | Description | Example |
---|---|---|---|
x-api-token | Yes | Your API key for authentication | x-api-token: abcd1234... |
Content-Type | Yes* | Content type of the request body (*required for POST requests) | Content-Type: application/json |
Accept | No | Preferred response format | Accept: application/json |
Authentication header
Thex-api-token
header is required for all API requests and contains your API
key:
Never share your API key publicly or commit it to source control. Consider
using environment variables or a secure secrets manager to store it.
Content-Type header
For POST requests, always set theContent-Type
header to application/json
:
Response headers
These are the headers returned in API responses that provide useful information:Header | Description | Example |
---|---|---|
Date | When the response was generated | Date: Sat, 22 Mar 2025 13:49:07 GMT |
Content-Type | Format of the response body | Content-Type: application/json |
Transfer-Encoding | How the response is encoded for transfer | Transfer-Encoding: chunked |
Connection | Connection status between client and server | Connection: keep-alive |
x-process-time | Time taken to process the request (in seconds) | x-process-time: 0.7334954738616943 |
correlation-id | Unique identifier for tracing the request through our system | correlation-id: a702576c-2007-4b23-9ba4-cad305c84275 |
cf-cache-status | Cloudflare cache status | cf-cache-status: DYNAMIC |
Server | Server software handling the request | Server: cloudflare |
CF-RAY | Cloudflare ray ID for request tracing | CF-RAY: 924626834b0fbfb4-WAW |
Content-Encoding | Compression method used for the response body | Content-Encoding: br |
Correlation ID header
Thecorrelation-id
header contains a unique identifier for your request:
Always include this ID when contacting support about an issue with an API
request. It helps us quickly locate your specific request in our logs.
Process time header
Thex-process-time
header shows how long it took our system to process your
request (in seconds):
Code examples
Here are the examples of how to work with headers in your requests for differnt programming languages:Best practices
-
Always use the correct authentication header: Use
x-api-token
instead ofx-api-key
for authentication. - Always log correlation IDs: Store correlation IDs alongside your application logs for easier troubleshooting.
-
Monitor process times: Keep track of
x-process-time
values to identify performance trends or issues. - Handle headers consistently: Implement consistent header handling in your error handling and logging code.
- Be aware of case sensitivity: While HTTP headers are case-insensitive in the protocol, many libraries preserve the original casing when accessing them.
-
Add proper Content-Type headers: Always include the
Content-Type: application/json
header for POST requests.