# Customer Identity API

> Every endpoint a customer realm uses on your realm's own host, by area, with what each one does and the page that covers it.

Customer Identity runs on the same realm endpoints as the rest of the product. This page gathers the ones a customer
realm uses. The admin and self-service calls are under `https://foobar.cvyuh.com/api/v0/am` and take a session in the
`x-cvyuh-token` cookie (see [Call the API](../../develop/api/)); your apps' calls are under
`https://foobar.cvyuh.com/oauth2` and take the app's own credentials, as OAuth 2.0 and OpenID Connect say.

## Registration

| Method | Endpoint | What it does | Page |
|---|---|---|---|
| `POST` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/user?id={id}` | Create a customer's account | [Create customer accounts](../registration/create-customer-accounts/) |
| `PATCH` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/user/{id}` | Change a customer's profile, or turn their access off | [Add and change users](../../directory/users/add-and-change-users/) |

Every directory endpoint is in the [Directory & Lifecycle API](../../directory/api/).

## Customer sign-in

| Method | Endpoint | What it does | Page |
|---|---|---|---|
| `GET`, `PATCH` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/webauthnSettings/webauthnSettings` | The passkey domain, and what a passkey ceremony asks for | [Passkey sign-in for customers](../sign-in/passkeys-for-customers/) |
| `GET`, `PATCH` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/authSettings/authSettings` | Which methods the realm runs, and whether a second step is required | [Passkey sign-in for customers](../sign-in/passkeys-for-customers/) |
| `PATCH` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/authSettings/authSettings` | Lockout: how many failures lock an account, over what window, and for how long | [Protect customer sign-in](../sign-in/protect-customer-sign-in/) |
| `GET`, `POST` | `https://foobar.cvyuh.com/oauth2/authorize` | Where your app sends a customer to sign in | [Get started with Customer Identity](../get-started/) |
| `POST` | `https://foobar.cvyuh.com/oauth2/token` | Where your app exchanges a code for tokens | [Get started with Customer Identity](../get-started/) |

Every sign-in and token endpoint is listed in the realm's [Discovery document](../../workforce-identity/applications/registration/discovery/),
at `https://foobar.cvyuh.com/oauth2/.well-known/openid-configuration`.

## Consent

| Method | Endpoint | What it does | Page |
|---|---|---|---|
| `GET`, `PATCH` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Settings/oauth2Settings` | Remember consent, let trusted apps skip, and how long a customer has to answer | [The consent page](../consent/consent-page/) |
| `POST` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client?id={client id}` | Register an app, with the name the consent page shows | [Get started with Customer Identity](../get-started/) |
| `PATCH` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/{client id}` | Name an app, let it skip the page, or stop it for every customer | [Show or skip the consent page](../guides/consent-screen/) |
| `GET` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Consent` | The consent records the realm keeps, one per customer and app | [Remember what users allowed](../guides/remembered-consent/) |
| `DELETE` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Consent/{record id}` | Remove one customer's consent to one app, so they're asked again | [Let users remove apps they allowed](../guides/people-remove-apps/#remove-one-app-for-one-user) |
| `GET`, `PATCH` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/i18nBundle/i18nBundle` | The consent page's wording and scope labels, per language | [The consent page](../consent/consent-page/#say-what-each-scope-means) |

## Customer self-service

Called with the customer's own session, for their own account.

| Method | Endpoint | What it does | Page |
|---|---|---|---|
| `GET` | `https://foobar.cvyuh.com/api/v0/am/me/v1/oauth2/apps` | The apps the customer allowed | [Authorized apps](../self-service/authorized-apps/) |
| `DELETE` | `https://foobar.cvyuh.com/api/v0/am/me/v1/oauth2/apps/{client id}` | Take an app back, ending its tokens for them | [Authorized apps](../self-service/authorized-apps/) |
| `GET` | `https://foobar.cvyuh.com/api/v0/am/me/v1/oauth2/agents` | The AI agents that may act for the customer | [Let users remove agents](../../workforce-identity/guides/agents/people-remove-agents/) |
| `DELETE` | `https://foobar.cvyuh.com/api/v0/am/me/v1/oauth2/agents/{agent}` | Stop an agent acting for them | [Let users remove agents](../../workforce-identity/guides/agents/people-remove-agents/) |
| `GET` | `https://foobar.cvyuh.com/api/v0/am/me/v1/oauth2/approvals` | What an agent is waiting for the customer to approve | [Backchannel authentication](../../workforce-identity/agents/backchannel-authentication/) |
| `POST` | `https://foobar.cvyuh.com/api/v0/am/me/v1/oauth2/approvals/{id}` | Answer one | [Backchannel authentication](../../workforce-identity/agents/backchannel-authentication/) |
| `POST` | `https://foobar.cvyuh.com/api/v0/am/whoami/v1` | Who the customer is: profile and session | [Self-service](../../directory/users/self-service/) |
| `GET` | `https://foobar.cvyuh.com/api/v0/am/devices/v1` | Their passkeys, authenticator apps and recovery codes | [Self-service](../../directory/users/self-service/) |
| `DELETE` | `https://foobar.cvyuh.com/api/v0/am/devices/v1/{id}` | Remove a passkey or an authenticator app | [Self-service](../../directory/users/self-service/) |

`GET /me/v1/oauth2/apps` answers a list of `{ "clientId", "clientName", "scopes", "firstGranted", "lastGranted",
"offline" }`. Both `DELETE` calls answer `204`; taking back an app the customer never allowed answers `404`.

## Privacy requests

| Method | Endpoint | What it does | Page |
|---|---|---|---|
| `GET` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/user/{id}` | A customer's profile | [Customer data and privacy requests](../consent/customer-data-and-privacy/) |
| `GET` | `https://foobar.cvyuh.com/api/v0/am/audit/v1/trail?person={id}` | What was done by and for a customer | [Customer data and privacy requests](../consent/customer-data-and-privacy/) |
| `POST` | `https://foobar.cvyuh.com/api/v0/am/sessions/v1/end` | End a customer's sessions | [Customer data and privacy requests](../consent/customer-data-and-privacy/) |
| `DELETE` | `https://foobar.cvyuh.com/api/v0/am/objects/v1/user/{id}` | Delete a customer's account | [Customer data and privacy requests](../consent/customer-data-and-privacy/) |

## Customer realms

Realms are created and changed on the realms API; see [Realms and sub-realms](../../platform/realms/sub-realms/). An
app serving many business customers calls each realm on its own host; see
[Connect one app to many business customers](../guides/connect-one-app-to-many-business-customers/).
