# 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-d74beeed17fc5b3f8e39dcc93a9e9adaa7837101%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.


---

# 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://docs.roboflow.com/developer/rest-api/vision-events/batch-create-vision-events.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.
