> For the complete documentation index, see [llms.txt](https://docs.aohwv.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aohwv.dev/developer-and-api/developer-api.md).

# API Overview & Authentication

The AOH Sync Public API gives you programmatic access to your tenant's identity data, sync operations, and webhook subscriptions. You can query identities and users, trigger sync jobs, and receive real-time event notifications — all scoped to your tenant.

## Base URL

The base URL for the Public API is environment-specific — it depends on how your AOH Sync instance is deployed and exposed. All endpoints are versioned under `/v1/`. The `/v1/health` endpoint is unauthenticated; every other endpoint requires an API key.

## Authentication

Every authenticated request must include your API key in the `X-API-Key` request header:

```http
GET /v1/identities HTTP/1.1
X-API-Key: your-api-key-here
```

There is no other authentication method for the Public API. Requests that omit the header, or that supply an invalid key, receive a `401 Unauthorized` response.

## Tenant scoping

Your API key is bound to your AOH Sync tenant. All data returned by the API — identities, users, sync jobs, webhooks — belongs to that tenant only. You cannot query data from other tenants.

## How to obtain an API key

Store your key securely. Treat it like a password — it grants full read/write access to your tenant's API surface.

## Making a request

Here is a minimal example using `curl` to list identities:

```bash
curl -s \
  -H "X-API-Key: your-api-key-here" \
  "https://<your-cloudsync-host>/v1/identities?limit=10"
```

A successful response includes a `data` array, plus pagination fields (`total`, `limit`, `offset`):

```json
{
  "data": [ ... ],
  "total": 142,
  "limit": 10,
  "offset": 0
}
```

## Pagination

List endpoints (`/v1/identities`, `/v1/users`) support `limit` and `offset` query parameters. The default page size is 50. Use `offset` to step through large result sets.

| Parameter | Type    | Default | Description                 |
| --------- | ------- | ------- | --------------------------- |
| `limit`   | integer | 50      | Number of results to return |
| `offset`  | integer | 0       | Number of results to skip   |

## Related

* [Public API Reference](/developer-and-api/reference.md)
* [Webhooks](/developer-and-api/webhooks.md)
* [Errors & Rate Limits](/developer-and-api/errors-and-rate-limits.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aohwv.dev/developer-and-api/developer-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
