Skip to main content
POST
/
instances
/
integrator
/
on-demand
Creating an instance
curl --request POST \
  --url https://api.z-api.io/instances/integrator/on-demand \
  --header 'Client-Token: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'

Overview

Method used to create an instance linked to your account.
You don’t necessarily need to subscribe now; you have 2 days for trial use. After 2 days without subscription, the instance is automatically deleted.
To use Partner endpoints, provide the Partner Token in the Authorization field using the following format: Bearer <Partner-Token>It is not necessary to send the Client-Token in these requests.

Attributes

Required

name
string
required
Instance name

Optional

sessionName
string
Session name on connected devices
deliveryCallbackUrl
string
Webhook URL for sent messages
receivedCallbackUrl
string
Webhook URL for received messages
receivedAndDeliveryCallbackUrl
string
Webhook URL for received and sent messages
presenceChatCallbackUrl
string
Webhook URL for chat presence status
disconnectedCallbackUrl
string
Webhook URL for disconnection
connectedCallbackUrl
string
Webhook URL for connection
messageStatusCallbackUrl
string
Webhook URL for message status
callRejectAuto
boolean
Automatically reject calls
callRejectMessage
string
Message when rejecting a call
autoReadMessage
boolean
Automatic message reading
autoReadStatus
boolean
Automatic status reading
isDevice
boolean
Mobile instance (true) or web (false)
businessDevice
boolean
WhatsApp Business version
disableEnqueueWhenDisconnected
boolean
Enable/disable queue when disconnected

Request Body

{
  "name": "My instance"
}

Response

200

{
  "id": "instanceId",
  "token": "instanceToken",
  "due": 1648565999675
}

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”.