> ## Documentation Index
> Fetch the complete documentation index at: https://developer.omni.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Message actions

> Delete, forward, pin, and choose option, via the new API.

## Overview

Actions on a message already sent or received, in the new API, under `/v1/channels/{channelId}/messages/...`. **On the WhatsApp Web channel** (`Z_API_WHATSAPP`): delete, forward, pin/unpin, and choose option.

The `messageId` is the **Omni id** — the same one returned on send (`POST /messages`) and in the webhook.

> [!NOTE]
>
> On a Meta channel (`META_WHATSAPP`), each action responds `422` with the action's `subCode`: `DELETE_NOT_SUPPORTED`, `FORWARD_NOT_SUPPORTED`, `PIN_NOT_SUPPORTED` (also on unpin) or `CHOICE_NOT_SUPPORTED`. Handle the refusal by `subCode`: `message` is for reading and may change. The [capabilities](https://developer.omni.z-api.io/en/message-actions/capabilities.md) route responds `200` with an empty `operations`.

> [!NOTE]
>
> A disconnected channel is checked **before** the message: it responds `422` `CHANNEL_DISCONNECTED`, with the message of what was not done. The `404` `MESSAGE_NOT_FOUND` only appears with the channel connected. Every action (delete, forward, pin, unpin and choose option) may also respond:
>
> * `404` `MESSAGE_NOT_FOUND`: the message does not exist or belongs to another channel (the response is the same in both cases).
> * `422` `INSTANCE_NOT_PROVISIONED`: the channel's Z-API instance is not provisioned.
> * `422` `MESSAGE_WITHOUT_PROVIDER_ID`: the message has no WhatsApp id yet, for example because it was not delivered yet.
> * `422` `CHAT_NOT_SUPPORTED`: the message's chat is not a phone number of 8 to 15 digits, a group or an `@lid`.

## Common errors

Beyond the above, every message action may respond, on the **Omni API**:

* `401` when the credential is refused, and `403` `ip_not_allowed` when the IP is off the list. These also apply to the capabilities route.
* `404` `{"error": "instance not found"}` when the channel does not exist. This also applies to the capabilities route.
* `422` `{"error": "instance is not provisioned"}`, `{"error": "instance subscription is not active"}` or `{"error": "You are blocked, contact support."}` when the instance is not provisioned, the subscription is inactive or the workspace is blocked.
* `422` `{"error": "<Action> is not available for this channel right now. ..."}` when the service that runs the action does not serve the channel yet.
* `502` when the messaging service fails, with a fixed `error` per action: `Message deletion failed`, `Message forwarding failed`, `Message pinning failed`, `Message unpinning failed` or `Option choice failed`.

The capabilities route does not respond `422` or `502`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.