# Campaigns mail route create

`POST /mail/inbound/routes` · Rivier · campaigns

Receive mail for a domain or address of the project as parsed JSON on its webhook endpoints (event mail.inbound).

- Scope: campaigns:admin
- Graphql: Mutation.campaignsMailRouteCreate
- Sdk: mail.inbound.createRoute
- Cli: mail route-create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "match": {
      "type": "string",
      "minLength": 3,
      "maxLength": 320,
      "description": "A domain (mail.example.com) or one address"
    },
    "keepRaw": {
      "type": "boolean"
    }
  },
  "required": [
    "match"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: 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 POST 'https://api.rivier.ai/mail/inbound/routes' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "match": "string"
}'
```
