Enviar teste
curl --request POST \
--url https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar', 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.gestio.com.br/v2/webhooks/{idEndpoint}/testar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.gestio.com.br/v2/webhooks/{idEndpoint}/testar")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"idEntrega": "5c9e2d4a-1b3f-4e6a-8d7c-0f9e8d7c6b5a",
"idEndpoint": "8d1f6c2a-3b4e-4a5f-9e6d-7c8b9a0f1e2d",
"tipoDoEvento": "compras.pedido-de-compra.processado",
"url": "https://integracao.suaempresa.com.br/webhooks/gestio",
"situacao": "Entregue",
"tentativas": 1,
"ultimoStatusHttp": 200,
"ultimoErro": null,
"duracaoUltimaTentativaMs": 412,
"ultimaTentativaEm": "2026-11-06T14:30:00",
"proximaTentativaEm": null,
"criadoEm": "2026-11-06T14:30:00",
"entregueEm": "2026-11-06T14:30:00",
"envelope": "{\"id\":\"5c9e2d4a-1b3f-4e6a-8d7c-0f9e8d7c6b5a\",\"tipo\":\"compras.pedido-de-compra.processado\",\"versao\":1,\"ocorridoEm\":\"2026-11-06T14:30:00Z\",\"teste\":true,\"dados\":{\"numeroDoPedido\":999999,\"sequencia\":1,\"codigoDaFilial\":1,\"fornecedor\":{\"codigo\":999999,\"nome\":\"Fornecedor de Teste\"},\"valorTotal\":1500.0,\"dataDeEmissao\":\"2026-11-06T14:30:00Z\",\"situacao\":\"F\",\"codigoDoUsuario\":\"usuario.teste\",\"quantidadeDeItens\":2}}"
}
]
}{
"success": false,
"errors": [
{
"key": null,
"value": "A URL do webhook deve ser uma URL https válida.",
"dateOccurred": "2026-11-06T14:00:00"
}
]
}Webhooks
Enviar teste
Cria e envia um log de teste para cada evento assinado pelo webhook, com o código real do evento e um payload de exemplo com dados fictícios. O envio é síncrono (acontece dentro da requisição, sem passar pela fila) e a resposta já traz cada log com o resultado.
O envelope de teste tem o campo teste: true. O teste funciona mesmo com o webhook inativo, é tentado uma única vez e não altera falhasConsecutivas nem a desativação automática.
POST
/
v2
/
webhooks
/
{idEndpoint}
/
testar
Enviar teste
curl --request POST \
--url https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar', 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.gestio.com.br/v2/webhooks/{idEndpoint}/testar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.gestio.com.br/v2/webhooks/{idEndpoint}/testar")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gestio.com.br/v2/webhooks/{idEndpoint}/testar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"idEntrega": "5c9e2d4a-1b3f-4e6a-8d7c-0f9e8d7c6b5a",
"idEndpoint": "8d1f6c2a-3b4e-4a5f-9e6d-7c8b9a0f1e2d",
"tipoDoEvento": "compras.pedido-de-compra.processado",
"url": "https://integracao.suaempresa.com.br/webhooks/gestio",
"situacao": "Entregue",
"tentativas": 1,
"ultimoStatusHttp": 200,
"ultimoErro": null,
"duracaoUltimaTentativaMs": 412,
"ultimaTentativaEm": "2026-11-06T14:30:00",
"proximaTentativaEm": null,
"criadoEm": "2026-11-06T14:30:00",
"entregueEm": "2026-11-06T14:30:00",
"envelope": "{\"id\":\"5c9e2d4a-1b3f-4e6a-8d7c-0f9e8d7c6b5a\",\"tipo\":\"compras.pedido-de-compra.processado\",\"versao\":1,\"ocorridoEm\":\"2026-11-06T14:30:00Z\",\"teste\":true,\"dados\":{\"numeroDoPedido\":999999,\"sequencia\":1,\"codigoDaFilial\":1,\"fornecedor\":{\"codigo\":999999,\"nome\":\"Fornecedor de Teste\"},\"valorTotal\":1500.0,\"dataDeEmissao\":\"2026-11-06T14:30:00Z\",\"situacao\":\"F\",\"codigoDoUsuario\":\"usuario.teste\",\"quantidadeDeItens\":2}}"
}
]
}{
"success": false,
"errors": [
{
"key": null,
"value": "A URL do webhook deve ser uma URL https válida.",
"dateOccurred": "2026-11-06T14:00:00"
}
]
}