Skip to main content
POST
Get a PACT token
Unless you have a public API, you will need to authenticate your requests to the PACT API. This is done using the OAuth 2.0 client credentials flow.
The token works on both PACT v2 and v3. A PACT client takes two URLs:
  • Base URL: https://your_subdomain.variable.global/api/pact
  • Auth base URL: https://your_subdomain.variable.global/api/pact/3
The client finds the token endpoint through OpenID discovery at the auth base URL, /api/pact/3/.well-known/openid-configuration, which names /api/pact/3/auth/token. The base URL has no token endpoint of its own, so a client that only takes one URL can’t get a token there. A PACT v2 client can use /api/pact/2/auth/token, which returns the same token.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/x-www-form-urlencoded
grant_type
string
required

client_credentials

Example:

"client_credentials"

Response

A token

access_token
string
refresh_token
string
token_type
string
scope
string