# Get Events

Get all events in an account

Requests can be sorted by the following fields:
`datetime`, `timestamp`

[Custom metrics](https://developers.klaviyo.com/en/reference/custom_metrics_api_overview) are not supported in the `metric_id` filter.

Returns a maximum of 200 events per page.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m`

**Scopes:**
`events:read`

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "Events API",
    "version": "2025-01-15",
    "description": "The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.",
    "contact": {
      "name": "Klaviyo Developer Experience Team",
      "email": "developers@klaviyo.com",
      "url": "https://developers.klaviyo.com"
    },
    "termsOfService": "https://www.klaviyo.com/legal/api-terms",
    "license": {
      "name": "License",
      "url": "https://www.klaviyo.com/legal"
    }
  },
  "servers": [
    {
      "url": "https://a.klaviyo.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/events": {
      "get": {
        "operationId": "get_events",
        "summary": "Get Events",
        "description": "Get all events in an account\n\nRequests can be sorted by the following fields:\n`datetime`, `timestamp`\n\n[Custom metrics](https://developers.klaviyo.com/en/reference/custom_metrics_api_overview) are not supported in the `metric_id` filter.\n\nReturns a maximum of 200 events per page.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m`\n\n**Scopes:**\n`events:read`",
        "parameters": [
          {
            "name": "fields[event]",
            "in": "query",
            "description": "For more information please visit https://developers.klaviyo.com/en/v2025-01-15/reference/api-overview#sparse-fieldsets",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "timestamp",
                  "event_properties",
                  "datetime",
                  "uuid"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "fields[metric]",
            "in": "query",
            "description": "For more information please visit https://developers.klaviyo.com/en/v2025-01-15/reference/api-overview#sparse-fieldsets",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "name",
                  "created",
                  "updated",
                  "integration"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "fields[profile]",
            "in": "query",
            "description": "For more information please visit https://developers.klaviyo.com/en/v2025-01-15/reference/api-overview#sparse-fieldsets",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "email",
                  "phone_number",
                  "external_id",
                  "first_name",
                  "last_name",
                  "organization",
                  "locale",
                  "title",
                  "image",
                  "created",
                  "updated",
                  "last_event_date",
                  "location",
                  "location.address1",
                  "location.address2",
                  "location.city",
                  "location.country",
                  "location.latitude",
                  "location.longitude",
                  "location.region",
                  "location.zip",
                  "location.timezone",
                  "location.ip",
                  "properties"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "filter",
            "in": "query",
            "description": "For more information please visit https://developers.klaviyo.com/en/v2025-01-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`",
            "schema": {
              "type": "string",
              "example": "equals(metric_id,'example')"
            }
          },
          {
            "name": "include",
            "in": "query",
            "description": "For more information please visit https://developers.klaviyo.com/en/v2025-01-15/reference/api-overview#relationships",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "attributions",
                  "metric",
                  "profile"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "page[cursor]",
            "in": "query",
            "description": "For more information please visit https://developers.klaviyo.com/en/v2025-01-15/reference/api-overview#pagination",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "For more information please visit https://developers.klaviyo.com/en/v2025-01-15/reference/api-overview#sorting",
            "schema": {
              "type": "string",
              "enum": [
                "datetime",
                "-datetime",
                "timestamp",
                "-timestamp"
              ]
            }
          },
          {
            "name": "revision",
            "in": "header",
            "description": "API endpoint revision (format: YYYY-MM-DD[.suffix])",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2025-01-15"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/GetEventResponseCollectionCompoundDocument"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/ClientError"
          },
          "5XX": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "tags": [
          "Events"
        ],
        "x-klaviyo-pre-release": "None",
        "x-klaviyo-ratelimit": {
          "burst": "350/s",
          "steady": "3500/m"
        },
        "x-klaviyo-scopes": [
          "events:read"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "MetricEnum": {
        "type": "string",
        "enum": [
          "metric"
        ]
      },
      "FlowEnum": {
        "type": "string",
        "enum": [
          "flow"
        ]
      },
      "MetricResponseObjectResource": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/MetricEnum"
          },
          "id": {
            "description": "The Metric ID",
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "name": {
                "description": "The name of the metric",
                "type": "string"
              },
              "created": {
                "description": "Creation time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm)",
                "type": "string"
              },
              "updated": {
                "description": "Last updated time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm)",
                "type": "string"
              },
              "integration": {
                "description": "The integration associated with the event",
                "type": "object"
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/ObjectLinks"
          }
        },
        "required": [
          "type",
          "id",
          "attributes",
          "links"
        ]
      },
      "ProfileLocation": {
        "type": "object",
        "properties": {
          "address1": {
            "description": "First line of street address",
            "type": "string",
            "example": "89 E 42nd St"
          },
          "address2": {
            "description": "Second line of street address",
            "type": "string",
            "example": "1st floor"
          },
          "city": {
            "description": "City name",
            "type": "string",
            "example": "New York"
          },
          "country": {
            "description": "Country name",
            "type": "string",
            "example": "United States"
          },
          "latitude": {
            "description": "Latitude coordinate. We recommend providing a precision of four decimal places.",
            "example": "40.7128",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "longitude": {
            "description": "Longitude coordinate. We recommend providing a precision of four decimal places.",
            "example": "74.0060",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "region": {
            "description": "Region within a country, such as state or province",
            "type": "string",
            "example": "NY"
          },
          "zip": {
            "description": "Zip code",
            "type": "string",
            "example": "10017"
          },
          "timezone": {
            "description": "Time zone name. We recommend using time zones from the IANA Time Zone Database.",
            "type": "string",
            "example": "America/New_York"
          },
          "ip": {
            "description": "IP Address",
            "type": "string",
            "example": "127.0.0.1"
          }
        }
      },
      "ProfileEnum": {
        "type": "string",
        "enum": [
          "profile"
        ]
      },
      "ProfileResponseObjectResource": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ProfileEnum"
          },
          "id": {
            "description": "Primary key that uniquely identifies this profile. Generated by Klaviyo.",
            "type": "string",
            "example": "01GDDKASAP8TKDDA2GRZDSVP4H"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "email": {
                "description": "Individual's email address",
                "type": "string",
                "example": "sarah.mason@klaviyo-demo.com"
              },
              "phone_number": {
                "description": "Individual's phone number in E.164 format",
                "type": "string",
                "example": "+15005550006"
              },
              "external_id": {
                "description": "A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system.",
                "type": "string"
              },
              "first_name": {
                "description": "Individual's first name",
                "type": "string",
                "example": "Sarah"
              },
              "last_name": {
                "description": "Individual's last name",
                "type": "string",
                "example": "Mason"
              },
              "organization": {
                "description": "Name of the company or organization within the company for whom the individual works",
                "type": "string",
                "example": "Example Corporation"
              },
              "locale": {
                "description": "The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2)",
                "type": "string",
                "example": "en-US"
              },
              "title": {
                "description": "Individual's job title",
                "type": "string",
                "example": "Regional Manager"
              },
              "image": {
                "description": "URL pointing to the location of a profile image",
                "type": "string",
                "example": "https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg"
              },
              "created": {
                "description": "Date and time when the profile was created, in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm)",
                "type": "string",
                "format": "date-time",
                "example": "2022-11-08T00:00:00+00:00"
              },
              "updated": {
                "description": "Date and time when the profile was last updated, in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm)",
                "type": "string",
                "format": "date-time",
                "example": "2022-11-08T00:00:00+00:00"
              },
              "last_event_date": {
                "description": "Date and time of the most recent event the triggered an update to the profile, in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm)",
                "type": "string",
                "format": "date-time",
                "example": "2022-11-08T00:00:00+00:00"
              },
              "location": {
                "$ref": "#/components/schemas/ProfileLocation"
              },
              "properties": {
                "description": "An object containing key/value pairs for any custom properties assigned to this profile",
                "type": "object",
                "example": {
                  "pseudonym": "Dr. Octopus"
                }
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/ObjectLinks"
          }
        },
        "required": [
          "type",
          "attributes",
          "links"
        ]
      },
      "AttributionEnum": {
        "type": "string",
        "enum": [
          "attribution"
        ]
      },
      "EventEnum": {
        "type": "string",
        "enum": [
          "event"
        ]
      },
      "CampaignEnum": {
        "type": "string",
        "enum": [
          "campaign"
        ]
      },
      "CampaignMessageEnum": {
        "type": "string",
        "enum": [
          "campaign-message"
        ]
      },
      "FlowMessageEnum": {
        "type": "string",
        "enum": [
          "flow-message"
        ]
      },
      "AttributionResponseObjectResource": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/AttributionEnum"
          },
          "id": {
            "description": "The ID of the attribution",
            "type": "string",
            "example": "925e385b52fb405715f3616c337cc65c"
          },
          "relationships": {
            "type": "object",
            "properties": {
              "event": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/EventEnum"
                      },
                      "id": {
                        "description": "Event",
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ]
                  }
                }
              },
              "attributed-event": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/EventEnum"
                      },
                      "id": {
                        "description": "Attributed Event",
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ]
                  }
                }
              },
              "campaign": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/CampaignEnum"
                      },
                      "id": {
                        "description": "Attributed Campaign",
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ]
                  }
                }
              },
              "campaign-message": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/CampaignMessageEnum"
                      },
                      "id": {
                        "description": "Attributed Campaign Message",
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ]
                  }
                }
              },
              "flow": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/FlowEnum"
                      },
                      "id": {
                        "description": "Attributed Flow",
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ]
                  }
                }
              },
              "flow-message": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/FlowMessageEnum"
                      },
                      "id": {
                        "description": "Attributed Flow Message",
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ]
                  }
                }
              },
              "flow-message-variation": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/FlowMessageEnum"
                      },
                      "id": {
                        "description": "Attributed Flow Message Variation",
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ]
                  }
                }
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/ObjectLinks"
          }
        },
        "required": [
          "type",
          "id",
          "links"
        ]
      },
      "EventResponseObjectResource": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EventEnum"
          },
          "id": {
            "description": "The Event ID",
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "timestamp": {
                "description": "Event timestamp in seconds",
                "type": "integer"
              },
              "event_properties": {
                "description": "Event properties, can include identifiers and extra properties",
                "type": "object"
              },
              "datetime": {
                "description": "Event timestamp in ISO8601 format (YYYY-MM-DDTHH:MM:SS+hh:mm)",
                "type": "string",
                "format": "date-time",
                "example": "2022-11-08T01:23:45+00:00"
              },
              "uuid": {
                "description": "A unique identifier for the event, this can be used as a cursor in pagination",
                "type": "string"
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/ObjectLinks"
          }
        },
        "required": [
          "type",
          "id",
          "attributes",
          "links"
        ]
      },
      "GetEventResponseCollectionCompoundDocument": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/EventResponseObjectResource"
                },
                {
                  "properties": {
                    "relationships": {
                      "type": "object",
                      "properties": {
                        "profile": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "$ref": "#/components/schemas/ProfileEnum"
                                },
                                "id": {
                                  "description": "Profile ID of the associated profile, if available",
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type",
                                "id"
                              ]
                            },
                            "links": {
                              "$ref": "#/components/schemas/RelationshipLinks"
                            }
                          }
                        },
                        "metric": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "$ref": "#/components/schemas/MetricEnum"
                                },
                                "id": {
                                  "description": "The Metric ID",
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type",
                                "id"
                              ]
                            },
                            "links": {
                              "$ref": "#/components/schemas/RelationshipLinks"
                            }
                          }
                        },
                        "attributions": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "type",
                                  "id"
                                ],
                                "properties": {
                                  "type": {
                                    "$ref": "#/components/schemas/AttributionEnum"
                                  },
                                  "id": {
                                    "description": "Attributions for this event",
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "links": {
                              "$ref": "#/components/schemas/RelationshipLinks"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              ]
            }
          },
          "links": {
            "$ref": "#/components/schemas/CollectionLinks"
          },
          "included": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/AttributionResponseObjectResource"
                },
                {
                  "$ref": "#/components/schemas/MetricResponseObjectResource"
                },
                {
                  "$ref": "#/components/schemas/ProfileResponseObjectResource"
                }
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "RelationshipLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "format": "uri"
          },
          "related": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "self",
          "related"
        ]
      },
      "CollectionLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "format": "uri"
          },
          "first": {
            "type": "string",
            "format": "uri"
          },
          "last": {
            "type": "string",
            "format": "uri"
          },
          "prev": {
            "type": "string",
            "format": "uri"
          },
          "next": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "self"
        ]
      },
      "ObjectLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "self"
        ]
      }
    },
    "responses": {
      "ClientError": {
        "description": "Client Error",
        "content": {
          "application/vnd.api+json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "code",
                      "title",
                      "detail"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "detail": {
                        "type": "string"
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "pointer": {
                            "type": "string"
                          },
                          "parameter": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "required": [
                "errors"
              ]
            }
          }
        }
      },
      "ServerError": {
        "description": "Server Error",
        "content": {
          "application/vnd.api+json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "code",
                      "title",
                      "detail"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "detail": {
                        "type": "string"
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "pointer": {
                            "type": "string"
                          },
                          "parameter": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "required": [
                "errors"
              ]
            }
          }
        }
      }
    },
    "securitySchemes": {
      "Klaviyo-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Private key authentication for /api/ endpoints is performed by setting the `Authorization` header to `Klaviyo-API-Key your-private-api-key`<br>For more information please visit https://developers.klaviyo.com/en/v2025-01-15/reference/api-overview#authentication",
        "x-default": "Klaviyo-API-Key your-private-api-key"
      }
    }
  },
  "tags": [
    {
      "name": "Events"
    }
  ],
  "security": [
    {
      "Klaviyo-API-Key": []
    }
  ],
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": true,
    "samples-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 226,
      "2": 175,
      "3": 88,
      "4": 45,
      "5": 92,
      "6": 183,
      "7": 0,
      "8": 55,
      "9": 12,
      "10": 62,
      "11": 81
    }
  }
}
```