POST /teams/{teamId}/integrations/{id}/webhooks
Cria webhook de saida (out) ou segredo de entrada (in)
- Acesso: Membro da equipe
- Serviço:
https://api.axuz.net
Autenticação aceita
sessionCookie— Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.bearerSession— JWT de acesso da sessão em `Authorization: Bearer`.
out: url https + events obrigatorios (SSRF validado no cadastro e de novo no envio). in: sem url/events; o segredo e o que o bot usa para ASSINAR as chamadas a POST /integrations/inbound/{webhookId}. Max 10 por integracao (422 limit_exceeded). Segredo mostrado UMA vez.
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
teamId | path | string | sim | |
id | path | string | sim |
Corpo da requisição
application/json · Obrigatório
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
direction | string | sim | enum: |
url | string<uri> | não | |
events | array<string> | não | |
channel_ids | array<string<uuid>> | não | Canais privados/DM do time que o webhook pode receber. So direction=out. |
{
"direction": "out",
"url": "https://example.test/",
"events": [
"task.created"
],
"channel_ids": [
"00000000-0000-0000-0000-000000000000"
]
}Respostas
201
Criado
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string<uuid> | sim | |
integration_id | string<uuid> | sim | |
direction | string | sim | enum: |
url | string<uri> | não | So direction=out; https. |
events | array<string> | sim | |
channel_ids | array<string<uuid>> | não | Canais privados/DM autorizados (default vazio = so publicos). |
active | boolean | sim | |
secret_version | integer | sim | |
created_at | string<date-time> | sim | |
updated_at | string<date-time> | sim | |
secret_rotated_at | string<date-time> | não | |
secret | string | sim | whsec_*. MOSTRADO UMA VEZ; guardado cifrado. |
400
Corpo/parametro invalido (invalid, invalid_body, invalid_cursor...)
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
401
Sem credencial valida
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
403
Sem permissao (nao e owner/admin; token sem escopo; token de integracao em rota nao permitida)
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
404
Nao existe NESTE time (404 uniforme: nao vaza existencia entre times)
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
422
Limite de webhooks
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
429
Limite de requisições excedido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
503
Sem chave mestra (segredo nunca em claro) — secret_encryption_unavailable
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
curl
curl -sS -X POST 'https://api.axuz.net/teams/TEAM_ID/integrations/ID/webhooks' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"direction":"out","url":"https://example.test/","events":["task.created"],"channel_ids":["00000000-0000-0000-0000-000000000000"]}'Node.js
const res = await fetch("https://api.axuz.net/teams/TEAM_ID/integrations/ID/webhooks", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"direction": "out",
"url": "https://example.test/",
"events": [
"task.created"
],
"channel_ids": [
"00000000-0000-0000-0000-000000000000"
]
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"POST",
"https://api.axuz.net/teams/TEAM_ID/integrations/ID/webhooks",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"direction": "out",
"url": "https://example.test/",
"events": [
"task.created",
],
"channel_ids": [
"00000000-0000-0000-0000-000000000000",
],
},
timeout=30,
)
res.raise_for_status()
print(res.json())