# Change the project's mail API settings

`PUT /mail/settings` · Rivier · campaigns

Change the project's mail API settings. Choosing the own MTA does not switch it on: it is used for a domain only after the deliverability checks pass.

- Scope: campaigns:write
- Graphql: Mutation.campaignsMailSettingsUpdate
- Sdk: mail.settings.update
- Cli: mail settings-update

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "ratePerMinute": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1
        },
        {
          "type": "null"
        }
      ]
    },
    "trackOpens": {
      "type": "boolean"
    },
    "trackClicks": {
      "type": "boolean"
    },
    "defaultGroup": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 40
        },
        {
          "type": "null"
        }
      ]
    },
    "transport": {
      "type": "string",
      "enum": [
        "auto",
        "own-mta",
        "resend",
        "furcate-mail"
      ]
    },
    "domainTransport": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "enum": [
          "own-mta",
          "resend",
          "furcate-mail"
        ]
      }
    },
    "retentionDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 730
    }
  },
  "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/mail/settings' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "ratePerMinute": 0,
  "trackOpens": false,
  "trackClicks": false,
  "defaultGroup": "string",
  "transport": "auto",
  "domainTransport": {},
  "retentionDays": 0
}'
```
