> 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/send-events.md).

# 이벤트 전송

배포된 모델에서 Vision Event를 보내는 세 가지 방법입니다.

## 이벤트 전송

Vision 이벤트는 Workflow 블록, REST API 또는 엣지 디바이스 백업을 사용해 전송할 수 있습니다.

* [Workflow 블록](#workflow-block) - Workflows 사용자는 공식 Roboflow 블록을 사용하는 것이 가장 쉬울 것입니다
* [REST API](#rest-api) - 워크플로우 밖에서 모델을 배포하려는 사용자는 우리의 REST API를 사용할 수 있습니다
* [엣지 디바이스 백업](#edge-device-backup) - Roboflow Edge 디바이스를 배포하는 사용자는 디바이스의 로컬 이벤트 저장소에서 자동 백업을 구성하는 것이 가장 편리할 것입니다

### Workflow 블록

대부분의 사용자에게 권장되는 방법입니다. 다음을 추가하세요. **Vision 이벤트** 블록을 Roboflow Workflow에 추가하면 코드 없이 추론 결과로부터 자동으로 이벤트를 생성할 수 있습니다.

{% hint style="info" %}
이 [Roboflow 에이전트](https://docs.roboflow.com/agents/roboflow-agent) 이를 대신 설정해 드릴 수 있습니다. 에이전트에게 모델을 실행하는 Workflow를 만들라고 요청하면, Vision Events 블록을 자동으로 추가하고 이를 올바른 [사용 사례](/deployment/ko/monitoring-and-analytics/vision-events/use-cases.md).
{% endhint %}

#### 설정

{% stepper %}
{% step %}
**Workflow 편집기를 열기**

이동하여 **Workflows** 워크스페이스에서 이벤트를 추가하려는 워크플로우를 엽니다.
{% endstep %}

{% step %}
**Vision Event 블록 추가**

블록 카탈로그에서 "Vision Event"를 검색하여 워크플로우에 추가합니다.
{% endstep %}

{% step %}
**입력 연결**

이미지 입력과 모델 예측 출력을 Vision Event 블록에 연결합니다.
{% endstep %}

{% step %}
**사용 사례 구성**

사용 사례 이름을 설정합니다 (`useCaseId`). 또한 상위 블록의 사용자 지정 메타데이터를 매핑할 수도 있습니다. 사용 사례를 선택한 후 드롭다운 아래의 "Vision Events에서 열기"를 클릭하면 새 탭에서 해당 사용 사례의 이벤트 페이지로 이동합니다.
{% endstep %}

{% step %}
**워크플로우 배포**

워크플로우를 배포하거나 업데이트하세요. 워크플로우가 실행될 때마다 이벤트가 자동으로 생성됩니다.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Workflow 블록은 이미지 업로드와 이벤트 생성을 한 단계로 처리합니다. 이미지만 첨부합니다. 비디오 클립을 첨부하려면 [REST API](#attach-a-video) 또는 [엣지 디바이스 백업](#edge-device-backup).
{% endhint %}

### REST API

Workflows를 사용하지 않는 사용자 지정 통합이나 파이프라인의 경우 REST API를 통해 직접 이벤트를 전송할 수 있습니다. 전체 요청 및 응답 스키마는 다음을 참조하세요: [Vision Events API 레퍼런스](/deployment/ko/monitoring-and-analytics/vision-events.md#http-api).

#### 인증

모든 쓰기 엔드포인트에는 다음 권한이 있는 API 키가 필요합니다: `visionEvents.write` 또는 `device.update` 범위. API 키를 Bearer 토큰으로 전달하세요:

```
Authorization: Bearer YOUR_API_KEY
```

#### 엔드투엔드 예시: 이미지 업로드 + 이벤트 생성

{% hint style="warning" %}
이벤트를 전송하기 전에 사용 사례를 만들어야 합니다. 다음을 참조하는 이벤트는 `useCaseId` 존재하지 않으면 거부됩니다.
{% endhint %}

API를 통해 이벤트를 전송할 때는 먼저 이미지를 업로드한 다음, 업로드된 이미지를 참조하는 이벤트를 생성합니다.

**1단계: 이미지 업로드**

```bash
curl -X POST "https://api.roboflow.com/vision-events/upload" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@inspection_photo.jpg"
```

**응답:**

```json
{
  "success": true,
  "sourceId": "abc123def456",
  "url": "https://storage.googleapis.com/your-workspace/abc123def456/original.jpg"
}
```

**2단계: 업로드된 이미지를 참조하여 이벤트 생성**

```bash
curl -X POST "https://api.roboflow.com/vision-events" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "eventType": "quality_check",
    "useCaseId": "assembly-line-qa",
    "timestamp": "2026-03-30T14:30:00.000Z",
    "deviceId": "factory-cam-01",
    "streamId": "line-3",
    "images": [
      {
        "sourceId": "abc123def456",
        "objectDetections": [
          {
            "class": "defect",
            "x": 320,
            "y": 240,
            "width": 50,
            "height": 40,
            "confidence": 0.95
          }
        ]
      }
    ],
    "eventData": {
      "result": "fail"
    },
    "customMetadata": {
      "line_id": "line-3",
      "shift": "morning",
      "part_number": "PN-4421"
    }
  }'
```

**응답:**

```json
{
  "eventId": "evt-789ghi",
  "created": true
}
```

#### 비디오 첨부

비디오 클립은 최대 3GB까지 가능하므로 form 업로드 대신 서명된 업로드를 사용합니다. 업로드를 준비하여 `videoId`, `PUT` 파일을 반환된 URL에 업로드한 다음, `videoId` 이벤트의 `videos` 배열에

```json
"videos": [
  { "sourceId": "Kq4vX8mNp2RtY6wZ1bCd", "label": "line-3 camera" }
]
```

다음을 참조하세요 [Vision Event 비디오 업로드](/deployment/ko/monitoring-and-analytics/vision-events/upload-a-vision-event-video.md) 각 단계별로.

#### 이벤트 일괄 생성

batch 엔드포인트를 사용하여 한 번의 요청으로 최대 100개의 이벤트를 전송할 수 있습니다:

```bash
curl -X POST "https://api.roboflow.com/vision-events/batch" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "events": [
      {
        "eventType": "quality_check",
        "useCaseId": "alksjdflaalsf32",
        "eventData": { "result": "pass" },
        "customMetadata": { "line_id": "line-1" }
      },
      {
        "eventType": "quality_check",
        "useCaseId": "alksjdflaalsf32",
        "eventData": { "result": "fail" },
        "customMetadata": { "line_id": "line-2" }
      }
    ]
  }'
```

{% hint style="info" %}
batch 요청당 최대 100개 이벤트.
{% endhint %}

### 엣지 디바이스 백업

연결이 간헐적일 수 있는 엔터프라이즈 배포에서는 엣지 디바이스가 이벤트를 로컬에 저장하고 연결이 복원되면 Roboflow와 동기화합니다.

{% hint style="info" %}
Edge Device Backup에는 Deployment Manager가 필요합니다. 다음을 참조하세요: [Deployment Manager 문서](/deployment/ko/self-hosted/enterprise/deployment-manager.md) 설정 방법을 보려면.
{% endhint %}

Vision Events 백업을 활성화하려면:

1. 열기 **Deployment Manager** 워크스페이스에서
2. 구성할 디바이스를 선택하세요
3. 활성화 **Vision Events 백업** 디바이스의 [Event Store](/deployment/ko/self-hosted/enterprise/deployment-manager/services/event-store.md) 구성에서
4. 이벤트는 디바이스의 로컬 이벤트 저장소에 기록됩니다
5. 디바이스가 다시 연결되면 이벤트가 자동으로 Roboflow에 동기화됩니다

동기화가 완료되면 이벤트가 Vision Events 대시보드에 표시됩니다.

"Backup Mode"가 "Records and Files"인 경우, 디바이스의 이벤트에 첨부된 비디오 클립도 업로드되어 대시보드에서 재생됩니다. MP4 및 MOV 클립은 이벤트당 최대 4개까지 업로드됩니다. 다른 형식은 디바이스에 남습니다. 업로드에 실패한 클립은 재시도할 때마다 이벤트를 약 1시간 지연시킵니다. 반복 실패(기본값 3회) 후에는 클립 없이 이벤트가 동기화됩니다. 다음을 참조하세요: [이벤트 및 비디오 초안](/deployment/ko/self-hosted/enterprise/deployment-manager/services/event-store.md#draft-events-and-video) 파이프라인이 디바이스에서 클립을 첨부하는 방법을 보려면.

<figure><img src="https://1826078061-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-dad946e36678b43e2fe868c8972b9b8853eb724f%2Fimage%20(455).png?alt=media" alt="" width="375"><figcaption></figcaption></figure>
