Authentication
All API requests require a Bearer token (API key) for authentication.
Creating an API Key
- Log in to IronFlock at app.ironflock.com.
- Go to User Settings.
- Navigate to the API Keys section.
- Click Create API Key.
- Copy the generated key — it is only shown once.
Using the API Key
Include the key in the Authorization header of every request:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.ironflock.com/v1/ironflock/devicesPython Example
import requests
API_KEY = "your-api-key"
BASE_URL = "https://api.ironflock.com/v1/ironflock"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.get(f"{BASE_URL}/devices", headers=headers)
devices = response.json()JavaScript Example
const API_KEY = "your-api-key";
const BASE_URL = "https://api.ironflock.com/v1/ironflock";
const response = await fetch(`${BASE_URL}/devices`, {
headers: { Authorization: `Bearer ${API_KEY}` }
});
const devices = await response.json();Error Responses
| Status Code | Meaning |
|---|---|
401 | Missing or invalid API key |
403 | Insufficient privileges for this operation |
404 | Resource not found |
422 | Validation error (check request parameters) |
500 | Internal server error |
All error responses return a JSON object:
{
"error": "Description of the error"
}Last updated on