Retrieve a token#

Description#

Include the client_id and client_secret in the body of the request as form encoded parameters.

POST /oauth2/token

Parameters#

Parameter

In

Type

Required

Description

X-Version

header

string

true

Version of the API (2026-09-01.grc.preview)

client_id

body

string

false

A previously obtained client id.

client_secret

body

string

false

A previously obtained client secret.

grant_type

body

string

true

The grant type for the Bearer token. Must be client_credentials.

scope

body

string

false

The scope of the access request.

Enumerated Values#

Parameter

Value

grant_type

client_credentials

Body parameter example#

client_id: string
client_secret: string
grant_type: client_credentials
scope: string

Code Samples#

curl -X POST https://api.app.wdesk.com/oauth2/token \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -H 'Accept: application/json' \
    -H 'X-Version: 2026-09-01.grc.preview'
http POST https://api.app.wdesk.com/oauth2/token \
    X-Version:2026-09-01.grc.preview \
    Content-Type:application/x-www-form-urlencoded \
    Accept:application/json
wget --method=POST "https://api.app.wdesk.com/oauth2/token" \
    --output-document - \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --header 'Accept: application/json' \
    --header 'X-Version: 2026-09-01.grc.preview'
import requests

headers = {
  'X-Version': '2026-09-01.grc.preview',
  'Content-Type': 'application/x-www-form-urlencoded',
  'Accept': 'application/json'
}

r = requests.post('https://api.app.wdesk.com/oauth2/token', headers = headers)

print(r.json())

Returns#

200 - OK#

Bearer token to use in subsequent requests to the Workiva APIs.

400 - Bad Request#

Error response object containing an error code.

401 - Unauthorized#

Error response object containing an error code.

Example Responses#

{
  "access_token": "string",
  "expires_in": 0,
  "scope": "string",
  "token_type": "string"
}