# 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="<https://1284666567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5GEiPeDoFksvZv1vH3A%2Fuploads%2Fgit-blob-0e98238ab4157276fe00dee89f522ee5a021e711%2Fopenapi.yaml?alt=media>" 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-0e98238ab4157276fe00dee89f522ee5a021e711%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](https://docs.roboflow.com/developer/rest-api/vision-events/create-a-vision-event) endpoint.

{% hint style="info" %}
To include images in your events, first upload each image using the [Upload a Vision Event Image](https://docs.roboflow.com/developer/rest-api/vision-events/upload-a-vision-event-image) endpoint, then reference the returned `sourceId` in the image object. See [Image Objects](https://docs.roboflow.com/developer/rest-api/create-a-vision-event#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](https://docs.roboflow.com/developer/rest-api/create-a-vision-event#validation-and-warnings) for details.
