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

# Overview

> Manage users, organizations, and organization onboarding state.

The Organizations API manages the identity and organization context used by the rest of the Anthid platform.

## Access

User profile, organization creation, organization updates, and organization deletion require a user bearer token:

```text theme={null}
Authorization: Bearer <YOUR_ACCESS_TOKEN>
```

Selected organization reads and onboarding operations also accept an organization API key or an appropriately scoped client-credentials bearer token. Check each endpoint's authentication section before choosing a credential.

## Create an organization

Organization creation is a reconciled workflow. The API returns the new internal organization ID after it records the request; the backing identity-provider organization and related records are created asynchronously.

Every request requires a caller-generated UUID in `idempotency_key`. Reuse the same key when retrying the same logical creation request, and generate a new key for a different organization.

```bash theme={null}
curl https://api.anthid.com/v1/organizations \
  -X POST \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Trading",
    "idempotency_key": "550e8400-e29b-41d4-a716-446655440000"
  }'
```

```json theme={null}
{
  "organization_id": "019c0538-86f2-7c32-9c1e-6f79cbfdb7b4"
}
```

## Onboarding

The onboarding resource records when an organization completes these milestones:

* `ConnectedBroker`
* `CreatedApiKey`
* `SubmittedFirstOrder`
* `ViewedDocs`
* `ConfiguredControls`

Mark a milestone complete with `PATCH /v1/organizations/{org_id}/onboarding`. The operation returns `204 No Content`.

```json theme={null}
{
  "step": "ConnectedBroker"
}
```

## Endpoint groups

| Group           | Endpoints                                                                                   |
| --------------- | ------------------------------------------------------------------------------------------- |
| Current user    | `GET`, `PUT`, and `DELETE /v1/users/me`                                                     |
| Organizations   | `GET` and `POST /v1/organizations`; `GET`, `PATCH`, and `DELETE /v1/organizations/{org_id}` |
| Provider lookup | `GET /v1/organizations/by-provider/{provider}/{provider_id}`                                |
| Onboarding      | `GET` and `PATCH /v1/organizations/{org_id}/onboarding`                                     |
