Request Device Code

Changed on

Request a device code to start the device authorization flow.

post/oauth/device/code

Request

  • Base URL
    https://api.dashboard.knotapi.com
  • URL
    https://api.dashboard.knotapi.com/oauth/device/code
  • Auth
    none required

Request body application/x-www-form-urlencoded

client_idstring required

Your client ID for the environment you want to manage, found in the Knot Dashboard. Never send your secret.

scopestring required

Space-delimited list of scopes to request. At least one is required.

Example request

{
  "client_id": "9f3c2a1e-6b7d-4e8f-a2c4-5d6e7f8a9b0c",
  "scope": "webhooks:read webhooks:write"
}

Response

Successful request.

device_codestring

Code to exchange for an access token. Do not show it to the user.

user_codestring

Code for the user to enter in the Knot Dashboard. Eight letters; a hyphen is optional.

verification_uristring

URL where the user approves the request.

verification_uri_completestring

The verification_uri with the user_code. The approval page still asks the user to enter the code.

expires_ininteger

Seconds until the device_code and user_code expire.

intervalinteger

Minimum seconds to wait between polling requests.

Example response

{
  "device_code": "def50200a1b2c3d4e5f6",
  "user_code": "WDJBMJHT",
  "verification_uri": "https://api.dashboard.knotapi.com/oauth/device",
  "verification_uri_complete": "https://api.dashboard.knotapi.com/oauth/device?user_code=WDJBMJHT",
  "expires_in": 600,
  "interval": 5
}

Changes