DELETE /api/whatsapp/subscriptions/{id}
Remove subscription; limpa cache em `users` se foi a última.
- Access: Signed in
- Service:
https://messaging-api.axuz.net
Accepted authentication
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`.
Remove uma subscription; limpa cache em users se última.
Motivo: dispatch de reminders consulta users.whatsapp_phone_e164 direto; se a última subscription vai embora, o cache tem que zerar pra evitar envio pra número órfão. Comportamento: parse UUID; TX; DELETE por (id, user_id) — 404 se não afetar linha; COUNT das opted_in restantes; se zero, UPDATE users limpando cache; commit; 200 {"deleted": true}.
Entradas: URLParam id.
Retorno: 200; 400/404/500.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Responses
200
Deletada.
| Name | Type | Required | Description |
|---|---|---|---|
deleted | boolean | yes | enum: |
400
Body inválido ou parâmetro fora do esperado.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
401
Falta cookie/bearer ou X-Axuz-Internal.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
404
Recurso não existe (ou não pertence ao user).
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
Examples
"Try it" is turned off in this reference. Use the examples with your test credential.
curl
curl -sS -X DELETE 'https://messaging-api.axuz.net/api/whatsapp/subscriptions/ID' \
-H "Authorization: Bearer $AXUZ_TOKEN"Node.js
const res = await fetch("https://messaging-api.axuz.net/api/whatsapp/subscriptions/ID", {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
},
});
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(
"DELETE",
"https://messaging-api.axuz.net/api/whatsapp/subscriptions/ID",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())