API tokens and OAuth

Credentials for scripts, CI and AI agents, with their own capabilities, scope and expiry.

Tokens let scripts, CI, API clients and AI agents use Deplo without a browser. They live in Settings -> API tokens, under Account.

Settings -> API tokens: every token with its permissions, scope, last use and expiry
  • A token is personal. Only the person who created it can see, edit or revoke it: not a team admin, not an instance admin.
  • It has its own capabilities, which you can change later without reissuing it.
  • The secret is shown once, and only its hash is stored. Lost it? Revoke and create a new one.

What a token can do is checked live, on every request:

what the token was granted   AND   what its owner can still do

Each team decides, per member, where their tokens may act:

CapabilityWhat it allows
Use API tokens (manage_tokens)The member's tokens can act in this team at all
Connect AI agents (manage_mcp)The member's tokens can drive this team over MCP

Removing the member, or either capability, cuts their tokens off at once. Settings -> Members shows how many tokens and agents each member has reaching the team: a number, never the credentials.

Connecting an AI agent? Settings -> AI agents creates its token for you. See MCP server.

Create an API token

Start from a template

Settings -> API tokens -> New token, then Start from scratch or a template, least powerful first:

The templates a new token can start from
TemplateFor
Read onlyDashboards and reporting
Deploy hook & CIA pipeline that deploys
MCP & AI agentsAn agent driving the team
App automationA script that creates, configures and ships apps
Agent setupAn agent setting up a new Deplo: projects, apps, databases, Git
Root accessEverything you can do

Name, expiry, scope

  • Expires: see Expiry.
  • Scope: tick whole teams, projects, folders (subfolders included) or single apps. Nothing ticked reaches every team where you may use API tokens, including ones you join later.
  • Advanced -> Instance admin, for instance admins only: the token may administer the whole instance. Never combined with a scope, and never on unless you turn it on.

Tick capabilities

Pick a Template, or tick them one by one. Sensitive ones are marked.

Copy it

Create token, then copy it. You will not see it again.

Use the token

Send it as a bearer token, and name the team with its slug (its id works too):

curl -s https://deplo.example.com/api/graphql \
  -H "Authorization: Bearer deplo_xxxxxxxxxxxxxxxxxxxx" \
  -H "X-Deplo-Team: acme" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ apps { id name status } }"}'

A request acts in one team. Without X-Deplo-Team it lands in the first team the token reaches. The full surface is in the API reference.

Scope, and the rule that surprises people

Naming a project, a folder or an app clamps the token to the capabilities that mean something there, and drops the rest. Managing members is not one of them, so a token scoped to one app cannot do it. Naming a whole team clamps nothing. Need both? Create two tokens.

Connected clients and OAuth

A web AI app (claude.ai, chatgpt.com) cannot take a pasted token, so Deplo acts as an OAuth server for it. Approving the consent screen creates an ordinary API token:

  • Permissions start from the MCP & AI agents template. Access left empty reaches every team where you hold Connect AI agents and Allow AI agents is on (Settings -> General). Narrow either before Authorize.
  • The token shows in Settings -> API tokens under the client's name. Edit or revoke it there; revoking stops the client in every team.
  • It expires in 90 days, like any new token. Connecting the same client again replaces it.
  • The OAuth scopes the client asks for decide nothing. The token's capabilities do.

Expiry

  • Expires offers In 30 days, In 90 days (the default), In a year and Never. A token created over the API without a date also gets 90 days.
  • It is checked first, on the API, MCP and deploy hooks.
  • An expired token stays in the list marked Expired: edit it to move the date, or revoke it.

Important limits

  • A token can edit or revoke only itself, never another token.
  • A token created by a token cannot expire later than it, reach outside its scope, or be unscoped. A connected AI client cannot create or change tokens at all.
  • Some actions need a signed-in person: your password, two-factor, passkeys, devices, push alerts, DNS providers, connecting an AI client and team ownership.
  • No secret is revealed over MCP, whatever the token holds.
  • Two-factor applies. If the team requires it and the owner has not set it up, the token reaches nothing there.

Troubleshooting

  • 401: missing, revoked or expired.
  • 403 on one field: the token lacks that capability, or the scope excludes that resource.
  • It worked yesterday: your capabilities changed (no Use API tokens means the token no longer reaches that team), it expired, or the team turned on two-factor.

More in Sign-in and access troubleshooting.

See also

Did this page help you?

On this page