curl --request POST \
--url https://api.zapsterapi.com/v1/wa/instances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_type": "unofficial",
"name": "Bot SDR",
"lookup_key": "ins_8j7wlxmpjlixx9mux5",
"metadata": {
"customer_id": "123456",
"customer_name": "Joãozinho",
"phone_number": "+5587989075555"
},
"settings": {
"delay_per_word": true,
"delete_chat_after_sent": true,
"message_delay": {
"enabled": true,
"max": 10,
"min": 1
}
}
}
'import requests
url = "https://api.zapsterapi.com/v1/wa/instances"
payload = {
"connection_type": "unofficial",
"name": "Bot SDR",
"lookup_key": "ins_8j7wlxmpjlixx9mux5",
"metadata": {
"customer_id": "123456",
"customer_name": "Joãozinho",
"phone_number": "+5587989075555"
},
"settings": {
"delay_per_word": True,
"delete_chat_after_sent": True,
"message_delay": {
"enabled": True,
"max": 10,
"min": 1
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_type: 'unofficial',
name: 'Bot SDR',
lookup_key: 'ins_8j7wlxmpjlixx9mux5',
metadata: {
customer_id: '123456',
customer_name: 'Joãozinho',
phone_number: '+5587989075555'
},
settings: {
delay_per_word: true,
delete_chat_after_sent: true,
message_delay: {enabled: true, max: 10, min: 1}
}
})
};
fetch('https://api.zapsterapi.com/v1/wa/instances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zapsterapi.com/v1/wa/instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_type' => 'unofficial',
'name' => 'Bot SDR',
'lookup_key' => 'ins_8j7wlxmpjlixx9mux5',
'metadata' => [
'customer_id' => '123456',
'customer_name' => 'Joãozinho',
'phone_number' => '+5587989075555'
],
'settings' => [
'delay_per_word' => true,
'delete_chat_after_sent' => true,
'message_delay' => [
'enabled' => true,
'max' => 10,
'min' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zapsterapi.com/v1/wa/instances"
payload := strings.NewReader("{\n \"connection_type\": \"unofficial\",\n \"name\": \"Bot SDR\",\n \"lookup_key\": \"ins_8j7wlxmpjlixx9mux5\",\n \"metadata\": {\n \"customer_id\": \"123456\",\n \"customer_name\": \"Joãozinho\",\n \"phone_number\": \"+5587989075555\"\n },\n \"settings\": {\n \"delay_per_word\": true,\n \"delete_chat_after_sent\": true,\n \"message_delay\": {\n \"enabled\": true,\n \"max\": 10,\n \"min\": 1\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zapsterapi.com/v1/wa/instances")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_type\": \"unofficial\",\n \"name\": \"Bot SDR\",\n \"lookup_key\": \"ins_8j7wlxmpjlixx9mux5\",\n \"metadata\": {\n \"customer_id\": \"123456\",\n \"customer_name\": \"Joãozinho\",\n \"phone_number\": \"+5587989075555\"\n },\n \"settings\": {\n \"delay_per_word\": true,\n \"delete_chat_after_sent\": true,\n \"message_delay\": {\n \"enabled\": true,\n \"max\": 10,\n \"min\": 1\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapsterapi.com/v1/wa/instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_type\": \"unofficial\",\n \"name\": \"Bot SDR\",\n \"lookup_key\": \"ins_8j7wlxmpjlixx9mux5\",\n \"metadata\": {\n \"customer_id\": \"123456\",\n \"customer_name\": \"Joãozinho\",\n \"phone_number\": \"+5587989075555\"\n },\n \"settings\": {\n \"delay_per_word\": true,\n \"delete_chat_after_sent\": true,\n \"message_delay\": {\n \"enabled\": true,\n \"max\": 10,\n \"min\": 1\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2024-10-03T21:56:22.620Z",
"id": "xy9rexnkwobmgg3tehgvs",
"metadata": {
"customer_id": "123456",
"customer_name": "Joãozinho",
"phone_number": "+5587989075555"
},
"name": "MyNewInstance2",
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": null
},
"settings": {
"call_rejection": "all",
"delay_per_word": true,
"delete_chat_after_sent": true,
"message_delay": {
"enabled": true,
"max": 10,
"min": 1
},
"presence_behavior": "only_composing",
"read_confirmation": "never"
},
"status": "disconnected",
"webhooks": [
{
"enabled": true,
"events": [
"message.received"
],
"id": "2nenz69l0xbf0m3uu9tfo",
"name": "Webhook Name",
"test_mode": false,
"url": "https://webhook.mydomain.com",
"test_url": null
}
],
"connection_type": "unofficial",
"qrcode": null,
"lookup_key": "ins_8j7wlxmpjlixx9mux5"
}Criando Instância
curl --request POST \
--url https://api.zapsterapi.com/v1/wa/instances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_type": "unofficial",
"name": "Bot SDR",
"lookup_key": "ins_8j7wlxmpjlixx9mux5",
"metadata": {
"customer_id": "123456",
"customer_name": "Joãozinho",
"phone_number": "+5587989075555"
},
"settings": {
"delay_per_word": true,
"delete_chat_after_sent": true,
"message_delay": {
"enabled": true,
"max": 10,
"min": 1
}
}
}
'import requests
url = "https://api.zapsterapi.com/v1/wa/instances"
payload = {
"connection_type": "unofficial",
"name": "Bot SDR",
"lookup_key": "ins_8j7wlxmpjlixx9mux5",
"metadata": {
"customer_id": "123456",
"customer_name": "Joãozinho",
"phone_number": "+5587989075555"
},
"settings": {
"delay_per_word": True,
"delete_chat_after_sent": True,
"message_delay": {
"enabled": True,
"max": 10,
"min": 1
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_type: 'unofficial',
name: 'Bot SDR',
lookup_key: 'ins_8j7wlxmpjlixx9mux5',
metadata: {
customer_id: '123456',
customer_name: 'Joãozinho',
phone_number: '+5587989075555'
},
settings: {
delay_per_word: true,
delete_chat_after_sent: true,
message_delay: {enabled: true, max: 10, min: 1}
}
})
};
fetch('https://api.zapsterapi.com/v1/wa/instances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zapsterapi.com/v1/wa/instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_type' => 'unofficial',
'name' => 'Bot SDR',
'lookup_key' => 'ins_8j7wlxmpjlixx9mux5',
'metadata' => [
'customer_id' => '123456',
'customer_name' => 'Joãozinho',
'phone_number' => '+5587989075555'
],
'settings' => [
'delay_per_word' => true,
'delete_chat_after_sent' => true,
'message_delay' => [
'enabled' => true,
'max' => 10,
'min' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zapsterapi.com/v1/wa/instances"
payload := strings.NewReader("{\n \"connection_type\": \"unofficial\",\n \"name\": \"Bot SDR\",\n \"lookup_key\": \"ins_8j7wlxmpjlixx9mux5\",\n \"metadata\": {\n \"customer_id\": \"123456\",\n \"customer_name\": \"Joãozinho\",\n \"phone_number\": \"+5587989075555\"\n },\n \"settings\": {\n \"delay_per_word\": true,\n \"delete_chat_after_sent\": true,\n \"message_delay\": {\n \"enabled\": true,\n \"max\": 10,\n \"min\": 1\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zapsterapi.com/v1/wa/instances")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_type\": \"unofficial\",\n \"name\": \"Bot SDR\",\n \"lookup_key\": \"ins_8j7wlxmpjlixx9mux5\",\n \"metadata\": {\n \"customer_id\": \"123456\",\n \"customer_name\": \"Joãozinho\",\n \"phone_number\": \"+5587989075555\"\n },\n \"settings\": {\n \"delay_per_word\": true,\n \"delete_chat_after_sent\": true,\n \"message_delay\": {\n \"enabled\": true,\n \"max\": 10,\n \"min\": 1\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapsterapi.com/v1/wa/instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_type\": \"unofficial\",\n \"name\": \"Bot SDR\",\n \"lookup_key\": \"ins_8j7wlxmpjlixx9mux5\",\n \"metadata\": {\n \"customer_id\": \"123456\",\n \"customer_name\": \"Joãozinho\",\n \"phone_number\": \"+5587989075555\"\n },\n \"settings\": {\n \"delay_per_word\": true,\n \"delete_chat_after_sent\": true,\n \"message_delay\": {\n \"enabled\": true,\n \"max\": 10,\n \"min\": 1\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2024-10-03T21:56:22.620Z",
"id": "xy9rexnkwobmgg3tehgvs",
"metadata": {
"customer_id": "123456",
"customer_name": "Joãozinho",
"phone_number": "+5587989075555"
},
"name": "MyNewInstance2",
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": null
},
"settings": {
"call_rejection": "all",
"delay_per_word": true,
"delete_chat_after_sent": true,
"message_delay": {
"enabled": true,
"max": 10,
"min": 1
},
"presence_behavior": "only_composing",
"read_confirmation": "never"
},
"status": "disconnected",
"webhooks": [
{
"enabled": true,
"events": [
"message.received"
],
"id": "2nenz69l0xbf0m3uu9tfo",
"name": "Webhook Name",
"test_mode": false,
"url": "https://webhook.mydomain.com",
"test_url": null
}
],
"connection_type": "unofficial",
"qrcode": null,
"lookup_key": "ins_8j7wlxmpjlixx9mux5"
}- Não oficial (
connection_type: "unofficial"): o padrão. Depois de criar, você conecta via QR code ou código de pareamento. - Oficial WABA (
connection_type: "waba"): usa a API oficial da Meta. Você precisa fornecer as credenciais no objetowaba.
- Embedded Signup (recomendado): fluxo OAuth pelo dashboard, sem precisar mexer no Meta Business Manager. Veja o guia passo a passo.
- Token manual: você gera um System User Token no Meta Business Manager e passa direto na API. Veja o método avançado.
connection_type é waba, o objeto waba com access_token, phone_number_id e waba_id é obrigatório. Para instâncias não oficiais, esse campo é ignorado.Autorizações
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corpo
Tipo de conexão da instância:
unofficial(padrão): conexão via QR code ou código de pareamentowaba: conexão via API oficial do WhatsApp (Cloud API da Meta)
Quando waba é selecionado, o objeto waba com as credenciais é obrigatório.
unofficial, waba "unofficial"
Credenciais para conexão com a API oficial do WhatsApp (Cloud API da Meta).
Obrigatório quando connection_type é waba. Ignorado para instâncias não oficiais.
Show child attributes
Show child attributes
Um apelido opcional para sua instância, usado apenas para sua organização.
64"Bot SDR"
Um identificador único opcional de pesquisa que permite associar sua instância a uma estrutura de dados específica. A Zapster API não utiliza esse dado internamente; ele serve exclusivamente para facilitar consultas na API, permitindo localizar registros mais rapidamente por meio deste parâmetro de pesquisa.
36"ins_8j7wlxmpjlixx9mux5"
Um conjunto de informações adicionais armazenadas como chave e valor. Cada chave é um texto e o valor pode ser um número ou um texto. Esse campo é opcional e pode ser usado para guardar detalhes personalizados.
Para números de telefone, use o formato E.164 (ex: +5587989075555). O sistema validará e formatará automaticamente o número, removendo espaços e hífens.
Show child attributes
Show child attributes
{
"customer_id": "123456",
"customer_name": "Joãozinho",
"phone_number": "+5587989075555"
}
Objeto opcional de configurações da sua instância.
Show child attributes
Show child attributes
Lista de webhooks serão criados assim que a instância finalizar sua criação. Atente-se para a quantidade de webhooks nesta lista, a mesma é baseada no seu plano contratado.
Show child attributes
Show child attributes
Resposta
Success
Estrutura de uma instância registrada na API.
Data e hora de criação da instância no formato ISO 8601.
"2024-10-03T21:56:22.620Z"
Identificador único da instância.
"xy9rexnkwobmgg3tehgvs"
Metadados adicionais armazenados como chave e valor.
Show child attributes
Show child attributes
{
"customer_id": "123456",
"customer_name": "Joãozinho",
"phone_number": "+5587989075555"
}
Nome da instância.
"MyNewInstance2"
Informações sobre o proprietário da instância.
Show child attributes
Show child attributes
Objeto opcional de configurações da sua instância.
Show child attributes
Show child attributes
Status atual da instância
connected, disconnected, offline "disconnected"
Lista de webhooks configurados para esta instância.
Show child attributes
Show child attributes
Tipo de conexão da instância:
unofficial: conexão via QR code (padrão)waba: conexão via API oficial do WhatsApp (Cloud API da Meta)
unofficial, waba "unofficial"
QR Code da instância, caso disponível.
null
Identificador de pesquisa criado anteriormente.
"ins_8j7wlxmpjlixx9mux5"