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:
| Step | What to do |
|---|---|
| 1 | Sign in at deplo.in with GitHub (this is the only OAuth step you ever perform manually). |
| 2 | Create a CLI token in Settings — or via POST /cli-tokens if you already hold a token. |
| 3 | Send it as Authorization: Bearer dpl_… on every request. CLI tokens never expire; revoke them any time. |
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.
HTTP/1.1 302 Found
Location: https://github.com/login/oauth/authorize?client_id=…&redirect_uri=…&scope=read%3Auser+user%3Aemail+repo+admin%3Arepo_hookSystem 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#
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.
| Field | Type | Description |
|---|---|---|
| userId | string | The user's id (cuid). |
| string | Primary email from GitHub. | |
| name | string | Display name. |
| githubLogin | string | GitHub username. |
| avatarUrl | string | null | GitHub avatar URL. |
curl https://www.deplo.in/api/v1/auth/me \
-H "Authorization: Bearer $DEPLO_TOKEN"{
"userId": "cm5xa1b2c0001njk8w9d2f3g4",
"email": "ada@example.com",
"name": "Ada Lovelace",
"githubLogin": "adalovelace",
"avatarUrl": "https://avatars.githubusercontent.com/u/9919?v=4"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}