Skip to main content

Authentication APIs

The Authentication APIs allow you to generate temporary access tokens for use with all other BizzAssure APIs.

Generate Token​

Create a temporary access token using your API credentials.

Endpoint​

POST /v1/auth/token

Request​

Headers​

HeaderValue
Content-Typeapplication/json

Body​

{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"scopes": ["employee.get", "policy.list"]
}

Fields​

FieldTypeRequiredDescription
client_idstringYesYour API access key provided by BizzAssure
client_secretstringYesYour API secret access key provided by BizzAssure
scopesstring[]YesList of permission scopes to grant to the token (see Scopes below)

Scope names are case-insensitive and accept . as a separator (for example, employee.get and EMPLOYEE_GET are equivalent).

Available Scopes​

ScopeDescription
employee.getRead a single employee's profile
employee.createCreate new employees
employee.updateUpdate an existing employee
employee.allFull access to all employee operations
policy.getRead a single policy
policy.listList policies
policy.members.listList members of a policy
policy.allFull access to all policy operations

Response​

Success (200 OK)​

{
"payload": {
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"token_type": "Bearer"
}
}

Response Fields​

FieldTypeDescription
access_tokenstringJWT token to be included in the Authorization header
expires_innumberToken lifetime in seconds (always 3600)
token_typestringAlways "Bearer"

Error Responses​

Invalid Credentials (401 Unauthorized)​
{
"type": "A4001",
"title": "Invalid Authentication Credentials",
"detail": "The provided client_id or client_secret is invalid",
"instance": "/v1/auth/token"
}
Rate Limit Exceeded (429 Too Many Requests)​
{
"type": "A4290",
"title": "Rate Limit Exceeded",
"detail": "Too many token requests. Please try again in 60 seconds",
"instance": "/v1/auth/token"
}
Unexpected Error (500 Internal Server Error)​
{
"type": "E5000",
"title": "An unexpected error occurred",
"detail": "",
"instance": "/v1/auth/token"
}

Error Response Fields​

FieldTypeDescription
typestringError code (e.g., "A4001")
titlestringBrief error description
detailstringDetailed error message
instancestringAPI endpoint where error occurred

Using the Token​

Include the token in the Authorization header of all subsequent API requests:

Authorization: Bearer YOUR_TOKEN

Token Lifecycle​

  • Tokens are valid for 1 hour from the time of creation.
  • You can generate a new token at any time before expiry.
  • Tokens cannot be refreshed — generate a new one when it expires.
  • Each client is limited to 100 token generations per hour.

Security Best Practices​

  1. Store credentials securely — never hardcode client_id or client_secret in source code. Use environment variables or a secrets manager.
  2. Rotate credentials regularly — contact BizzAssure support to rotate your client_secret.
  3. Request only the scopes you need — follow the principle of least privilege when listing scopes.
  4. Never expose tokens client-side — tokens should only be used in server-to-server calls.