Reference

Create o auth code

Approves a desktop app's sign-in for the person in the console: a code, good once for a minute, that only the app's PKCE verifier redeems.

POST
/oauth/codes

Authorization

bearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
client_id*"skywake-desktop"
Value in"skywake-desktop"
redirect_uri*string
Match^http:\/\/127\.0\.0\.1:(\d{2,5})\/callback$
code_challenge*string

BASE64URL(SHA-256(code_verifier)), without padding.

Match^[A-Za-z0-9_-]{43}$
code_challenge_method*"S256"
Value in"S256"
device*string
Length1 <= length <= 64
environment*|

The environment the app works in. Null for every one: organization admins only.

Match^[A-Za-z0-9_-][A-Za-z0-9._-]{0,99}$
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"

Response Body

The code.

application/json
  1. response
code*string
expires*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/v1/oauth/codes' \  -H 'Content-Type: application/json' \  -d '{  "client_id": "skywake-desktop",  "redirect_uri": "string",  "code_challenge": "string",  "code_challenge_method": "S256",  "device": "string",  "environment": "string",  "role": "read"}'
Example Response
{  "code": "string",  "expires": "2019-08-24T14:15:22Z"}