---
title: "Create Event"
description: "How to call Create Event (POST /api/events/) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/v2023-01-24/reference/create_event"
revision: "2023-01-24"
latestUrl: "https://developers.klaviyo.com/en/reference/create_event"
operationId: "create_event"
method: "POST"
endpoint: "https://a.klaviyo.com/api/events/"
authentication: "privateKey"
scopes: ["Events Write"]
rateLimits: {"burst":"350/s","steady":"3500/m"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
related: ["https://developers.klaviyo.com/en/v2023-01-24/reference/events/llms.txt","https://developers.klaviyo.com/en/v2023-01-24/reference/get_events.md","https://developers.klaviyo.com/en/v2023-01-24/reference/get_event.md","https://developers.klaviyo.com/en/v2023-01-24/reference/get_event_metrics.md","https://developers.klaviyo.com/en/v2023-01-24/reference/get_event_profiles.md","https://developers.klaviyo.com/en/v2023-01-24/reference/get_event_relationships.md"]
---

# Create Event

> This is the Markdown version of https://developers.klaviyo.com/en/v2023-01-24/reference/create_event

```http
POST https://a.klaviyo.com/api/events/
```

Create an event. Events are created asynchronously.
Successful response indicates that the event was validated and submitted for processing, but does not guarantee that processing is complete.

- Revision header: `revision: 2023-01-24` (required)
- Scopes: `Events Write`
- Rate limits: Burst: `350/s`, Steady: `3500/m`

## Example request

```bash
curl --request POST \
     --url 'https://a.klaviyo.com/api/events/' \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/json' \
     --header 'revision: 2023-01-24' \
     --header 'content-type: application/json' \
     --data '{
  "data": {
    "type": "event",
    "attributes": {
      "profile": {
        "$email": "matt.kemp@klaviyo-demo.com"
      },
      "metric": {
        "name": "Viewed Product"
      },
      "properties": {
        "Brand": "Kids Book",
        "Categories": [
          "Fiction",
          "Children"
        ],
        "ProductID": 1111,
        "ProductName": "Winnie the Pooh",
        "$extra": {
          "URL": "http://www.example.com/path/to/product",
          "ImageURL": "http://www.example.com/path/to/product/image.png"
        }
      },
      "time": "2022-11-08T00:00:00",
      "value": 9.99
    }
  }
}'
```

## Headers

- `revision` (string, required): API endpoint revision (format: YYYY-MM-DD[.suffix]) Default: `2023-01-24`

## Request body

Content type: `application/json` (required)

- `data` (object, required)
  - `type` (string, required): Allowed values: `event`
  - `attributes` (object, required)
    - `profile` (object, required): 
      Properties of the profile that triggered this event. The profile must contain an
      identifier. The $email and/or $phone_number can be used as the identify the profile.
      Other key value pairs can be used to create segments. For example, to create a list of
      people on trial plans, include a profile's plan type in the profile. The profile
      supports special fields. The fields include: $email (string), $first_name (string),
      $last_name (string), $phone_number (string), $city (string), $region (string; state or
      other region), $country (string), $zip (string), $image (string; url to a photo of a
      person), and $consent (list of strings; eg: ['sms', 'email', 'web', 'directmail',
      'mobile']).
      
    - `metric` (object, required)
      - `name` (string, required): Name of the event. Must be less than 128 characters. Example: `Viewed Product`
      - `service` (string): This is for advanced usage. For api requests, this should use the default, which is set to api.
    - `properties` (object, required): 
       Properties of this event. Any top level property (that are not objects) can be
      used to create segments. The $extra property is a special property. This records any
      non-segmentable values that can be references later. For example, HTML templates are
      useful on a segment, but itself is not used in creating a segment. There are limits
      placed onto the size of the data present. This must not exceed 5 MB. This must not
      exceed 300 event properties. A single string cannot be larger than 100 KB. Each array
      must not exceed 4000 elements. The properties cannot contain more than 10 nested levels.
      
    - `time` (string<date-time>): 
      When this event occurred. By default, the time the request was received will be used.
      The time is truncated to the second. The time must be after the year 2000 and can only
      be up to 1 year in the future.
       Example: `2022-11-08T00:00:00`
    - `value` (number): A numeric value to associate with this event. For example, the dollar amount of a purchase. Example: `9.99`
    - `unique_id` (string): 
      A unique identifier for an event. If the unique_id is repeated for the same
      profile and metric, only the first processed event will be recorded. If this is not
      present, this will use the time to the second. Using the default, this limits only one
      event per profile per second.
      

### Example request body

```json
{
  "data": {
    "type": "event",
    "attributes": {
      "profile": {
        "$email": "matt.kemp@klaviyo-demo.com"
      },
      "metric": {
        "name": "Viewed Product"
      },
      "properties": {
        "Brand": "Kids Book",
        "Categories": [
          "Fiction",
          "Children"
        ],
        "ProductID": 1111,
        "ProductName": "Winnie the Pooh",
        "$extra": {
          "URL": "http://www.example.com/path/to/product",
          "ImageURL": "http://www.example.com/path/to/product/image.png"
        }
      },
      "time": "2022-11-08T00:00:00",
      "value": 9.99
    }
  }
}
```

## Responses

### 202: 

This response has no body.

### 4XX: Client Error

Content type: `application/json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```

### 5XX: Server Error

Content type: `application/json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```
