Authentication

deplo.ai has exactly one identity provider: GitHub. Signing in via OAuth creates the account and yields a browser JWT; API consumers then mint long-lived CLI tokens from that session. Both token types authenticate every endpoint in this reference.

Getting a token as an API consumer#

The OAuth endpoints below are redirect flows designed for a browser — they end by handing a JWT to the dashboard, not by returning JSON to your script. To call the API from code:

StepWhat to do
1Sign in at deplo.in with GitHub (this is the only OAuth step you ever perform manually).
2Create a CLI token in Settings — or via POST /cli-tokens if you already hold a token.
3Send it as Authorization: Bearer dpl_… on every request. CLI tokens never expire; revoke them any time.
Note
JWTs are for the browser. They are issued per sign-in, expire after 7 days, and are what the dashboard stores. Scripts and CI should always use dpl_ tokens — see CLI Tokens and the CLI authentication guide.

OAuth endpoints#

Starts the GitHub OAuth flow. Responds 302, redirecting the browser to GitHub's authorize page with the scopes read:user, user:email, repo, and admin:repo_hook. Open this URL in a browser — it is not a JSON endpoint.

response · 302
HTTP/1.1 302 Found
Location: https://github.com/login/oauth/authorize?client_id=…&redirect_uri=…&scope=read%3Auser+user%3Aemail+repo+admin%3Arepo_hook

System endpoint — GitHub redirects here after the user authorizes. It exchanges the ?code for an access token, creates or updates the user, and 302-redirects to the dashboard with a fresh JWT (…/auth/callback?token=…&userId=…). On failure it redirects to the app with ?auth=failed; a missing code returns 400. You never call this yourself.

Current user#

GET/api/v1/auth/meBearer token

Returns the profile of the user the bearer token resolves to. Works identically with a JWT or a dpl_ CLI token — useful as a token validity check.

FieldTypeDescription
userIdstringThe user's id (cuid).
emailstringPrimary email from GitHub.
namestringDisplay name.
githubLoginstringGitHub username.
avatarUrlstring | nullGitHub avatar URL.
request
curl https://www.deplo.in/api/v1/auth/me \
  -H "Authorization: Bearer $DEPLO_TOKEN"
response · 200
{
  "userId": "cm5xa1b2c0001njk8w9d2f3g4",
  "email": "ada@example.com",
  "name": "Ada Lovelace",
  "githubLogin": "adalovelace",
  "avatarUrl": "https://avatars.githubusercontent.com/u/9919?v=4"
}
response · 401
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Unauthorized"
  }
}