The HoneyBook API is authenticated with **OAuth 2.0**, using the authorization code flow with PKCE. Your application never handles a HoneyBook password; the account holder signs in to HoneyBook directly and grants your application a scoped, revocable access token.

### HoneyBook is not the authorization server

This is the single most important thing to understand before you start, because it determines where your requests go.

HoneyBook operates the **API** and the **sign-in and consent screens**. The OAuth endpoints themselves — `/authorize`, `/token` and token revocation — are served by HoneyBook's identity provider on a **different host**.

| What you are doing                               | Where the request goes                      |
| ------------------------------------------------ | ------------------------------------------- |
| Sending the account holder to authorize your app | `https://oauth.honeybook.com/oauth2/auth`   |
| Exchanging the code for tokens                   | `https://oauth.honeybook.com/oauth2/token`  |
| Refreshing an access token                       | `https://oauth.honeybook.com/oauth2/token`  |
| Revoking a token                                 | `https://oauth.honeybook.com/oauth2/revoke` |
| Calling the API                                  | `https://api.honeybook.com/api/v3/...`      |

There is no `/token` endpoint under `/api/v3`. Looking for one is the most common wrong turn.

### The flow

1. **Redirect the account holder to the authorization endpoint** with your `client_id`, your registered `redirect_uri`, the scopes you need, `response_type=code`, a `state` value, and a PKCE `code_challenge`.
2. **The account holder signs in to HoneyBook and reviews what you are asking for.** They see your application's name and a plain-language description of each scope, and they can decline any of them. If they belong to more than one Company, they also choose which Companies to grant (see [Accounts and Companies](#tag/accounts-and-companies)).
3. **HoneyBook redirects back to your `redirect_uri`** with an authorization code. Verify `state` matches what you sent.
4. **Exchange the code for tokens** at the token endpoint, sending your `code_verifier` and a `private_key_jwt` client assertion (see _Client authentication_ below — HoneyBook issues no client secret).
5. **Call the API** with `Authorization: Bearer <access_token>`.
6. **Refresh** with the refresh token when the access token expires. You only receive a refresh token if you requested the `offline_access` scope.

### Client authentication

To get a `client_id`, apply through the [Request Access form](#tag/request-access); HoneyBook registers your application and issues no client secret.

HoneyBook authenticates clients with **`private_key_jwt`** (RFC 7523), not a shared secret. You generate a key pair, publish the public key at an HTTPS JWKS URL you host (e.g. `https://your-domain/.well-known/jwks.json`), and prove your identity at the token endpoint by sending a short-lived `client_assertion` JWT signed with your private key. HoneyBook fetches your public key from that URL and verifies the signature — your private key never leaves your infrastructure. Rotating a key is self-serve: publish the new key at the same URL, no coordination needed.

Sign the `client_assertion` with **RS256**. ES256 is not accepted.

Redirect URIs must be HTTPS, with no wildcards, and are matched exactly — a trailing slash difference is a mismatch. You may send only one `redirect_uri` parameter per request.

PKCE is required on every authorization request, including for a confidential client like yours.

### Scopes

Scopes are granular and follow a `<resource>.<access>` shape: `projects.read`, `contacts.write`, and so on. The API's OAuth 2.0 security scheme lists every scope and what it grants.

Three scopes are required on essentially every integration and are not resource-specific:

| Scope            | What it is for                                                                                                                                            |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `openid`         | Identifies the HoneyBook account that granted access.                                                                                                     |
| `honeybook.api`  | Permission to call the API at all. Necessary but never sufficient on its own — you still need the resource scope for whatever you are reading or writing. |
| `offline_access` | Issues a refresh token. Without it, access ends when the access token expires.                                                                            |

The token acts only on the Companies the user granted at consent, which may be fewer than all of theirs. With more than one, send `ctxc` on every request; see [Accounts and Companies](#tag/accounts-and-companies).

Ask only for what you need. The consent screen shows every scope you request, and a long list depresses the rate at which people complete authorization.

Writing implies reading, but not automatically: if you need to both read and write projects, request `projects.read` **and** `projects.write`.

### Which response means what

Authentication and authorization failures are deliberately not all distinguishable, and one of them will surprise you:

| Response                                                           | Meaning                                                                                                                                    | What to do                                                      |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
| **400** with `error_type` `HBUserError`                            | The token covers more than one Company and the request has no `ctxc`.                                                                      | Send `ctxc=<company_id>`. See Accounts and Companies.           |
| **401** with `WWW-Authenticate: Bearer error="invalid_token"`      | The token is missing, malformed, or expired.                                                                                               | Refresh the token and retry once.                               |
| **403** with `WWW-Authenticate: Bearer error="insufficient_scope"` | The token is valid, but was not granted a scope this endpoint requires.                                                                    | Re-authorize with the additional scope. Retrying will not help. |
| **404**                                                            | Either the record does not exist, **or** it exists and this account is not allowed to see it, or `ctxc` names a Company outside the grant. | Treat these as the same case.                                   |

That last row is intentional. The API will not confirm that a record exists to someone who is not entitled to it, so a permission failure is indistinguishable from a genuine miss. Do not write logic that infers existence from a 404.
