---
title: "Annullamento dei messaggi in stato PENDING"
method: POST
path: "/api/messages/cancel/pending"
---

# Annullamento dei messaggi in stato PENDING

`POST /api/messages/cancel/pending`

Questo endpoint consente di annullare i messaggi in stato `PENDING` (non ancora inviati) associati al **cliente identificato tramite la propria API key**. Restituisce un elenco dei messaggi annullati, con l'ID e la data/ora in cui erano stati programmati per l'invio (`desired_date`). <Note>Se nessun messaggio è stato trovato in stato `PENDING`, il campo messages sarà una lista vuota.</Note> <Note>Il formato della `desired_date` è in **ISO_8601**.</Note> <Note>Se il campo `phones` **non viene incluso** nella richiesta, l'endpoint annullerà **tutti** i messaggi in stato `PENDING` per il cliente associato alla API key.</Note>

## Query parameters

- `api_key` string, required

## Request body

- object
  - `phones` string[] — I numeri di telefono di cui si vogliono annullare i messaggi in stato `PENDING`.

## Response `200`

OK

- object
  - `message` string — Messaggio del risultato.
  - `messages` object[]
    - `id` integer — ID del messaggio.
    - `desired_date` string, date-time — Data programmata per l'invio del messaggio.

## Changes

- **2025-07-18** `f62e0eae8af6` — 1 info
  - added optional request body
- **2025-07-18** `60c45e97d75f` — 1 info
  - endpoint added
- **2025-04-15** `919eb7a392aa` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/simplenetworks/apis/trilly-api/changes/api/messages/cancel/pending/post.md)

---

[API](https://skmtc.dev/simplenetworks/apis/trilly-api.md) · [All operations](https://skmtc.dev/simplenetworks/apis/trilly-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/simplenetworks/trilly-api/revisions/b03e55f0d8aa/schema)
