# Batch import

You can use our regular `POST /consent/events` to import up to 100 events per request by sending a JSON-encoded array of events instead of a single event in the body of the request.

Example:

```javascript
POST /consents/events?organization_id={organization_id}

BODY
[
    {
        "id": "9556b7f5-ae22-4616-97f9-3f61e22f0ec7",
        "created_at": "2020-06-03T21:28:55Z",
        "user": {
            "organization_user_id": "user1@domain.com",
            "metadata": {
            "custom_key": "value"
            }
        },
        
        "consents": {
            "purposes": [
                {
                    "id": "purpose_id",
                    "enabled": true
                }
            ]
        }
    },
    {
        "id": "593aa0a9-5e2e-4305-8e78-9b9e11da0224",
        "created_at": "2020-06-03T21:28:55Z",
        "user": {
            "organization_user_id": "user2@domain.com",
            "metadata": {
            "custom_key": "value"
            }
        },
        
        "consents": {
            "purposes": [
                {
                    "id": "purpose_id",
                    "enabled": false
                }
            ]
        }
    }
]
```

We recommend adding a unique ID for every event in the `id` field as that guarantees that events are never imported twice. You can also add a creation date in the `created_at` field to import events that were collected in the past and keep their original collection date.

The full schema for a consent event is supported. You can read more about creating consent events and their schema in our [Guide](/api-and-platform/consents/events.md#create-a-consent-event) or our [API documentation](https://api.didomi.io/docs/#/consents%2Fevents/post_consents_events).

{% hint style="info" %}
If you are importing consent events already present in your systems and there is no need for these events to be forwarded to your integrations, you can add the query parameter `$disable_integrations=true` to your request to disable such forwarding.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.didomi.io/integrations/generic-integrations/batch-import.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
