> ## Documentation Index
> Fetch the complete documentation index at: https://alguna.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Alguna Public API reference documentation.

Alguna provides a JSON-based HTTP API to programmatically manage customers, products, subscriptions, invoices, and more.

## Base URL

```
https://api.alguna.io
```

All requests must be made over HTTPS.

## Versioning

The Alguna API uses date-based versioning via the `Alguna-Version` header. Include the header on every request to specify which version of the API you want to use.

```bash theme={null}
curl https://api.alguna.io/customers \
  -H "Authorization: Bearer sk_live_..." \
  -H "Alguna-Version: 2026-04-01"
```

Use the version selector in the sidebar to browse endpoints for a specific API version.

## Authentication

All requests must include an API key in the `Authorization` header:

```bash theme={null}
Authorization: Bearer <API-KEY>
```

Create and manage API keys in your [dashboard](https://dashboard.alguna.io/settings/credentials). If authentication fails, the API responds with `401 Unauthorized`.

## Filtering & Sorting

List endpoints support filtering via query parameters. Each filterable field is its own parameter:

```bash theme={null}
GET /invoices?status=issued&customer_id=cust_abc123&sort=issue_date:desc
```

Pass a single value for exact matches, or comma-separated values for IN-style filtering:

```bash theme={null}
GET /customers?tag_ids=tag_foo,tag_bar
```

Available filter parameters and their supported operators are documented on each endpoint.

Sorting is supported via the `sort` parameter in `field:order` format (e.g., `name:asc`).

## Errors

Error responses include a `status` code and `detail` message:

```json theme={null}
{
  "status": 400,
  "detail": "Validation failed: name is required"
}
```

| Status | Description                               |
| ------ | ----------------------------------------- |
| `400`  | Bad Request — invalid parameters          |
| `401`  | Unauthorized — missing or invalid API key |
| `404`  | Not Found — resource does not exist       |
| `422`  | Unprocessable Entity — validation error   |
| `500`  | Internal Server Error                     |
