# auth.md

How developers and AI agents authenticate with ZAP CLOUD (https://zapcloud.dev).

## API keys (automation and agents)

- Create a key in the console: Account → API keys. It starts with `zc_` and is shown once.
- Send it on every request: `Authorization: Bearer zc_...` to `https://zapcloud.dev/api/v1/...`.
- A key acts as the user who created it, with that user's role on the project (viewer, editor, admin or owner).
- **Project-scoped keys** (recommended) can only touch their own project. **Send-email-only keys** can only send email from one project.
- Keys can expire; revoking one in the console takes effect within about a minute.
- No cookies, CSRF token or `Origin` header are needed with a key.

## People (the console)

People sign in at https://zapcloud.dev/signin with an email and password (an emailed sign-in code if they turn two-factor on), or with Google, Okta or ZAP ID. Those sessions are browser cookies for the console only; scripts and agents should not reuse them.

## Not available yet

There is no OAuth flow for third-party apps to act on a user's behalf: use an API key the user creates for you.

## Errors

- `401 unauthenticated`: the key is missing, wrong, expired or revoked.
- `403 permission_denied`: the key's user lacks the role, or the key belongs to another project.

More: [API documentation](https://zapcloud.dev/docs), [OpenAPI document](https://zapcloud.dev/api/v1/public/openapi.json), [full API guide](https://git.zapride.ca/zap-cloud/skills/-/blob/main/plugins/zapcloud/skills/zapcloud/references/api.md).
