# Authenticating to Zuplo

How a software agent obtains and uses credentials for Zuplo's own APIs: the
Developer API, the Platform MCP server, and the public Docs MCP server.

This describes authenticating **to Zuplo**. It is not about the API keys you
issue to *your* consumers through the Zuplo API Key Service — those are a
separate system, documented under API key management.

## Discover

Zuplo publishes RFC 9728 protected-resource metadata and RFC 8414
authorization-server metadata:

- Protected resource: https://zuplo.com/.well-known/oauth-protected-resource
- Authorization server: https://zuplo.com/.well-known/oauth-authorization-server

The protected-resource document names the authorization server in
`authorization_servers`. The Platform MCP server publishes its own
protected-resource metadata at https://dev.zuplo.com/.well-known/oauth-protected-resource/mcp and advertises it on a
401 via `WWW-Authenticate: Bearer resource_metadata="..."`, so an agent that
calls the endpoint without a token learns where to authenticate from the
response itself.

## Pick a method

| Surface | Endpoint | Credential |
| --- | --- | --- |
| Docs MCP server | `https://dev.zuplo.com/mcp/docs` | none — public |
| Developer API | `https://dev.zuplo.com` | Zuplo account API key |
| Platform MCP server | `https://dev.zuplo.com/mcp` | account API key or OAuth access token |

Start with the Docs MCP server for product questions and implementation
guidance: it needs no credential, so an agent can answer most questions without
holding one. Use the Developer API or Platform MCP server only to read or change
account state.

**Agent identity assertions are not supported.** Zuplo does not implement the
`agent_auth` discovery block, an `identity_endpoint`, or ID-JAG
(`urn:ietf:params:oauth:token-type:id-jag`) assertion exchange. An agent
authenticates as the account whose credential it holds; there is no separate
agent principal to assert. Do not probe for those endpoints — they do not exist.

## Register

There is no dynamic client registration, and an agent cannot self-register. A
person creates the credential and hands it over:

1. Sign in to [the Zuplo portal](https://portal.zuplo.com).
2. Select the account to work with.
3. Open **Settings** > **API Keys**.
4. Create a key, and copy it.

Keys are scoped to an account and work across every project under it. Create a
dedicated key per agent or automation and grant only the project and account
permissions that agent needs, rather than reusing a human's unrestricted
credential. See [Create and scope Zuplo account API keys](https://zuplo.com/docs/articles/accounts/zuplo-api-keys).

## Claim and exchange

An account API key needs no exchange — it is a bearer credential, used as
issued.

For OAuth, run the standard authorization-code flow with PKCE against the
authorization server named in the metadata above. The Platform MCP server
accepts the resulting access token. For terminal and CI workflows the Zuplo CLI
performs this flow for you; see [CLI authentication](https://zuplo.com/docs/cli/authentication).

## Use the access token

Send the credential in the `Authorization` header:

```http
POST /mcp HTTP/1.1
Host: dev.zuplo.com
Authorization: Bearer ZUPLO_API_KEY
Content-Type: application/json
```

Read before you write. Confirm the target account, project, and environment
before any call that changes state.

## Errors

| Status | Meaning | What to do |
| --- | --- | --- |
| 401 | Missing, malformed, or revoked credential | Read `WWW-Authenticate` for the metadata URL, then obtain a valid token |
| 403 | Authenticated, but the key lacks the permission | Grant the permission, or use a key scoped to that account |
| 404 | Wrong account or project, or the resource is gone | Re-resolve the identifier before retrying |
| 429 | Rate limited | Honour `Retry-After` and back off |

Errors are returned as `application/problem+json` with a `type`,
`title`, `status`, and `detail`, plus a `trace` object carrying the
request id — quote it when reporting a problem.

## Revocation

Delete the key in **Settings** > **API Keys** in [the Zuplo portal](https://portal.zuplo.com).
Revocation takes effect immediately and cannot be undone; issue a replacement
before retiring a key an automation depends on. Rotate by creating the new key,
moving traffic to it, then deleting the old one.
