> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/developer/rest-api/vision-events/batch-create-vision-events.md).

# Batch Create Vision Events

Create up to 100 vision events in a single request. This is more efficient than creating events individually when you need to ingest multiple events at once.

**Required scope:** `vision-events:write` or `device:update`

{% openapi src="/files/XCSsl1XUH9tiFJObaN6D" path="/vision-events/batch" method="post" %}
[openapi.yaml](https://1284666567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5GEiPeDoFksvZv1vH3A%2Fuploads%2Fgit-blob-dfdc1702ad3d1a62ad0a661e9609f6bbe2fc8d4c%2Fopenapi.yaml?alt=media)
{% endopenapi %}

### Example Request

```bash
curl -X POST "https://api.roboflow.com/vision-events/batch" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "eventId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
        "eventType": "quality_check",
        "useCaseId": "a1b3c8e1",
        "timestamp": "2024-01-15T10:30:00Z",
        "eventData": {
          "result": "pass"
        }
      },
      {
        "eventId": "9c4d6a2e-81f3-4b7a-bc9e-3f1a2d4e5c6b",
        "eventType": "quality_check",
        "useCaseId": "a1b3c8e1",
        "timestamp": "2024-01-15T10:31:00Z",
        "eventData": {
          "result": "fail"
        }
      }
    ]
  }'
```

### Request Body Parameters

* **`events`** (array, required, max 100): An array of event objects. Each event follows the same schema as the [Create a Vision Event](/developer/rest-api/vision-events/create-a-vision-event.md) endpoint.

{% hint style="info" %}
To include images in your events, first upload each image using the [Upload a Vision Event Image](/developer/rest-api/vision-events/upload-a-vision-event-image.md) endpoint, then reference the returned `sourceId` in the image object. See [Image Objects](/developer/rest-api/vision-events/create-a-vision-event.md#image-objects) for details.
{% endhint %}

### Example Response

{% tabs %}
{% tab title="201" %}

```json
{
  "created": 2,
  "eventIds": ["f47ac10b-58cc-4372-a567-0e02b2c3d479", "9c4d6a2e-81f3-4b7a-bc9e-3f1a2d4e5c6b"]
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Batch size exceeds maximum of 100 events"
}
```

{% endtab %}

{% tab title="403" %}

```json
{
  "error": "Insufficient permissions for this resource."
}
```

{% endtab %}
{% endtabs %}

The response may also include a `warnings` object containing per-event validation warnings (keyed by event index), and a `deprecations` array if deprecated field names were used. See [Validation and Warnings](/developer/rest-api/vision-events/create-a-vision-event.md#validation-and-warnings) for details.
