Authenticating Requests with API Keys
To make successful requests to the Iron API, you must authenticate every request by including a valid API key in the request headers. Authentication ensures that only authorized users can access resources or perform actions within the API. Learn how to generate API Keys here.Including the API Key
Include your API key in theX-API-Key header of every request. If the API key is missing, incorrect, or revoked, the request will fail.
Example Request
The following example demonstrates how to use your API key with aGET request to fetch a list of customers:
Example using cURL:
Note:
- Replace
YOUR-API-KEYwith the actual API key you generated. - The
X-API-Keyheader is required for every request to authenticate your access.
Handling Authentication Errors
If you use an invalid or revoked API key, the server will respond with a401 Unauthorized error. Here’s an example response:
Common Causes of Authentication Errors:
- Incorrect API Key: Ensure the key matches the one you generated.
- Revoked API Key: Verify that the key has not been revoked.
- Missing API Key: Confirm the
X-API-Keyheader is included in your request.
How to Resolve:
- Double-check the API key and its permissions in your Iron API Dashboard.
- Generate a new key if necessary and update your requests with the new key.

