Skip to Content
Developers @ LaunchGood
Authentication

Get an access token

POST
/oauth/token

OAuth 2.0 client-credentials grant (RFC 6749 section 4.4), the only grant. Send the request as a form (application/x-www-form-urlencoded) or as JSON. Authenticate with HTTP Basic (Authorization: Basic base64(client_id:client_secret), RFC 6749 section 2.3.1) or with client_id and client_secret in the body, never both and never in a URL. The response carries Cache-Control: no-store. The endpoint is behind a feature flag (api-gateway-oauth-token, default off): while it is off every request is a 501 and nothing is checked or issued. A 400 or 401 is not a Problem: it is the RFC 6749 section 5.2 body, application/json with error and error_description. A bad secret, an unknown client and an inactive client are the same 401 invalid_client. Brute-force limits, per minute: 10 attempts per client_id that do not authenticate it, after which each address is still given one checked attempt (the right secret gets its token; a wrong one is a 429), and 30 requests per address; past a limit, 429 with Retry-After.

Request Body

  1. body
grant_type*"client_credentials"
Value in"client_credentials"
client_id?string

The integration client id. Required unless the client authenticates with HTTP Basic; with Basic it may be repeated here, and must then match.

Length1 <= length <= 255
client_secret?string

The integration client secret. Required unless the client authenticates with HTTP Basic, in which case it must not be sent here. Never sent in a URL.

Formatpassword
Length1 <= length <= 512
scope?string

Space-delimited scopes to request. Omit it for every scope the client holds. See the scope patterns on the security scheme.

Lengthlength <= 2000

Response Body

The access token.

application/json
  1. response
access_token*string

Send as Authorization: Bearer <access_token>.

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

Seconds until the token expires.

scope*string

Space-delimited scopes the token carries.

Example Request
curl -X POST 'https://api2.launchgood.com/oauth/token' \  -H 'Content-Type: application/json' \  -d '{  "grant_type": "client_credentials"}'
Example Response
{  "access_token": "string",  "token_type": "Bearer",  "expires_in": 3600,  "scope": "organization:org_123:account:acc_456:viewer"}