> 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/reference.md).

# Public API Reference

Complete reference for all AOH Sync Public API endpoints. Every endpoint under `/v1/` (except `/v1/health`) requires the `X-API-Key` header.

## Interactive reference

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/health" method="get" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/identities" method="get" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/identities/{id}" method="get" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/identities/{id}/history" method="get" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/users" method="get" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/users/{id}" method="get" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/sync/trigger" method="post" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/sync/jobs/{id}" method="get" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/webhooks" method="post" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/webhooks" method="get" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/webhooks/{id}" method="patch" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/webhooks/{id}" method="delete" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tO4eNBkQtZAeK7gPbHpf" path="/v1/webhooks/{id}/rotate-secret" method="post" %}
[openapi.yaml](https://2706226485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8BF8xXbTZGWilkpjaGNh%2Fuploads%2Fgit-blob-2e867d3d1f88c355d16fd9ddcb07178ae10124ea%2Fopenapi.yaml?alt=media)
{% endopenapi %}

***

## Endpoint summary

The table below is always readable, regardless of how the interactive blocks are configured.

| Method   | Path                              | Summary                                 | Auth required |
| -------- | --------------------------------- | --------------------------------------- | ------------- |
| `GET`    | `/v1/health`                      | Health check                            | No            |
| `GET`    | `/v1/identities`                  | List identities (paginated)             | Yes           |
| `GET`    | `/v1/identities/{id}`             | Get a single identity by ID             | Yes           |
| `GET`    | `/v1/identities/{id}/history`     | Get lifecycle history for an identity   | Yes           |
| `GET`    | `/v1/users`                       | List users for the caller's tenant      | Yes           |
| `GET`    | `/v1/users/{id}`                  | Get a single user by ID                 | Yes           |
| `POST`   | `/v1/sync/trigger`                | Trigger a sync job for a connector      | Yes           |
| `GET`    | `/v1/sync/jobs/{id}`              | Get sync job status                     | Yes           |
| `POST`   | `/v1/webhooks`                    | Create a webhook subscription           | Yes           |
| `GET`    | `/v1/webhooks`                    | List webhook subscriptions              | Yes           |
| `PATCH`  | `/v1/webhooks/{id}`               | Update a webhook subscription           | Yes           |
| `DELETE` | `/v1/webhooks/{id}`               | Delete a webhook subscription           | Yes           |
| `POST`   | `/v1/webhooks/{id}/rotate-secret` | Rotate the signing secret for a webhook | Yes           |

## Key schemas

### Identity

An Identity is AOH Sync's unified representation of a person, combining attributes, linked user accounts, directory accounts, and machine identities.

```json
{
  "id": "idty_01abc",
  "display_name": "Alex Johnson",
  "status": "active",
  "created_at": "2025-01-15T09:00:00Z",
  "updated_at": "2025-06-01T14:22:00Z",
  "attributes": [
    {
      "identity_id": "idty_01abc",
      "field_name": "department",
      "field_value": "Engineering",
      "source_type": "hr",
      "source_id": "src_hr01",
      "priority": 1,
      "updated_at": "2025-06-01T14:22:00Z"
    }
  ],
  "users": [ ... ],
  "accounts": [ ... ],
  "machine_identities": [ ... ]
}
```

### User

A User is a directory record (e.g. from Microsoft Entra) linked to an Identity. Users belong to the caller's tenant.

```json
{
  "id": "usr_01xyz",
  "external_id": "aad-object-id",
  "user_principal_name": "alex@contoso.com",
  "display_name": "Alex Johnson",
  "email": "alex@contoso.com",
  "job_title": "Staff Engineer",
  "status": "active",
  "tenant_id": "tenant_01",
  "hire_date": "2022-03-01T00:00:00Z",
  "roles": ["reader"],
  "groups": ["engineering"],
  "departments": ["Engineering"]
}
```

### SyncJob (trigger response)

```json
{
  "job_id": "job_01def",
  "status": "queued"
}
```

### SyncStatus (job status response)

```json
{
  "job_id": "job_01def",
  "status": "running",
  "progress_pct": 42,
  "started_at": "2025-07-21T10:00:00Z",
  "completed_at": null,
  "error_message": null,
  "batches_processed": 5,
  "batches_total": 12
}
```

## Related

* [API Overview & Authentication](/developer-and-api/developer-api.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/reference.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.
