---
title: "Record contact events in a batch"
method: POST
path: "/v1/events/batch"
tags: ["Events"]
---

# Record contact events in a batch

`POST /v1/events/batch`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/events/batch`
- Auth: API key in header `x-api-key`

Validates the full request shape, contact references, and event names before processing. A schema failure rejects the entire batch without writes. Between 1 and 100 valid entries are then processed in input order, with independent indexed results for properties limits, contact resolution, and idempotency.

## Request body

- BatchEventsPayload
  - `events` CreateEventPayload[], required (unresolved $ref)

## Response `200`

BatchEventsResult

- BatchEventsResult
  - `total` integer, required
  - `accepted` integer, required
  - `errors` integer, required
  - `results` object[], required
    - `index` integer, required
    - `status` 'accepted' | 'error', required
    - `event` ContactEvent
      - `id` string, required
      - `contactId` string, required
      - `name` string, required
      - `source` 'api' | 'samva', required
      - `properties` JsonObject, required
      - `occurredAt` string, required
      - `recordedAt` string, required
    - `error` string, nullable

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

[API](https://skmtc.dev/samva/apis/samva-api.md) · [All operations](https://skmtc.dev/samva/apis/samva-api/llms.txt) · [OpenAPI document](https://skmtc.dev/samva/apis/samva-api/revisions/a99408542cc3?raw)
