API v1

API Reference

Errors

StyleHub uses conventional HTTP status codes. Error responses carry a machine-readable code and a human-readable message.

Error codes#

StatusCodeDescription
401unauthorizedMissing or invalid API key — call GET /stylehub-api-keys first and send the returned key as Authorization: Bearer <api_key>.
400missing_required_paramNone of the four date parameters (created_from, created_to, updated_from, updated_to) was provided.
400invalid_paramA date was not in YYYY-MM-DD format, or page, page_size, order_id or status had an invalid value.
500internal_errorSomething went wrong on our side.

Error response body#

JSON
{
  "error": "missing_required_param",
  "message": "At least one of created_from, created_to, updated_from, updated_to is required."
}

Handling errors#

400 and 401 errors are caused by the request and will not succeed if retried unchanged — fix the parameters or the API key. 500 errors may be transient; retry with exponential backoff.

Python
import time
import requests

def get_with_retry(url, headers, params, retries=3):
    for attempt in range(retries + 1):
        resp = requests.get(url, headers=headers, params=params, timeout=30)

        if resp.status_code == 400:
            err = resp.json()
            raise ValueError(f"{err['error']}: {err['message']}")

        if resp.status_code >= 500 and attempt < retries:
            time.sleep(2 ** attempt)
            continue

        resp.raise_for_status()
        return resp.json()
The most common error in practice is missing_required_param — see Date filtering.

© 2026 StyleHub · Developer Platform