Skip to main content
GET
/
instances
/
{instanceId}
/
token
/
{token}
/
extension-token
Generate extension token
curl --request GET \
  --url https://api.z-api.io/instances/{instanceId}/token/{token}/extension-token \
  --header 'Client-Token: <api-key>'
{
  "token": "<string>",
  "expiresAt": 123
}

Overview

This method generates an access token to authenticate the Z-API extension. The returned token must be inserted directly into the extension and has a defined expiration date.
The token is valid for up to 5 minutes. After that, a new one must be generated.

Attributes

instanceId
string
required
Your instance ID. Available in the Z-API panel under Instances.
token
string
required
Your Z-API instance token.

Response

200

token
string
Access token to be inserted into the extension
expiresAt
number
Unix timestamp (in milliseconds) with the token expiration date
{
  "token": "FA48-HS63",
  "expiresAt": 1782851138085
}

405

Make sure you are correctly sending the method specification, that is, verify that you sent POST or GET as specified at the beginning of this topic.

415

If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.