Get access token
POST
/v1/auth/login
const url = 'https://api-admin.billz.ai/v1/auth/login';const options = { method: 'POST', headers: { 'platform-id': '7d4a4c38-dd84-4902-b744-0488b80a4c01', 'Content-Type': 'application/json' }, body: '{"secret_token":"YOUR_SECRET_KEY"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-admin.billz.ai/v1/auth/login \ --header 'Content-Type: application/json' \ --header 'platform-id: 7d4a4c38-dd84-4902-b744-0488b80a4c01' \ --data '{ "secret_token": "YOUR_SECRET_KEY" }'Error codes: 400 — input validation error; 401, 403, 429, 500 — shared by all methods. Body formats and semantics: Response codes and errors.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”platform-id
string
Platform identifier. A static value is used for integrations.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
secret_token
required
Integration secret key. Empty string — 403
string
Example
{ "secret_token": "YOUR_SECRET_KEY"}Responses
Section titled “Responses”Successful response
Media typeapplication/json
object
code
Duplicates the HTTP status (200)
integer format: int32
message
‘ok’ on success
string
error
Null on success
integer format: int32
data
Access tokens
object
access_token
JWT access token for the Authorization: Bearer header
string
refresh_token
One-time refresh token for POST /v2/auth/refresh
string
token_type
Always Bearer
string
expires_in
Lifetime of access_token in seconds
integer format: int32
key
additional properties
any
Examplegenerated
{ "code": 1, "message": "example", "error": 1, "data": { "access_token": "example", "refresh_token": "example", "token_type": "example", "expires_in": 1 }}