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

# Record an event

`POST /api/v1/events`

## Request

- Base URL: `https://api.sendly.now`
- URL: `https://api.sendly.now/api/v1/events`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `better-auth.session_token`
  - OAuth 2 (authorization code, authorization URL `https://app.sendly.now/api/auth/oauth2/authorize`, token URL `https://app.sendly.now/api/auth/oauth2/token`, scopes: `events:write`)

Records a custom event, optionally attached to a contact. Events drive segment membership and workflow triggers, so a matching enabled workflow starts as a result of this call.

`contact_id` must already exist in this project — unlike `POST /api/track`, this endpoint never creates contacts. Omit it for a project-level event.

Reserved system event names (`email.*`, `contact.subscribed`/`unsubscribed`, `segment.*.entry`/`.exit`) are rejected with 422: they are written by Sendly's own pipeline and accepting them from a caller would corrupt the series segments read.

This endpoint does NOT require an `Idempotency-Key`. Events are append-only and the highest-volume write on the surface; a duplicate is a data-quality question for the caller, not a money-path hazard.

Sending-only (`pk_*`) keys cannot record events — they hold the send capability and nothing else.

Requires the `events:write` scope — Record custom events for your contacts.

## Request body

- EventTrackV1: Body for POST /api/v1/events.
  - `contact_id` string, uuid: Contact the event belongs to. Must already exist in this project — unlike the legacy `POST /api/track`, this endpoint never creates contacts. Omit for a project-level event.
  - `name` string, required: Event name, e.g. `user.signup`.
  - `payload` object: Arbitrary event payload.

## Response `201`

Event recorded

- EventV1: A recorded custom event.
  - `contact_id` string, uuid, nullable, required
  - `created_at` string, date-time, required
  - `email_id` string, uuid, nullable, required
  - `id` string, uuid, required
  - `name` string, required
  - `payload` object, nullable, required: The payload recorded with the event, or null.

## Other responses

- `401`: `invalid_api_key` or `invalid_session` — missing or invalid credentials.
- `403`: `scope_missing`, `project_access_denied`, or `project_disabled`.
- `404`: `resource_not_found` — no contact with this id in the authenticated project.
- `422`: `validation_error` — query, path, or body parameters did not match the schema.
- `429`: `rate_limited` — see `Retry-After` and the `RateLimit` headers.
- `500`: `internal_error`.

---

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