---
title: "Create Custom Event"
method: POST
path: "/api/v2/events"
---

# Create Custom Event

`POST /api/v2/events`

Send a Custom Event to use in Flows

## Headers

- `X-Postscript-Shop-Token` string

## Request body

- object
  - `type` string, required — The type of event that you are creating. This is the name of the event that will show in the Postscript application. **Note:** when creating this event, we will *automatically* prefix your partner/shop name in front of the event. For example, if sending an event called "OrderPlaced", we'll show it in our UI as "[Your Partner/Shop Name] - OrderPlaced" to distinguish it from others of a similar name. We accept the follow characters in the value field: lowercase letters (a-z), uppercase letters (A-Z), digits (0-9), and underscores (_).
  - `subscriber_id` string — The ID of the subscriber that you are creating the event for.
  - `phone` string — The phone number of the subscriber that you are creating the event for. E.164 format is recommended, but other formats will be accepted.
  - `email` string — The email of the subscriber that you are creating the event for.
  - `occurred_at` string, date — When the event occurred. This parameter is optional but allows you to set the exact time that the event occurred on your system. If it is not sent to us, we will just use the current time when we receive it. The following UTC time format is supported: %Y-%m-%d %H:%M:%S.%f
  - `properties` object — These are the properties of the event. These properties will be exposed in the Postscript platform for things like filtering and merge tags to merchants.
    - `key` string — Properties can be key:value pairs. We will attempt to choose the appropriate data type for the value depending on what you send us. We currently accept strings, booleans, integers, floats, and datetime strings.
  - `external_id` string — The unique id of the event on your system. This is an optional field. If a value is not provided, we will create a default id ourselves based on time of event received.

## Response `202`

202

- object
  - `event_ids` string[]

## Other responses

- `400` — 400

---

[API](https://skmtc.net/postscript/apis/partner-api.md) · [All operations](https://skmtc.net/postscript/apis/partner-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/postscript/partner-api/versions/cdc907985776/schema)
