Auth: Get Access and Refresh Tokens

To interact with the 8B API, you must first obtain an access token by submitting your login and password to the dedicated endpoint. This page outlines the request format, response structure, and common error codes.

πŸ”—

API Reference: Create Token


Overview

Authentication in the 8B API is based on a token system. It follows the OAuth 2.0 framework, specifically the Resource Owner Password Credentials grant type, where tokens are issued in exchange for company credentials. When you log in using your company credentials, the API returns two tokens:

Token TypeDescriptionValidity
Access TokenUsed in the Authorization header for authenticating API calls30 minutes
Refresh TokenUsed to obtain a new access token when the current one expires10 hours

How It Works

  1. Send a POST request to /api/v1/admin-accounts/oauth/authorize with your login and password.
  2. Receive both access and refresh tokens in the response body.
  3. Use the access token in the Authorization: Bearer YOUR_TOKEN header for all authenticated API requests.