Spektakular integration API: connect your applications (management, accounting, website, ticketing, warehouse…) with your profiles on Spektakular. Every call is HTTPS and JSON. Method, parameter and code names are in English; this documentation can be read in any language.
Authentication
Every call carries an API key in the «Authorization: Bearer <key>» header (or «X-Api-Key: <key>»). Spektakular administration generates the keys: each one belongs to a user and to ONE of their profiles, and only allows the methods of that profile type the user has enabled. Keep it like a password: it is only shown once. If it is compromised, ask for it to be revoked.
curl -X POST https://api.spektakular.horion.cloud/v1/me.get \
-H "Authorization: Bearer spk_test_xxxxxxxxxxxx_…" \
-H "Content-Type: application/json" \
-d '{}'Live and test zones
Keys starting with «spk_live_» work with live data; keys starting with «spk_test_» work with the test database, where you can try your integration safely. The address is the same: the key decides the zone. Every response states its zone in «meta.zone».
Responses
Every response is JSON with «ok» (true or false). On success the data is in «data»; otherwise «error» holds a stable code («code»), a message and sometimes «details». The HTTP status goes with the error (401, 403, 404, 422, 429, 503…). «meta.request_id» identifies the request: include it if you contact us.
{"ok": true, "data": {…}, "meta": {"request_id": "…", "zone": "live", "api_version": "1"}}
{"ok": false, "error": {"code": "rate_limited", "message": "…"}, "meta": {…}}Rate limits
Per key: 60 calls per minute and 2000 per hour (each method in a batch request counts). Batch requests: 5 per hour with up to 20 methods each. Per IP: 120 requests per minute; after 20 authentication failures the IP is blocked for 15 minutes. Maximum body: 256 KB; maximum time per call: 10 s.
When a limit is exceeded the response is 429 with the «Retry-After» header (seconds to wait). The «X-RateLimit-Limit», «X-RateLimit-Remaining» and «X-RateLimit-Reset» headers show your hourly quota. Recommended: retry with increasing back-off and group calls into batch requests.
Batch request
Call several methods in a single request: POST /v1/batch with {"requests": [{"id": "…", "method": "…", "params": {…}}, …]}. Up to 20 methods per request and 5 batch requests per hour. Each method is resolved independently: the response returns, in the same order, {"id", "ok", "data" | "error"} for each one, and a failure in one does not affect the others.
curl -X POST https://api.spektakular.horion.cloud/v1/batch \
-H "Authorization: Bearer spk_live_xxxxxxxxxxxx_…" \
-H "Content-Type: application/json" \
-d '{"requests": [
{"id": "me", "method": "me.get"},
{"id": "ping", "method": "system.ping"}
]}'Methods
POST /v1/me.get
Who am I: user, profile and permissions of the key
Returns the user and profile you connect as, the methods you can use with this key and your limits. It is the recommended first call to check a key.
Parameters
None.
Result (data)
| Field | Type | Description |
|---|---|---|
user | object | User who owns the key. |
profile | object | Profile the key connects as. |
key | object | Key used (without the secret). |
methods | array | Methods this key can use. |
limits | object | Rate limits in force. |
base_url | string | Base address of the methods. |
GET · POST /v1/system.ping
Check that the API is up
No key needed. Use it to check the connection and the server time.
Parameters
None.
Result (data)
| Field | Type | Description |
|---|---|---|
pong * | boolean | Always true. |
time * | string · date-time | Server time. |
api_version | string | API version. |
Error codes
| code | HTTP | Description |
|---|---|---|
invalid_request | 400 | The request is not valid (structure, identifiers…). |
invalid_json | 400 | The body is not a valid JSON object. |
invalid_params | 422 | Parameters are missing or not valid; «details.errors» says which. |
payload_too_large | 413 | The body exceeds the maximum size. |
unauthorized | 401 | The API key is missing. |
invalid_key | 401 | The key is not valid. |
key_revoked | 401 | The key has been revoked. |
key_expired | 401 | The key has expired. |
ip_not_allowed | 403 | The key cannot be used from this IP. |
user_inactive | 403 | The user account is not active. |
user_blocked | 403 | The user account is blocked. |
user_locked | 403 | The account is temporarily locked after failed sign-in attempts. |
api_access_denied | 403 | The user has no API access. |
profile_not_found | 403 | The key’s profile does not exist. |
profile_inactive | 403 | The key’s profile is not active. |
method_not_found | 404 | The method does not exist. |
method_not_allowed | 403 | This key cannot use this method. |
http_method_not_allowed | 405 | HTTP verb not allowed on this address. |
not_found | 404 | The address does not exist. |
rate_limited | 429 | Too many requests: wait as indicated by «Retry-After». |
batch_limit | 429 | The batch request limit for this hour has been reached. |
too_many_failures | 429 | Too many authentication failures from this IP: it is temporarily blocked. |
timeout | 504 | The request was taking too long and was stopped. |
test_zone_unavailable | 503 | The test zone is not available right now. |
service_unavailable | 503 | The API is temporarily unavailable (maintenance or overload): retry later. |
internal_error | 500 | Internal error: it has been logged. |