Generate Access Token

Generate an access token using OAuth 2.0 Client Credentials Flow. This is a standard OAuth 2.0 token endpoint for machine-to-machine authentication.

Request
Request Body schema: application/x-www-form-urlencoded

Request body for generating an OAuth access token using client credentials

grantType
required
string

OAuth 2.0 grant type (must be "client_credentials")

Value: "client_credentials"
clientId
required
string (OAuth Client ID) non-empty

The unique identifier for an OAuth client, automatically generated during client creation

clientSecret
required
string (OAuth Client Secret) non-empty

The secret key used for OAuth client authentication. This value is only returned upon client creation or secret rotation and should be stored securely.

scope
string

Optional space-separated list of scopes

Responses
200

Access token generated successfully

400

Bad request error

401

Unauthorized error

500

Internal server error

post/oauth/token
Request samples
curl -i -X POST \
  https://api-prod.surfsight.net/v2/oauth/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d grantType=client_credentials \
  -d clientId=abc123def456 \
  -d clientSecret=secret_abc123xyz789 \
  -d scope=all
Response samples
application/json
{
  • "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "tokenType": "Bearer",
  • "expiresIn": 14400,
  • "refreshExpiresIn": 0,
  • "notBeforePolicy": 0,
  • "scope": "all",
  • "requestId": "06327cae-e075-42ca-b620-c5cfdd3b4e37"
}