# Ban conversation customer

**POST** `/conversations/{id}:ban`

Sets the ban's terms: `expiresAt` and `reason` replace any earlier ones, and omitting them
makes the ban permanent without a reason. Returns the updated conversation.

The ban applies to this conversation's customer identity in this inbox only; the same
person on another channel or number isn't banned.

While the customer is banned, their messages, reactions, history imports and edits or
deletions of earlier messages are discarded without being stored. Content stored before
the ban stays. The channel isn't told: on WhatsApp the customer can still write to the
number, and blocking them there is manual. Sending or reacting to the conversation returns
`422` with code `messaging_customer_banned`; a message accepted earlier, a reply from a
connected help-desk app or a send by phone number or channel ID fails with `failureCode`
`customer_banned`.

`expiresAt` ends the ban at that time and must be in the future
(`400 messaging_conversation_ban_expiry_invalid`); without it the ban lasts until the
customer is unbanned. Once a ban expires the conversation reads as not banned and messages
flow again; no conversation change is published at that moment. `reason` is an optional
note, trimmed, of at most 500 characters (`400 messaging_conversation_ban_reason_too_long`).

Banning a customer who is already banned keeps the original `bannedAt` and `bannedBy`.
Banning after a ban expired starts a new ban. Returns `404` when the conversation doesn't
exist or the caller can't access it.

Authentication: bearerAuth
Required scopes: `conversation:ban`
Allowed roles: `owner`, `admin`, `agent`
Authorization: Ban the customer of a conversation in scope.

## Parameters

- `id` (path string, required) - Conversation ID.

## Request body

- `application/json`: `BanConversationRequest` optional.

## Responses

- `200`: Customer banned
- `default`: Error
