---
title: "Create Client Event"
description: "How to call Create Client Event (POST /client/events/) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/v2023-07-15/reference/create_client_event"
revision: "2023-07-15"
latestUrl: "https://developers.klaviyo.com/en/reference/create_client_event"
operationId: "create_client_event"
method: "POST"
endpoint: "https://a.klaviyo.com/client/events/"
authentication: "publicKey"
scopes: ["events:write"]
rateLimits: {"burst":"350/s","steady":"3500/m"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
related: ["https://developers.klaviyo.com/en/v2023-07-15/reference/client/llms.txt","https://developers.klaviyo.com/en/v2023-07-15/reference/create_client_subscription.md","https://developers.klaviyo.com/en/v2023-07-15/reference/create_client_push_token.md","https://developers.klaviyo.com/en/v2023-07-15/reference/unregister_client_push_token.md","https://developers.klaviyo.com/en/v2023-07-15/reference/create_client_profile.md","https://developers.klaviyo.com/en/v2023-07-15/reference/bulk_create_client_events.md","https://developers.klaviyo.com/en/v2023-07-15/reference/create_client_back_in_stock_subscription.md"]
---

# Create Client Event

> This is the Markdown version of https://developers.klaviyo.com/en/v2023-07-15/reference/create_client_event

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

Create a new event to track a profile's activity.

This endpoint is specifically designed to be called from publicly-browseable, client-side environments only. To create events from server-based applications, please use [POST /api/events](https://developers.klaviyo.com/en/v2023-07-15/reference/create_event.md)

- Revision header: `revision: 2023-07-15` (required)
- Scopes: `events:write`
- Authentication: Public API key (site ID), in the `company_id` query parameter
- Rate limits: Burst: `350/s`, Steady: `3500/m`

## Example request

```bash
curl --request POST \
     --url 'https://a.klaviyo.com/client/events/?company_id=PUBLIC_API_KEY' \
     --header 'accept: application/json' \
     --header 'revision: 2023-07-15' \
     --header 'content-type: application/json' \
     --data '{
  "data": {
    "type": "event",
    "attributes": {
      "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,
      "metric": {
        "data": {
          "type": "metric",
          "attributes": {
            "name": "Viewed Product"
          }
        }
      },
      "profile": {
        "data": {
          "type": "profile",
          "id": "01GDDKASAP8TKDDA2GRZDSVP4H",
          "attributes": {
            "email": "sarah.mason@klaviyo-demo.com",
            "phone_number": "+15005550006",
            "external_id": "63f64a2b-c6bf-40c7-b81f-bed08162edbe",
            "first_name": "Sarah",
            "last_name": "Mason",
            "organization": "Klaviyo",
            "title": "Engineer",
            "image": "https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg",
            "properties": {
              "pseudonym": "Dr. Octopus"
            }
          }
        }
      }
    }
  }
}'
```

## Query parameters

- `company_id` (string, required): Your Public API Key / Site ID. See [this article](https://help.klaviyo.com/hc/en-us/articles/115005062267) for more details. Example: `PUBLIC_API_KEY`

## Headers

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

## Request body

Content type: `application/json` (required)

- `data` (object, required)
  - `type` (string, required): Allowed values: `event`
  - `attributes` (object, required)
    - `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.
    - `metric` (object, required)
      - `data` (object, required): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.
    - `profile` (object, required)
      - `data` (object, required): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.

### Example request body

```json
{
  "data": {
    "type": "event",
    "attributes": {
      "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,
      "metric": {
        "data": {
          "type": "metric",
          "attributes": {
            "name": "Viewed Product"
          }
        }
      },
      "profile": {
        "data": {
          "type": "profile",
          "id": "01GDDKASAP8TKDDA2GRZDSVP4H",
          "attributes": {
            "email": "sarah.mason@klaviyo-demo.com",
            "phone_number": "+15005550006",
            "external_id": "63f64a2b-c6bf-40c7-b81f-bed08162edbe",
            "first_name": "Sarah",
            "last_name": "Mason",
            "organization": "Klaviyo",
            "title": "Engineer",
            "image": "https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg",
            "properties": {
              "pseudonym": "Dr. Octopus"
            }
          }
        }
      }
    }
  }
}
```

## 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"
      }
    }
  ]
}
```
