---
title: Sending enrichment data batches to Contentsquare - APIs
description: How to send enriched data with the Enrichment API
lastUpdated: 09 May 2025
source_url:
  html: https://docs.contentsquare.com/en/api/enrichment/sending-enrichment-data-batches-cs/
  md: https://docs.contentsquare.com/en/api/enrichment/sending-enrichment-data-batches-cs/index.md
---

Once the [Provider](https://docs.contentsquare.com/en/api/enrichment/definitions/#provider) has collected the required Contentsquare session identifiers, they can start enriching the Contentsquare data with their own data.

Sending a batch of enrichment data falls into 2 steps:

* Authenticating and retrieving the right enrichment endpoint dynamically
* Sending the enrichment data to this endpoint with a valid JWT

## Authentication

See the dedicated [Authentication section](https://docs.contentsquare.com/en/api/enrichment/authentication/).

## Sending data to the enrichment endpoint

### Prerequisites

* Step 3: the [Provider](https://docs.contentsquare.com/en/api/enrichment/definitions/#provider) must have the knowledge of which Contentsquare project ID and sessions the data will enrich
* Step 4.1: the [Provider](https://docs.contentsquare.com/en/api/enrichment/definitions/#provider) must have a valid JWT and base URL for the enrichment endpoint
* All the enrichments of a batch sent to the enrichment endpoint have to match the schema version of the integration provided in the request (if an enrichment gets rejected, then the full batch will be rejected)

### HTTP Request

#### Request

* **Endpoint** (returned by the authentication call in step 4.1):\
  `https://enrichment-api.{cloud}.contentsquare.com/v1/enrichments`
* **Method**: `POST`
* **Header**: `Authorization: Bearer {JWT access token}`
* **Body**:

```json
{
  "integrationVersion": 1, // required, provided by Contentsquare when creating a new schema
  "projectId": 1, // retrieved in step 3
  "enrichments": [
    {
      "userId": "{USER_ID}", // string, retrieved in step 3
      "sessionNumber": {SESSION_NUMBER}, // integer, retrieved in step 3
      "enrichmentNumber": 1, // integer, max 3, optional (will be 1 if not specified)
      "enrichment": {
        "field1": "Some string",
        "field2": 42,
        "field3": 3.14,
        "field4": "2022-03-23T00:10:30Z",
        "field5": true
      }
    }
  ]
}
```

* `integrationVersion`: **a schema version for the integration must be specified** so that Contentsquare can know which schema the data must match. Every time a new schema is created, Contentsquare provides the provider with a new integration version. The [Provider](https://docs.contentsquare.com/en/api/enrichment/definitions/#provider) must take care of sending data that match the right schema version. If the [Provider](https://docs.contentsquare.com/en/api/enrichment/definitions/#provider) has only one schema registered, then the `integrationVersion` should remain `1` by default.
* `enrichmentNumber`: as a Contentsquare session can be enriched with up to 3 enrichments, each enrichment must be indexed so that it can potentially be updated later (see the [dedicated section](https://docs.contentsquare.com/en/api/enrichment/update-an-enrichment/) on how to update an enrichment). **Index should start at 1 and can be max 3**. If no enrichment number is specified by the [Provider](https://docs.contentsquare.com/en/api/enrichment/definitions/#provider), it will be considered as `1` by default (meaning that if the [Provider](https://docs.contentsquare.com/en/api/enrichment/definitions/#provider) never specifies any enrichment number, any new enrichment for a session will overwrite the previous one and there will be only 1 enrichment per session - with index `1`)

#### Response

**Success `200`**

(Empty body)

#### Errors

##### Unauthorized: `401`: invalid JWT token

```json
{
  "message": "Unauthorized"
}
```

##### Bad request `400`: data validation failed

```json
{
  "message": "enrichments don't match expected payload"
}
```

##### Bad request `400`: bad integration version

```json
{
  "message": "bad integration version"
}
```

### Example

#### Request

```shell
curl --location --request POST 'https://enrichment-api.ba.contentsquare.com/v1/enrichments' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IktJRCJ9.eyJpc3MiOiJlbnJpY2htZW50SW50ZWdyYXRpb24iLCJpYXQiOiJJQVQiLCJleHAiOiJFWFAiLCJ2ZXJzaW9uIjoiMSIsInByb2plY3RJZCI6MTYyLCJpbnRlZ3JhdGlvbklkIjoxMDB9' \
--data-raw '{
    "integrationVersion": 1,
    "projectId": 162,
    "enrichments": [
        {
            "userId": "aaa-aaa-aaa",
            "sessionNumber": 5,
            "enrichmentNumber": 1,
            "enrichment": {
                "has_called": true,
                "call_duration": 3532,
                "call_client_rating": 4.5,
                "call_center_name": "RENNES",
                "call_date": "2022-01-01T20:02:22Z"
            }
        },
        {
            "userId": "aaa-aaa-aaa",
            "sessionNumber": 5,
            "enrichmentNumber": 2,
            "enrichment": {
                "has_called": true,
                "call_duration": 2293,
                "call_client_rating": 2,
                "call_center_name": "RENNES",
                "call_date": "2022-01-01T18:09:54"
            }
        }
    ]
}'
```

#### Response

**Success `200`**

### Limitations

* EnrichmentNumber:

  * Min: 1
  * Max: 3

* Number of enrichments per batch: max 200

* Sessions that started more than 7 days ago cannot be enriched (enrichment for those sessions will not be rejected but no data will be available in the Contentsquare platform in the end)

Note

For security purposes, if any enrichment gets rejected, then the full enrichment batch it belongs to will be rejected.
