# Inbox message retention set

`PUT /messages/retention` · Rivier · inbox

Set how many days the log keeps messages (1 to 3650), or null for the deployment default.

- Scope: inbox:write
- Graphql: Mutation.inboxMessageRetentionSet
- Sdk: inbox.messageRetention.set
- Cli: inbox message retention set

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "days": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 3650
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "days"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/messages/retention' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "days": 0
}'
```
