API Reference

Status: Coming Soon
--------------------
Full interactive API documentation is under construction. This page will include:
- All available endpoints grouped by resource
- Request/response schemas with examples
- Pagination, filtering, and sorting options
- Webhook events and payloads

Base URL
--------
  https://app.imprest.io/api/v1

All requests must include:
  Authorization: Bearer ACCESS_TOKEN
  X-Organization-Id: ORG_UUID
  Content-Type: application/json (for POST/PATCH requests)

Error Format
------------
All API errors follow a consistent JSON shape:

  {
    "error": "human-readable message",
    "code": "machine_readable_code",    // optional
    "details": { ... }                  // optional, validation errors
  }

HTTP Status Codes:
  200 OK               — success
  201 Created          — resource created
  204 No Content       — success, no body (DELETE)
  400 Bad Request      — invalid parameters
  401 Unauthorized     — missing or invalid token
  403 Forbidden        — token lacks required scope
  404 Not Found        — resource does not exist
  422 Unprocessable    — validation failed (details in body)
  429 Too Many Requests — rate limited
  500 Internal Error   — server error

Rate Limiting
-------------
  1000 requests per hour per access token.

Rate limit headers are included on every response:
  X-RateLimit-Limit: 1000
  X-RateLimit-Remaining: 998
  X-RateLimit-Reset: 1712345678

Pagination
----------
List endpoints use cursor-based pagination:

  GET /api/v1/invoices?limit=50&after=CURSOR

Response includes:
  {
    "data": [...],
    "meta": {
      "next_cursor": "...",
      "has_more": true
    }
  }