Skip to Content

Authentication

All API requests require a Bearer token (API key) for authentication.

Creating an API Key

  1. Log in to IronFlock at app.ironflock.com.
  2. Go to User Settings.
  3. Navigate to the API Keys section.
  4. Click Create API Key.
  5. 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/devices

Python 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 CodeMeaning
401Missing or invalid API key
403Insufficient privileges for this operation
404Resource not found
422Validation error (check request parameters)
500Internal server error

All error responses return a JSON object:

{ "error": "Description of the error" }
Last updated on