> 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/deployment/ko/monitoring-and-analytics/vision-events/batch-create-vision-events.md).

# Vision Events 일괄 생성

## 소개

이 엔드포인트는 여러 개를 기록합니다 [Vision Events](/deployment/ko/monitoring-and-analytics/vision-events.md) 한 번의 요청으로 한 번에 최대 100개까지 기록합니다. 배포에서 많은 관측치를 한꺼번에 수집해야 할 때 사용하세요. 개별적으로 이벤트를 만드는 것보다 더 효율적입니다. 단일 이벤트를 기록하려면 다음을 참조하세요 [비전 이벤트 생성](/deployment/ko/monitoring-and-analytics/vision-events/create-a-vision-event.md).

## HTTP API

한 번의 요청으로 최대 100개의 비전 이벤트를 생성합니다. 여러 이벤트를 한꺼번에 수집해야 할 때는 이벤트를 개별적으로 생성하는 것보다 더 효율적입니다.

**필수 스코프:** `vision-events:write` 또는 `device:update`

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

### 예시 요청

```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"
        }
      }
    ]
  }'
```

### 요청 본문 매개변수

* **`이벤트`** (배열, 필수, 최대 100개): 이벤트 객체 배열입니다. 각 이벤트는 다음과 동일한 스키마를 따릅니다 [비전 이벤트 생성](/deployment/ko/monitoring-and-analytics/vision-events/create-a-vision-event.md#http-api) 엔드포인트.

{% hint style="info" %}
이벤트에 이미지를 포함하려면 먼저 각 이미지를 다음을 사용해 업로드하세요 [비전 이벤트 이미지 업로드](/deployment/ko/monitoring-and-analytics/vision-events/upload-a-vision-event-image.md#http-api) 엔드포인트를 사용한 다음, 반환된 `sourceId` 이미지 객체에서 참조하세요. 다음을 참조하세요 [이미지 객체](/deployment/ko/monitoring-and-analytics/vision-events/create-a-vision-event.md#image-objects) 자세한 내용은.
{% endhint %}

### 예시 응답

{% 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": "이 리소스에 대한 권한이 충분하지 않습니다."
}
```

{% endtab %}
{% endtabs %}

응답에는 다음도 포함될 수 있습니다. `warnings` 이벤트별 검증 경고(이벤트 인덱스로 키가 지정됨)를 포함하는 객체와 `deprecations` 사용된 경우 더 이상 사용되지 않는 필드 이름이 있는 배열입니다. 다음을 참조하세요 [검증 및 경고](/deployment/ko/monitoring-and-analytics/vision-events/create-a-vision-event.md#validation-and-warnings) 자세한 내용은.

## Python SDK

한 번의 요청으로 여러 비전 이벤트를 생성합니다. 서버는 배치당 최대 100개 이벤트를 허용합니다.

```python
import roboflow

roboflow.login()

rf = roboflow.Roboflow()
ws = rf.workspace()

result = ws.write_vision_events_batch([
    {
        "eventId": "e5f6a7b8-c3d4-4e5f-a0b1-c2d3e4f5a6b7",
        "eventType": "quality_check",
        "useCaseId": "a1b3c8e1",
        "timestamp": "2024-01-15T10:00:00Z",
        "eventData": {"result": "pass"},
    },
    {
        "eventId": "f6a7b8c9-d4e5-4f6a-b1c2-d3e4f5a6b7c8",
        "eventType": "quality_check",
        "useCaseId": "a1b3c8e1",
        "timestamp": "2024-01-15T10:01:00Z",
        "eventData": {"result": "fail"},
        "customMetadata": {"line": "A1"},
    },
])

print(result["created"])    # 생성된 이벤트 수
print(result["eventIds"])   # 생성된 이벤트 ID 목록
```

목록의 각 이벤트는 다음과 동일한 스키마를 따릅니다 [단일 이벤트](/deployment/ko/monitoring-and-analytics/vision-events/create-a-vision-event.md#python-sdk)입니다. 이벤트 스키마 및 유효성 검사 동작에 대한 전체 내용은 다음을 참조하세요 [REST API 참조](#http-api).
