# Campaigns mail inbound ingest

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

Hand a received message to the parser (the mail platform does this for each message it receives for a routed domain). Send JSON with the raw message, or the message itself as message/rfc822.

- Scope: campaigns:admin
- Graphql: Mutation.campaignsMailInboundIngest
- Sdk: mail.inbound.ingest
- Cli: mail ingest

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "raw": {
      "type": "string",
      "maxLength": 40000000,
      "description": "The message as RFC 822 text, base64 when rawEncoding is base64"
    },
    "rawEncoding": {
      "type": "string",
      "enum": [
        "text",
        "base64"
      ]
    },
    "to": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 3,
        "maxLength": 320
      },
      "maxItems": 100
    },
    "from": {
      "type": "string",
      "minLength": 3,
      "maxLength": 320
    }
  },
  "required": [
    "raw"
  ],
  "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 POST 'https://api.rivier.ai/mail/inbound/ingest' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "raw": "string"
}'
```
