Generate Token

Generate Token

To interact with Accountability's API, you must first authenticate using the Generate Token endpoint. This endpoint issues authentication tokens that are required for all subsequent API requests.

🔐 Authentication Overview

The Generate Token request requires you to provide specific credentials to receive an access token and a refresh token. The type of credentials depends on the grant_type you're using.

Required Parameters

ParameterDescription
grant_typeDefines the authentication method. Use 'password' to authenticate with your credentials, or 'refresh_token' to obtain a new access token using a previously issued refresh token.
usernameYour login email address. Required when grant_type is 'password'.
passwordThis the API token associated with your Accountability user account.
tenantidYour unique Tenant ID. Submit a support ticket in the Accountability system if you need help locating this. Required when grant_type is 'password'.
refresh_tokenRequired only when using the 'refresh_token' grant type. Used to obtain a new access token after expiration.

⚠️

When using grant_type=refresh_token, you only need to supply the refresh_token parameter. Username, password, and tenant ID are not required.


🔄 Token Lifespan

  • Access Token: Valid for 3600 seconds (1 hour).
  • Refresh Token: Valid for up to 30 days.

✅ Using the Tokens

Once authenticated, use the access_token in the Authorization header for all API requests:

Authorization: Bearer your_access_token

When the access token expires, use the refresh_token to request a new one without re-authenticating with username and password.


🚨 Important

You must authenticate first before accessing any other endpoints. The access token or a valid refresh token is required to make authorized API requests.

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!