Reference

Oauth token

Redeems a code with its verifier, or a refresh token, for a new pair of tokens.

POST
/oauth/token

Request Body

application/json
  1. body
grant_type*"authorization_code"
Value in"authorization_code"
client_id*"skywake-desktop"
Value in"skywake-desktop"
code*string
Length1 <= length <= 200
code_verifier*string
Match^[A-Za-z0-9._~-]{43,128}$
redirect_uri*string
Match^http:\/\/127\.0\.0\.1:(\d{2,5})\/callback$

Response Body

The tokens.

application/json
  1. response
access_token*string

An API key that works for expires_in seconds.

token_type*"Bearer"
Value in"Bearer"
expires_in*integer
refresh_token*string

Makes the next pair, once. Using it twice ends the sign-in.

organization*
organizations*array<>

Every organization of the person, to switch to by signing in again.

environment*string|null
role*Role

What a caller may do. read: files and history. write: also fork, commit and merge. admin: also keys, namespaces, protected branches and the audit log.

Value in"read""write""admin"
email*string|null
Example Request
curl -X POST 'https://example.com/v1/oauth/token' \  -H 'Content-Type: application/json' \  -d '{  "grant_type": "authorization_code",  "client_id": "skywake-desktop",  "code": "string",  "code_verifier": "string",  "redirect_uri": "string"}'
Example Response
{  "access_token": "string",  "token_type": "Bearer",  "expires_in": 0,  "refresh_token": "string",  "organization": {    "id": "string",    "name": "string"  },  "organizations": [    {      "id": "string",      "name": "string"    }  ],  "environment": "string",  "role": "read",  "email": "string"}