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

# REST API overview

> The Bludia public REST API lives at /ext/api/v1. It exposes record CRUD per collection and end-user authentication. Every request needs the X-BLUDIA-API-KEY header; end-user keys also need a Bearer access token.

Every Bludia project has a JSON REST API that your apps use to read and write data and to sign users in.

## Base URL

```text theme={null}
https://YOUR_API_HOST/ext/api/v1
```

Copy the exact base URL from any collection's **API Endpoints** panel in the dashboard. In these docs, `$BASE_URL` stands for it.

## Endpoints

> [tab] Records
>
> | Method | Path | Action | Permission |
> | :- | :- | :- | :- |
> | `GET` | `/collections/{collection}/records` | List records | `read` |
> | `GET` | `/collections/{collection}/{id}` | Get one record | `read` |
> | `POST` | `/collections/{collection}` | Create a record | `create` |
> | `PUT` | `/collections/{collection}/{id}` | Update a record (partial) | `update` |
> | `DELETE` | `/collections/{collection}/{id}` | Delete a record (to trash) | `delete` |
>
> `{collection}` is the collection **slug**, for example `customers`.

> [tab] Authentication
>
> | Method | Path | Needs Bearer token |
> | :- | :- | :- |
> | `POST` | `/auth/{guard}/register` | No |
> | `POST` | `/auth/{guard}/login` | No |
> | `POST` | `/auth/{guard}/refresh` | No |
> | `POST` | `/auth/{guard}/password/forgot` | No |
> | `POST` | `/auth/{guard}/password/reset` | No |
> | `POST` | `/auth/{guard}/email/verify` | No |
> | `GET` | `/auth/{guard}/me` | Yes |
> | `POST` | `/auth/{guard}/logout` | Yes |
> | `POST` | `/auth/{guard}/logout-all` | Yes |
> | `POST` | `/auth/{guard}/email/resend` | Yes |
>
> `{guard}` is the authentication guard's **slug**, for example `users`.

## Headers

| Header | When | Value |
| :- | :- | :- |
| `X-BLUDIA-API-KEY` | **Always** | Your API key |
| `Authorization` | With `end_users` keys on data and account routes | `Bearer <access_token>` |
| `Content-Type` | Requests with a body | `application/json` |
| `Accept` | Recommended | `application/json` |
| `If-Match` | Optional on `PUT` | The record version you loaded, for example `"3"` |

## A complete request

```bash cURL theme={null}
curl "$BASE_URL/collections/orders/records?limit=10&sort=created_at&order=desc" \
  -H "Accept: application/json" \
  -H "X-BLUDIA-API-KEY: $BLUDIA_API_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

```javascript JavaScript theme={null}
const res = await fetch(`${BASE_URL}/collections/orders/records?limit=10`, {
  headers: {
    Accept: "application/json",
    "X-BLUDIA-API-KEY": API_KEY,
    Authorization: `Bearer ${accessToken}`,
  },
});
const { data, meta } = await res.json();
```

```python Python theme={null}
import requests

res = requests.get(
    f"{BASE_URL}/collections/orders/records",
    params={"limit": 10},
    headers={
        "Accept": "application/json",
        "X-BLUDIA-API-KEY": API_KEY,
        "Authorization": f"Bearer {access_token}",
    },
)
data = res.json()["data"]
```

## Response format

```json List theme={null}
{
  "data": [ { "id": 101, "title": "Order #101", "total": "120.00" } ],
  "meta": { "page": 1, "limit": 10, "total": 57, "pages": 6, "trashed": 2 },
  "totals": []
}
```

```json Single record theme={null}
{ "data": { "id": 101, "title": "Order #101", "total": "120.00" } }
```

```json Delete theme={null}
{ "message": "Record deleted" }
```

## In this section

> [card] [Authentication](https://docs.bludia.com/api/authentication.md)
>
> Platform keys vs end-user keys and Bearer tokens.

> [card] [API keys](https://docs.bludia.com/api/api-keys.md)
>
> Create, scope, rotate, and revoke keys.

> [card] [Querying](https://docs.bludia.com/api/querying.md)
>
> Filters, conditions, sorting, pagination, and `with`.

> [card] [Errors](https://docs.bludia.com/api/errors.md)
>
> Status codes and error bodies.

> [card] [Rate limits](https://docs.bludia.com/api/rate-limits.md)
>
> Per-key and per-IP limits.

> [card] [CORS](https://docs.bludia.com/api/cors.md)
>
> Allowed origins for browser apps.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.