# API Reference

> The base URL, authentication, the error envelope, the OpenAPI document, and every resource the API exposes.

Canonical: <https://www.tryadeli.com/docs/api>

Every endpoint in the Adeli REST API has its own page here: what it does, the
parameters it takes, a request you can copy in cURL, JavaScript, or Python, and
the responses it returns. For how the API fits together, start with the
[Overview](https://www.tryadeli.com/docs).

## Base URL

All endpoints live under `/api/v1`, and every response is JSON.

```bash
https://app.tryadeli.com/api/v1
```

## Authentication

Every request carries your API key as a bearer token. Keys are created in the
dashboard and belong to your organization; see [Authentication](https://www.tryadeli.com/docs/authentication).

```http
Authorization: Bearer rk_live_...
```

The examples on these pages read the key from an environment variable:

```bash
export ADELI_API_KEY='rk_live_...'
```

## Errors

Every failure returns the same envelope, with a stable `code` to branch on and
a `message` for humans. [Errors](https://www.tryadeli.com/docs/errors) lists every status and code.

```json
{
  "error": {
    "code": "profile_not_found",
    "message": "Profile not found"
  }
}
```

## OpenAPI

The whole API is described as an OpenAPI 3.1 document at
[`/docs/openapi.json`](https://www.tryadeli.com/docs/openapi.json). Import it into Postman or Insomnia,
or generate a client from it.

## Resources

- [Profiles](https://www.tryadeli.com/docs/api/profiles.md) — List, create, read, update, and delete the profiles in your organization. (5 endpoints)
- [Connect](https://www.tryadeli.com/docs/api/connect.md) — Run your customer through Instagram, Facebook, TikTok, YouTube, X, or Bluesky authorization without an Adeli login. (2 endpoints)
- [Accounts](https://www.tryadeli.com/docs/api/accounts.md) — List connected accounts, refresh their tokens, and disconnect them. (6 endpoints)
- [Posts](https://www.tryadeli.com/docs/api/posts.md) — List Instagram, Facebook, TikTok, YouTube, X, and Bluesky posts, and publish to all six. (14 endpoints)
- [Comments](https://www.tryadeli.com/docs/api/comments.md) — Read, reply to, hide, like, and delete comments on Instagram, Facebook, TikTok, and YouTube posts. (4 endpoints)
- [Messages](https://www.tryadeli.com/docs/api/messages.md) — Read Instagram and Facebook message history, and send text replies to both. (2 endpoints)
- [Analytics](https://www.tryadeli.com/docs/api/analytics.md) — Instagram account insights, Facebook Page metrics, TikTok profile statistics, account insights, and post insights, and YouTube channel and video insights. (7 endpoints)
- [Ads](https://www.tryadeli.com/docs/api/ads.md) — Facebook ad accounts, campaign performance, creating campaigns from Page posts, and lead form submissions. (11 endpoints)
