---
title: "Set messages to be preserved/un-preserved"
method: PUT
path: "/messages/preserve"
tags: ["Message", "Messages"]
---

# Set messages to be preserved/un-preserved

`PUT /messages/preserve`

## Request

- Base URL: `https://api.carbonvoice.app`
- URL: `https://api.carbonvoice.app/messages/preserve`
- Auth: one of:
  - API key in header `pxtoken`
  - OAuth 2 (implicit, authorization URL `https://api.carbonvoice.app/oauth/authorize`)

## Request body

- PreserveMessagesPayload
  - `channel_id` string, required
  - `is_preserved` boolean, required: If true, all messages will be marked as preserved, if false, all messages won't be marked as preserved
  - `message_ids` string[], required: Array of message ids to preserve or un-preserve

## Response `200`

- PreserveMessagesResponse
  - `channel_id` string, required
  - `messages` MessagePreserved[], required: Array of messages with their preserved info
    - `is_preserved` boolean, required: Indicates if message is marked as preserved or not
    - `message_id` string, required

---

[API](https://skmtc.dev/carbonvoice/apis/carbon-voice-api.md) · [All operations](https://skmtc.dev/carbonvoice/apis/carbon-voice-api/llms.txt) · [OpenAPI document](https://skmtc.dev/carbonvoice/apis/carbon-voice-api/revisions/b91c5c845122?raw)
