Skip to content

OAuth 2.0 Client Credentials

Use the OAuth 2.0 Client Credentials flow to request an access token for server-to-server integrations. Include the token in the Authorization header for every API call.


  • Method: POST
  • Path: /oauth2/token

Full URLs

  • Test: https://auth-test.4exchange.app/oauth2/token
  • Production: https://auth.4exchange.app/oauth2/token
  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json
  • grant_type: client_credentials
  • client_id: your assigned client ID
  • client_secret: your assigned client secret
  • scope: space-separated scopes (see below)

Depending on your tenant’s configuration, the following scopes may be available:

  • 4Exchange/receive
  • 4Exchange/send
  • 4Exchange/participant
  • 4Exchange/webhook

Provide one or multiple, separated by a space, e.g.: 4Exchange/receive 4Exchange/send.

  • 200 OK
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6...",
  "token_type": "Bearer",
  "expires_in": 3600
}
  • 401 Bad Request
{
    "error": "invalid_client"
}
  • 400 Bad Request
{
    "error": "invalid_scope"
}
  • 400 Bad Request
{
    "error": "unsupported_grant_type"
}

Example: using Content-Type: multipart/form-data

  • 405 Method Not Allowed
  • Reuse the token until it expires (expires_in). Request a new token when needed.
  • Send scopes as a single, space-separated string. If only one scope is granted, include just that