# Contacts event ingest

`POST /crm/events` · Rivier · contacts

Tell the contact store something happened with a person (an order, a booking, a payment, a chat); the person is found or made.

- Scope: contacts:write
- Graphql: Mutation.contactsEventIngest
- Sdk: contacts.event.ingest
- Cli: contacts event ingest

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "at": {
      "type": "string",
      "format": "date-time"
    },
    "kind": {
      "type": "string",
      "pattern": "^[a-z_]+(\\.[a-z_]+){0,3}$",
      "maxLength": 60
    },
    "channel": {
      "type": "string",
      "enum": [
        "email",
        "sms",
        "whatsapp",
        "phone",
        "chat",
        "shop",
        "booking",
        "payment",
        "form",
        "note",
        "task",
        "deal",
        "system"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "in",
        "out",
        "internal"
      ],
      "default": "internal"
    },
    "summary": {
      "type": "string",
      "maxLength": 500,
      "default": ""
    },
    "refKind": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 40
        },
        {
          "type": "null"
        }
      ]
    },
    "refId": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 120
        },
        {
          "type": "null"
        }
      ]
    },
    "data": {
      "type": "object",
      "additionalProperties": {}
    },
    "activity": {
      "type": "boolean"
    },
    "identity": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "maxLength": 40
        },
        "value": {
          "type": "string",
          "maxLength": 320
        },
        "name": {
          "type": "string",
          "maxLength": 200
        },
        "country": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        }
      },
      "required": [
        "kind",
        "value"
      ],
      "additionalProperties": false
    },
    "source": {
      "type": "string",
      "maxLength": 60
    },
    "orders": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer"
        },
        "totalMinor": {
          "type": "integer"
        }
      },
      "required": [
        "count",
        "totalMinor"
      ],
      "additionalProperties": false
    },
    "lifecycle": {
      "type": "string",
      "enum": [
        "subscriber",
        "lead",
        "customer",
        "partner",
        "other"
      ]
    }
  },
  "required": [
    "kind",
    "channel",
    "identity"
  ],
  "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/crm/events' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "kind": "string",
  "channel": "email",
  "identity": {
    "kind": "string",
    "value": "string"
  }
}'
```
