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

# Record a contact event

`POST /v1/events`

## Request

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

Records a custom contact event. Identify the contact by exactly one ID, external ID, or email. A missing email or external ID creates a contact; an unknown contact ID returns 404. An organization-scoped idempotency key replays the original event. Event names use letters, digits, underscores, hyphens, and dots, up to 255 characters; contact. and samva. prefixes are reserved. Properties allow at most 50 keys and 32 KiB of UTF-8 JSON. Events are retained for 90 days.

## Request body

- CreateEventPayload (unresolved $ref)

## Response `200`

ContactEvent

- ContactEvent
  - `id` string, required
  - `contactId` string, required
  - `name` string, required
  - `source` 'api' | 'samva', required
  - `properties` JsonObject, required
  - `occurredAt` string, required
  - `recordedAt` string, required

## Other responses

- `401`: UnauthorizedError
- `402`: PaymentRequiredError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `409`: ConflictError
- `422`: ValidationError
- `500`: InternalError
- `502`: BillingProviderError
- `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)
