openapi: 3.0.3
info:
  version: 2022.03.29
  title: Klaviyo API
  description: Empowering creators to own their destiny
servers:
- description: Production
  url: https://a.klaviyo.com/api
tags:
- name: Track & Identify
  description: create & update profiles, and track user activity
- name: Metrics
  description: extract metric events data
- name: Profiles
  description: read and update profiles
- name: Lists & Segments
  description: read and update lists & segments
- name: Data Privacy
  description: manage data privacy
- name: Campaigns
  description: retrieve and update campaigns
- name: Templates
  description: retrieve and update templates
paths:
  /track:
    post:
      operationId: track-post
      summary: Track Profile Activity
      description: "This endpoint is used to track a profile's activity. The following\
        \ data is encoded in a JSON object. NOTE: an account can have up to 200 unique\
        \ metrics (event types). This endpoint can accept payloads up to approximately\
        \ 1MB.\n\n\n  **JSON OBJECT STRUCTURE:**\n\n  __token: *string*__\n  This\
        \ is your public API key.\n  \n  __event: *string*__\n  Name of the event\
        \ you want to track. \n  \n  __customer_properties: *JSON Object or null*__\n\
        \  Properties of the profile that triggered this event. You must identify\
        \ the person by their email using a $email key (or by their phone number using\
        \ a `$phone_number` key if you have SMS-only contacts). Other than that, you\
        \ can include any data you want and it can then be used to create segments\
        \ of people. For example, if you wanted to create a list of people on trial\
        \ plans, include a person's plan type in this JSON object so you can use that\
        \ information later.\n  \n  __properties: *optional; JSON Object or null*__\n\
        \  Properties of this event. Any properties included here can be used for\
        \ creating segments later For example, if you track an event called \"Ordered\
        \ Product\" you could include a property for item type (e.g. image, article,\
        \ etc.), size, etc.\n\n  __time: *optional; 10-digit UNIX timestamp or null*__\n\
        \  When this event occurred. By default, Klaviyo assumes events happen when\
        \ a request is made. If you'd like to track an event that happened in past,\
        \ use this property.\n  \n  \n  **SPECIAL FIELDS:**\n  \n  The Klaviyo CRM\
        \ has the following special fields you can set for **customer_properties**\
        \ with the **Track** endpoint, to unlock additional functionality:\n  \n \
        \ **$email:** _string_\n  **$first_name:** _string_\n  **$last_name:** _string_\n\
        \  **$phone_number:** _string; eg: \"+13239169023\"_\n  **$city:** _string_\n\
        \  **$region:** _string; state, or other region_\n  **$country:** _string_\n\
        \  **$zip:** _string_\n  **$image:** _string; url to a photo of a person_\n\
        \  **$consent:** _list of strings; eg: ['sms', 'email', 'web', 'directmail',\
        \ 'mobile']_\n  \n  You can also set the following special fields in event\
        \ **properties** with the **Track** endpoint:\n  \n  **$event_id:** _a unique\
        \ identifier for an event_\n  **$value:** _a numeric value to associate with\
        \ this event (e.g. the dollar value of a purchase)_\n  \n  **EXAMPLE:**\n\
        \  \n  ```\n  {\n    \"token\": \"PUBLIC_KEY\",\n    \"event\": \"Ordered\
        \ Product\",\n    \"customer_properties\": {\n      \"$email\": \"abraham.lincoln@klaviyo.com\"\
        \n    },\n    \"properties\": {\n      \"item_name\": \"Boots\",\n      \"\
        $value\": 100\n    }\n  }\n"
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/track_payload_post'
      tags:
      - Track & Identify
      responses:
        '200':
          $ref: '#/components/responses/200ServerSide'
    get:
      operationId: track-get
      summary: Track Profile Activity (Legacy)
      description: "This endpoint is also used to track a profile's activity. It takes\
        \ as input the same payload as the above POST request, but as a base64-encoded\
        \ string passed as a query parameter. NOTE: This is offered for backwards\
        \ compatibility; we recommend all new implementations use the POST approach\
        \ above.\n  \n  **EXAMPLE:**\n  \n  ```\n  {\n    \"token\": \"PUBLIC_KEY\"\
        ,\n    \"event\": \"Ordered Product\",\n    \"customer_properties\": {\n \
        \     \"$email\": \"abraham.lincoln@klaviyo.com\"\n    },\n    \"properties\"\
        : {\n      \"item_name\": \"Boots\",\n      \"$value\": 100\n    }\n  }\n\n\
        \  ```\n  Gets encoded into the following string, which is passed into the\
        \ `data` parameter:\n\n  `eyJ0b2tlbiI6ICJQVUJMSUNfS0VZIiwiZXZlbnQiOiAiT3JkZXJlZEl0ZW0iLCJjdXN0b21lcl9wcm9wZXJ0aWVzIjogeyIkZW1haWwiOiAiYWJyYWhhbS5saW5jb2xuQGtsYXZpeW8uY29tIn0sInByb3BlcnRpZXMiOiB7Iml0ZW1fbmFtZSI6ICJCb290cyIsIiR2YWx1ZSI6IDEwMH19`\n"
      parameters:
      - name: data
        required: true
        in: query
        description: String representation of base64 encoded JSON object
        schema:
          type: string
          example: BASE_64_STRING
      tags:
      - Track & Identify
      responses:
        '200':
          $ref: '#/components/responses/200ServerSide'
  /identify:
    post:
      operationId: identify-post
      summary: Identify Profile
      description: "This endpoint is used to track and update properties about an\
        \ individual without tracking an associated event. The following data is stored\
        \ in a JSON object.\n\n\n  **JSON OBJECT STRUCTURE:**\n\n  __token: *string*__\n\
        \  This is your public API key.\n  \n  __properties: *JSON Object or null*__\n\
        \  Properties of the profile to track/update. You must identify the person\
        \ by their email using a $email key (or by their phone number using a `$phone_number`\
        \ key if you have SMS-only contacts). Other than that, you can include any\
        \ data you want and it can then be used to create segments of people. For\
        \ example, if you wanted to create a list of people on trial plans, include\
        \ a person's plan type in this JSON object so you can use that information\
        \ later.\n  \n  \n  **SPECIAL FIELDS:**\n\n  The Klaviyo CRM has the following\
        \ special fields you can set for customer **properties** with the **Identify**\
        \ endpoint, to unlock additional functionality:\n  \n  **$email:** _string_\n\
        \  **$first_name:** _string_\n  **$last_name:** _string_\n  **$phone_number:**\
        \ _string; eg: \"+13239169023\"_\n  **$city:** _string_\n  **$region:** _string;\
        \ state, or other region_\n  **$country:** _string_\n  **$zip:** _string_\n\
        \  **$image:** _string; url to a photo of a person_\n  **$consent:** _list\
        \ of strings; eg: ['sms', 'email', 'web', 'directmail', 'mobile']_\n  \n \
        \ \n  **EXAMPLE:**\n  \n  ```\n  {\n      \"token\": \"PUBLIC_KEY\",\n   \
        \   \"properties\": {\n        \"$email\": \"abraham.lincoln@klaviyo.com\"\
        ,\n        \"$first_name\": \"Abraham\",\n        \"$last_name\": \"Lincoln\"\
        ,\n        \"$city\": \"Springfield\",\n        \"$region\": \"Illinois\"\n\
        \      }\n  }\n  \n"
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/identify_payload_post'
      tags:
      - Track & Identify
      responses:
        '200':
          $ref: '#/components/responses/200ServerSide'
    get:
      operationId: identify-get
      summary: Identify Profile (Legacy)
      description: "This endpoint is also used to identify a profile and update its\
        \ properties without an associated event. It takes as input the same payload\
        \ as the above POST request, but as a base64-encoded string passed as a query\
        \ parameter. NOTE: This is offered for backwards compatibility; we recommend\
        \ all new implementations use the POST approach above.\n\n  **EXAMPLE:**\n\
        \  \n  ```\n  {\n      \"token\": \"PUBLIC_KEY\",\n      \"properties\": {\n\
        \        \"$email\": \"abraham.lincoln@klaviyo.com\",\n        \"$first_name\"\
        : \"Abraham\",\n        \"$last_name\": \"Lincoln\",\n        \"$city\": \"\
        Springfield\",\n        \"$region\": \"Illinois\"\n      }\n  }\n  ```\n \
        \ Gets encoded into the following string, which is passed into the `data`\
        \ parameter:\n\n  `eyJ0b2tlbiI6ICJQVUJMSUNfS0VZIiwicHJvcGVydGllcyI6IHsiJGVtYWlsIjogImFicmFoYW0ubGluY29sbkBrbGF2aXlvLmNvbSIsIiRmaXJzdF9uYW1lIjogIkFicmFoYW0iLCIkbGFzdF9uYW1lIjogIkxpbmNvbG4iLCIkY2l0eSI6ICJTcHJpbmdmaWVsZCIsIiRyZWdpb24iOiAiSWxsaW5vaXMifX0K`\n\
        \n  \n"
      parameters:
      - name: data
        required: true
        in: query
        description: String representation of base64 encoded JSON object
        schema:
          type: string
          example: BASE_64_STRING
      tags:
      - Track & Identify
      responses:
        '200':
          $ref: '#/components/responses/200ServerSide'
  /v1/metrics:
    get:
      security:
      - ApiKeyAuth: []
      operationId: get-metrics
      summary: Get Metrics Info
      description: Returns a list of all the metrics in your account.
      parameters:
      - name: page
        in: query
        description: For pagination, which page of results to return. Default = 0
        schema:
          type: integer
          minimum: 0
          example: 0
      - name: count
        in: query
        description: For pagination, the number of results to return. Default = 50
          ; Max = 100
        schema:
          type: integer
          minimum: 1
          maximum: 100
          example: 50
      tags:
      - Metrics
      responses:
        '200':
          description: A JSON object with a data property that contains an array of
            all the metrics. Each entry is a separate metric object. If no metrics
            exist, the resulting array will be empty. This request should never return
            an error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                  data:
                    type: array
                    minItems: 1
                    maxItems: 100
                    items:
                      $ref: '#/components/schemas/metric'
                  page:
                    type: integer
                  start:
                    type: integer
                  end:
                    type: integer
                  total:
                    type: integer
                  page_size:
                    type: integer
                additionalProperties: true
                example:
                  object: $list
                  data:
                  - object: metric
                    id: METRIC_ID
                    name: Active on Site
                    integration:
                      object: integration
                      id: INTEGRATION_ID
                      name: API
                      category: API
                    created: 2020-11-03 17:28:09
                    updated: 2020-11-03 17:28:09
                  page: 0
                  start: 0
                  end: 1
                  total: 1
                  page_size: 1
  /v1/metrics/timeline:
    get:
      security:
      - ApiKeyAuth: []
      operationId: metrics-timeline
      summary: Get Events for All Metrics
      description: Returns a batched timeline of all events in your account.
      parameters:
      - name: since
        in: query
        description: Either a 10-digit Unix timestamp (UTC) to use as starting datetime,
          OR a pagination token obtained from the next attribute of a prior API call.
          For backwards compatibility, UUIDs will continue to be supported for a limited
          time. Defaults to current time.
        schema:
          type: string
          example: ''
      - name: count
        in: query
        description: Number of events to return in a batch. Default = 50, Max = 100
        schema:
          type: integer
          minimum: 1
          maximum: 100
          example: 50
      - name: sort
        in: query
        description: Sort order to apply to timeline, either descending or ascending.
          Valid values are `desc` or `asc`. Defaults to `desc`. Always descending
          when `since` is not sent, as `since` defaults to current time.
        schema:
          type: string
          example: desc
      tags:
      - Metrics
      responses:
        '200':
          description: A JSON object containing a list of metric event objects. Each
            event object contains information about what metric the event tracks,
            which person the event is related to, and any extra properties about the
            event. The next attribute should be passed as the since parameter to subsequent
            API calls to fetch the next batch of events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metric_timeline'
  /v1/metric/{metric_id}/timeline:
    get:
      security:
      - ApiKeyAuth: []
      operationId: metric-timeline
      summary: Get Events for a Specific Metric
      description: Returns a batched timeline for one specific metric.
      parameters:
      - name: metric_id
        required: true
        in: path
        schema:
          type: string
          example: METRIC_ID
      - name: since
        in: query
        description: Either a 10-digit Unix timestamp (UTC) to use as starting datetime,
          OR a pagination token obtained from the `next` attribute of a prior API
          call. For backwards compatibility, UUIDs will continue to be supported for
          a limited time. Defaults to current time.
        schema:
          type: string
          example: ''
      - name: count
        in: query
        description: Number of events to return in a batch. Max = 100
        schema:
          type: integer
          minimum: 1
          maximum: 100
          example: 100
      - name: sort
        in: query
        description: Sort order to apply to timeline, either descending or ascending.
          Valid values are `desc` or `asc`. Defaults to `desc`. Always descending
          when `since` is not sent, as `since` defaults to current time.
        schema:
          type: string
          example: desc
      tags:
      - Metrics
      responses:
        '200':
          description: A JSON object containing a list of metric event objects. Each
            event object contains information about what metric the event tracks,
            which person the event is related to, and any extra properties about the
            event. The next attribute should be passed as the since parameter to subsequent
            API calls to fetch the next batch of events. If there are no more pages
            of events, `next` = `null`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metric_timeline'
  /v1/metric/{metric_id}/export:
    get:
      security:
      - ApiKeyAuth: []
      operationId: metric-export
      summary: Query Event Data
      description: 'Exports event data from Klaviyo, optionally filtering and segmenting
        on available event properties. Note that the only comparison operator currently
        supported is `=`. To ensure a correct response, enter parameters in the curl
        request as they are ordered below:'
      parameters:
      - name: metric_id
        required: true
        in: path
        schema:
          type: string
          example: METRIC_ID
      - name: start_date
        required: false
        in: query
        description: |2

          Beginning of timeframe to pull event data for. The default value is 1 month ago. Can also accept a 10-digit UNIX timestamp. When sending a `start_date`, you must also send an `end_date`

          Ex: `1610524800` OR `2021-01-13`
        schema:
          type: string
          example: ''
      - name: end_date
        required: false
        in: query
        description: |2

          End of timeframe to pull event data for. The default is the current day, or 1 month from start_date, whichever is sooner. Can also accept a 10-digit UNIX timestamp. When sending an `end_date`, you must also send a `start_date`. Must be *at most* 31 days after `start_date`

          Ex: `1612080000` OR `2021-01-31`
        schema:
          type: string
          example: ''
      - name: unit
        required: false
        in: query
        description: Granularity to bucket data points into - one of `day`, `week`,
          or `month`. Defaults to `day`.
        schema:
          type: string
          example: day
      - name: measurement
        required: false
        in: query
        description: |2

          Type of metric to fetch - one of `unique`, `count`, `value`, or `sum`. Defaults to `count`. For `sum` a property name to operate on must be supplied as a JSON-encoded list like `["sum","ItemCount"]`
        schema:
          type: string
          example: count
      - name: where
        in: query
        description: |
          Optional, JSON-encoded list. Conditions to use to filter the set of events. A max of 1 condition can be given. `where` and `by` parameters cannot be specified at the same time.

          ex: `[["$attributed_flow","=","FLOW_ID"]]`
        required: false
        schema:
          type: string
          example: '[["$attributed_flow","=","FLOW_ID"]]'
      - name: by
        in: query
        description: The name of a property to segment the event data on. `where`
          and `by` parameters cannot be specified at the same time. Cannot be used
          alongside `where` parameter.
        required: false
        schema:
          type: string
          example: $attributed_flow
      - name: count
        in: query
        required: false
        description: Maximum number of segments to return. Default = 25, **MAX = 1000**
        schema:
          type: integer
          example: 25
          minimum: 1
          maximum: 1000
      tags:
      - Metrics
      responses:
        '200':
          description: A JSON object relecting the input request parameters as well
            as a results property that contains a list of dictionaries - one per segment
            of the result set. Within each of those dictionaries is the name of the
            segment as well as a data property that is a list of the data points for
            that segment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metric_export'
  /v2/people/search:
    get:
      summary: Get Profile ID
      tags:
      - Profiles
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: KLAVIYO_PROFILE_ID
      operationId: get-profile-id
      description: 'Get a profile''s Klaviyo ID given exactly one corresponding identifier:
        `email`, `phone_number`, or `external_id`. NOTE: calling this endpoint with
        multiple identifiers will result in an error.'
      security:
      - ApiKeyAuth: []
      parameters:
      - schema:
          type: string
          format: email
        in: query
        name: email
      - schema:
          type: string
        in: query
        name: phone_number
      - schema:
          type: string
        in: query
        name: external_id
  /v1/person/{person_id}:
    get:
      security:
      - ApiKeyAuth: []
      operationId: get-profile
      summary: Get Profile
      description: Retrieves all the data attributes for a person, based on the Klaviyo
        Person ID.
      parameters:
      - name: person_id
        required: true
        in: path
        schema:
          type: string
          example: PERSON_ID
      tags:
      - Profiles
      responses:
        '200':
          description: Returns a Person object. Any attributes that start with '$'
            are special Klaviyo attributes. With the exception of 'id' and 'object',
            any attributes that do no start with '$' are your custom-defined attributes.
            Only returns fields that are defined for given profile.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/person'
    put:
      security:
      - ApiKeyAuth: []
      operationId: update-profile
      summary: Update Profile
      description: |
        NOTE: If you are interested in creating or updating profiles in Klaviyo, you should be using the Identify API instead. The best use-case for this route is changing a profiles's email address or other primary identifier after a profile already exists in Klaviyo.

        Add or update one more more attributes for a Person, based on the Klaviyo Person ID. If a property already exists, it will be updated. If a property is not set for that record, it will be created.

        You can update any attribute, by sending one or more attributes along their new values, as query parameters. Recommended attributes for this endpoint: `$email`, `$phone_number`, `$id`
      parameters:
      - name: person_id
        required: true
        in: path
        schema:
          type: string
          example: PERSON_ID
      - in: query
        name: params
        schema:
          type: object
          additionalProperties: true
          example:
            $email: george.washington@klaviyo.com
            $phone_number: 13239169023
            $id: EXTERNAL_ID
        style: form
        explode: true
      tags:
      - Profiles
      responses:
        '200':
          description: Returns an updated Person object. Any attributes that start
            with $ are special Klaviyo attributes. With the exception of id and object,
            any attributes that do not start with $ are your custom properties.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/person'
  /v2/people/exchange:
    post:
      security:
      - ApiKeyAuth: []
      operationId: exchange
      summary: Exchange ID for Profile ID
      description: |-
        Klaviyo's web tracking uses an encrypted identifier. However, there are many use cases that require developers to have access to a given profile's email or phone number. In such cases, developers can use this operation to exchange an encrypted identifier for a profile ID, which they can then use to retrieve the full profile data (by making a subsequent request to the `get-profiles` operation).

        The `exchange_id` takes the following form:

        `<IDENTIFIER>.<COMPANY_ID>`

        The `exchange_id` appears in the url as follows:

        `?_kx=<IDENTIFIER>.<COMPANY_ID>`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                exchange_id:
                  type: string
                  example: EXCHANGE_ID
              required:
              - exchange_id
      tags:
      - Profiles
      responses:
        '200':
          description: Returns a JSON object containing a single Profile ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: PROFILE_ID
                additionalProperties: true
                example:
                  id: PROFILE_ID
  /v1/person/{person_id}/metrics/timeline:
    get:
      security:
      - ApiKeyAuth: []
      operationId: profile-metrics-timeline
      summary: Get Profile's Events for all Metrics
      description: Returns a batched timeline of all events for a person.
      parameters:
      - name: person_id
        required: true
        in: path
        schema:
          type: string
          example: PERSON_ID
      - name: since
        in: query
        description: Either a 10-digit Unix timestamp (UTC) to use as starting datetime,
          OR a pagination token obtained from the next attribute of a prior API call.
          For backwards compatibility, UUIDs will continue to be supported for a limited
          time. Defaults to current time.
        schema:
          type: string
          example: ''
      - name: count
        in: query
        description: Number of events to return in a batch. Default = 50, Max = 100
        schema:
          type: integer
          minimum: 1
          maximum: 100
          example: 50
      - name: sort
        in: query
        description: Sort order to apply to timeline, either descending or ascending.
          Valid values are `desc` or `asc`. Defaults to `desc`. Always descending
          when `since` is not sent, as `since` defaults to current time.
        schema:
          type: string
          example: desc
      tags:
      - Profiles
      responses:
        '200':
          description: A JSON object containing a list of metric event objects. Each
            event object contains information about what metric the event tracks,
            which person the event is related to, and any extra properties about the
            event. The next attribute should be passed as the since parameter to subsequent
            API calls to fetch the next batch of events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metric_timeline'
  /v1/person/{person_id}/metric/{metric_id}/timeline:
    get:
      security:
      - ApiKeyAuth: []
      operationId: profile-metric-timeline
      summary: Get Profile's Events for a Specific Metric
      description: Returns a person's batched timeline for one specific event type.
      parameters:
      - name: person_id
        required: true
        in: path
        schema:
          type: string
          example: PERSON_ID
      - name: metric_id
        required: true
        in: path
        schema:
          type: string
          example: METRIC_ID
      - name: since
        in: query
        description: Either a 10-digit Unix timestamp (UTC) to use as starting datetime,
          OR a pagination token obtained from the next attribute of a prior API call.
          For backwards compatibility, UUIDs will continue to be supported for a limited
          time. Defaults to current time.
        schema:
          type: string
          example: ''
      - name: count
        in: query
        description: Number of events to return in a batch.
        schema:
          type: integer
          minimum: 1
          maximum: 100
          example: 100
      - name: sort
        in: query
        description: Sort order to apply to timeline, either descending or ascending.
          Valid values are `desc` or `asc`. Defaults to `desc`.
        schema:
          type: string
          example: desc
      tags:
      - Profiles
      responses:
        '200':
          description: A JSON object containing a list of metric event objects. Each
            event object contains information about what metric the event tracks,
            which person the event is related to, and any extra properties about the
            event. The next attribute should be passed as the since parameter to subsequent
            API calls to fetch the next batch of events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metric_timeline'
  /v2/segment/{segment_id}/get-members:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: get-segment-members
      summary: Check if Profiles Are in a Segment
      description: Checks if one or more emails, phone numbers, or push tokens are
        in a given segment. No distinction is made between a person not being in a
        given segment, and not being present in Klaviyo at all. Can check up to a
        maximum of 100 emails at a time.
      parameters:
      - name: segment_id
        required: true
        in: path
        schema:
          type: string
          example: SEGMENT_ID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/check_membership_request'
      responses:
        '200':
          description: An array of Membership objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/check_membership_response'
  /v2/list/{list_id}/get-members:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: get-list-members
      summary: Check if Profiles Are in a List
      description: Checks if one or more emails, phone numbers, or push tokens are
        in a given list. No distinction is made between a person not being in a given
        list, and not being present in Klaviyo at all. Can check up to a maximum of
        100 emails at a time.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/check_membership_request'
      responses:
        '200':
          description: An array of Membership objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/check_membership_response'
  /v2/list/{list_id}/get-list-subscriptions:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: get-list-subscriptions
      summary: Check if Profiles Are in a List and not Suppressed
      description: Checks if one or more emails are in a given list and not suppressed.
        No distinction is made between a person not being in a given list, and not
        being present in Klaviyo at all. Can check up to a maximum of 100 emails at
        a time.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/check_membership_request'
      responses:
        '200':
          description: An array of Membership objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/check_membership_response'
  /v1/people/exclusions:
    get:
      security:
      - ApiKeyAuth: []
      operationId: get-global-exclusions
      summary: Get Global Exclusions & Unsubscribes
      description: Returns global exclusions/unsubscribes. Global exclusions are distinct
        from list exclusions in that these email addresses will not receive any emails
        from any list. Typically, when someone unsubscribes from a campaign, they
        are only unsubscribed from that list and are not globally unsubscribed.
      parameters:
      - name: reason
        in: query
        description: Filter results based on the reason for someone being excluded.
          The possible values are `unsubscribed`, `bounced`, `invalid_email`, `reported_spam`
          and `manually_excluded`. Only a single value may be specified at a time.
          Defaults to return all profiles regardless of reason.
        schema:
          type: string
          example: ''
      - name: sort
        in: query
        description: Sort order to apply to results, either ascending or descending.
          Valid values are `asc` or `desc`. Defaults to `asc`.
        schema:
          type: string
          example: asc
      - name: count
        in: query
        description: For pagination, the number of results to return. Default = 500
        schema:
          type: integer
          example: 500
      - name: page
        in: query
        description: For pagination, which page of results to return. Default = 0
        schema:
          type: integer
          example: 0
      tags:
      - Lists & Segments
      responses:
        '200':
          description: An array of Exclusion objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/global_exclusion_response_data'
    post:
      security:
      - ApiKeyAuth: []
      operationId: exclude-globally
      summary: Exclude Profile From All Email
      description: Marks a person as excluded from all email. This works the same
        way as manually excluding someone via the excluded people page. Someone who
        is excluded will no longer receive any campaigns or flow emails.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                email:
                  type: string
                  example: george.washington@klaviyo.com
              required:
              - email
      tags:
      - Lists & Segments
      responses:
        '200':
          description: An already_excluded flag that indicates whether this individual
            was already unsubscribed from all email.
          content:
            application/json:
              schema:
                type: object
                properties:
                  already_excluded:
                    type: boolean
                    example: true
                  num_excluded:
                    type: integer
                    example: 0
                additionalProperties: true
              example:
                already_excluded: true
                num_excluded: 0
  /v2/lists:
    post:
      security:
      - ApiKeyAuth: []
      operationId: create-list
      summary: Create List
      description: Creates a new list.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                list_name:
                  type: string
                  example: MyNewList
              additionalProperties: true
              required:
              - list_name
      tags:
      - Lists & Segments
      responses:
        '200':
          description: Returns the list_id of the newly created list
          content:
            application/json:
              schema:
                type: object
                properties:
                  list_id:
                    type: string
                    example: LIST_ID
                additionalProperties: true
              example:
                list_id: LIST_ID
    get:
      security:
      - ApiKeyAuth: []
      operationId: get-lists
      summary: Get Lists
      description: Returns a listing of all of the lists in an account.
      tags:
      - Lists & Segments
      responses:
        '200':
          description: Successful requests will include a list of JSON objects containing
            the list ID and name for each list. Invalid requests will be accompanied
            by an error message.
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                items:
                  type: object
                  properties:
                    list_id:
                      type: string
                    list_name:
                      type: string
                  additionalProperties: true
                example:
                - list_id: LIST_ID_1
                  list_name: MyFirstList
                - list_id: LIST_ID_2
                  list_name: MySecondList
  /v2/list/{list_id}:
    get:
      security:
      - ApiKeyAuth: []
      operationId: get-list-info
      summary: Get List Info
      description: Returns information about a list.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      tags:
      - Lists & Segments
      responses:
        '200':
          description: Successful requests will include a JSON object containing information
            about the list. Invalid requests will be accompanied by an error message.
          content:
            application/json:
              schema:
                type: object
                properties:
                  list_name:
                    type: string
                    example: MyFirstList
                  folder:
                    type: string
                    example: ''
                  created:
                    type: string
                    example: 2018-07-03T13:44:38Z
                  updated:
                    type: string
                    example: 2018-08-03T13:44:38Z
                additionalProperties: true
                example:
                  list_name: MyList
                  folder_name: ''
                  created: 2021-11-04T11:07:09Z
                  updated: 2021-11-04T11:48:14Z
    put:
      security:
      - ApiKeyAuth: []
      operationId: update-list-name
      summary: Update List Name
      description: Updates a list's name.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                list_name:
                  type: string
                  example: MyRenamedList
              additionalProperties: false
              required:
              - list_name
      tags:
      - Lists & Segments
      responses:
        '200':
          $ref: '#/components/responses/200ok'
    delete:
      security:
      - ApiKeyAuth: []
      operationId: delete-list
      summary: Delete List
      description: Deletes a list from an account. This is a destructive operation
        and cannot be undone. It will also remove flow triggers associated with the
        list.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      tags:
      - Lists & Segments
      responses:
        '200':
          $ref: '#/components/responses/200ok'
  /v2/list/{list_id}/subscribe:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: subscribe
      summary: Subscribe Profiles to List
      description: 'Subscribes profiles to a list. Profiles will be single or double
        opted into the specified list in accordance with that list’s settings. **Note:**
        If you have double opt-in enabled (default behavior), users will not be added
        to list until they opt-in, and so API will respond with an empty list: `[]`'
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: 'The profiles that you would like to subscribe. Each object
                in the list must have either an email or phone number key. You can
                also provide additional properties as key-value pairs. If you are
                a GDPR compliant business, you will need to include `$consent` in
                your API call. `$consent` is a list-type, Klaviyo special property
                and only accepts some subset of the following: `["email", "web", "sms",
                "directmail", "mobile"]`. If you are updating consent for a phone
                number or would like to send an opt-in SMS to the profile (for double
                opt-in lists), include an `sms_consent` key in the profile with a
                value of `true` or `false`.'
              properties:
                profiles:
                  type: array
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                      phone_number:
                        type: string
                      first_name:
                        type: string
                      last_name:
                        type: string
                      sms_consent:
                        type: boolean
                    additionalProperties: true
                  example:
                  - email: george.washington@klaviyo.com
                  - phone_number: +13239169023
                    sms_consent: true
              required:
              - profiles
      responses:
        '200':
          description: Successful requests will return with HTTP OK responses. If
            the list is single opt-in then a list of records containing the email
            address, phone number, push token, and the corresponding profile ID will
            also be included. Invalid requests will be accompanied by an error message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list_subscribe_post_response_data'
              examples:
                Double Opt-In Success:
                  summary: double opt-in success
                  value: []
                Single Opt-In Success:
                  summary: single opt-in success
                  value:
                  - id: PERSON_ID_1
                    email: george.washington@klaviyo.com
                  - id: PERSON_ID_2
                    phone_number: +13239169023
    delete:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: unsubscribe
      summary: Unsubscribe Profiles From List
      description: Unsubscribes and removes profiles from a list.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      requestBody:
        description: Unsubscribe and remove profiles from a list.
        content:
          application/json:
            schema:
              type: object
              description: Profiles is an object containing `emails`, `phone_numbers`,
                and `push_tokens`. Each is an array of strings. Profiles with corresponding
                values will be removed from this list.
              properties:
                emails:
                  type: array
                  minItems: 0
                  items:
                    type: string
                phone_numbers:
                  type: array
                  minItems: 0
                  items:
                    type: string
                push_tokens:
                  type: array
                  minItems: 0
                  items:
                    type: string
              additionalProperties: true
              example:
                emails:
                - george.washington@klaviyo.com
                - john.adams@klaviyo.com
                phone_numbers:
                - +13239169023
                push_tokens:
                - PUSH_TOKEN
      responses:
        '200':
          $ref: '#/components/responses/200ok'
  /v2/list/{list_id}/members:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: add-members
      summary: Add Members to a List
      description: Adds profiles to a list. This endpoint is functionally equivalent
        to adding profiles to a list via a CSV upload and will immediately add profiles
        to the list. If you would like to subscribe profiles to a list and use the
        double opt-in settings for the list, please use the subscribe endpoint.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: The profiles that you would like to add to the list. Each
                object in the array must have an `email` or `phone_number`. You can
                also provide additional properties as key-value pairs.
              properties:
                profiles:
                  type: array
                  minItems: 0
                  maxItems: 100
                  items:
                    type: object
                    additionalProperties: true
                  example:
                  - email: george.washington@klaviyo.com
                  - phone_number: +13239169023
              required:
              - profiles
      responses:
        '200':
          description: Successful requests will return with HTTP OK responses and
            a list of records containing the corresponding profile ID, email address,
            phone number, and push token. Invalid requests will be accompanied by
            an error message.
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 100
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    email:
                      type: string
                    phone_number:
                      type: string
                  additionalProperties: true
              example:
              - id: PERSON_ID_1
                email: george.washington@klaviyo.com
              - id: PERSON_ID_2
                email: thomas.jefferson@klaviyo.com
                phone_number: +13239169023
              - id: PERSON_ID_3
                email: abraham.lincoln@klaviyo.com
                phone_number: +12028837032
    delete:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: remove-members
      summary: Remove Profiles From List
      description: Removes profiles from a list.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                emails:
                  type: array
                  minItems: 0
                  items:
                    type: string
                  example:
                  - george.washington@klaviyo.com
                  - abraham.lincoln@klaviyo.com
                phone_numbers:
                  type: array
                  minItems: 0
                  items:
                    type: string
                  example:
                  - +13239169023
                push_tokens:
                  type: array
                  minItems: 0
                  items:
                    type: string
                  example:
                  - PUSH_TOKEN
      responses:
        '200':
          $ref: '#/components/responses/200ok'
  /v2/list/{list_id}/exclusions/all:
    get:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: get-list-exclusions
      summary: Get All Exclusions for a List
      description: Gets all of the emails and phone numbers that have been excluded
        from a list along with the exclusion reasons and exclusion time. This endpoint
        uses batching to return the records, so for a large list multiple calls will
        need to be made to get all of the records.
      parameters:
      - name: list_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_ID
      - name: marker
        in: query
        description: A marker value returned by a previous GET call. Use this to grab
          the next batch of records.
        schema:
          type: integer
          example: 123456
      responses:
        '200':
          description: Successful requests will include a list of JSON objects containing
            an excluded email, the reason it is marked excluded, and the exclusion
            date and potentially a marker if there are more records available. If
            the profile has a valid phone number, it is returned as well, along with
            the phone_reason for phone numbers with revoked consent. Invalid requests
            will be accompanied by an error message.
          content:
            application/json:
              schema:
                type: object
                properties:
                  records:
                    type: array
                    minItems: 0
                    maxItems: 100
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        email:
                          type: string
                        reason:
                          type: string
                        phone_number:
                          type: string
                        phone_reason:
                          type: string
                      additionalProperties: true
                  marker:
                    type: integer
                    example: 123456
                additionalProperties: true
              example:
                records:
                - id: PERSON_ID_1
                  email: george.washington@klaviyo.com
                  reason: Bounced
                  created: 2018-07-03T13:44:38Z
                - id: PERSON_ID_2
                  email: thomas.jefferson@klaviyo.com
                  reason: Unsubscribed
                  phone_number: +13239169023
                  phone_reason: Unsubscribed
                marker: 123456
  /v2/group/{list_or_segment_id}/members/all:
    get:
      security:
      - ApiKeyAuth: []
      tags:
      - Lists & Segments
      operationId: get-members
      summary: Get List and Segment Members
      description: Gets all of the emails, phone numbers, and push tokens for profiles
        in a given list or segment
      parameters:
      - name: list_or_segment_id
        required: true
        in: path
        schema:
          type: string
          example: LIST_OR_SEGMENT_ID
      - name: marker
        in: query
        description: A marker value returned by a previous GET call. Use this to grab
          the next batch of records.
        schema:
          type: integer
          example: 123456
      responses:
        '200':
          description: Successful requests will include a JSON object containing a
            list of records containing profile IDs, emails, phone numbers, push tokens,
            and potentially a marker if there are more records available. Invalid
            requests will be accompanied by an error message.
          content:
            application/json:
              schema:
                type: object
                properties:
                  records:
                    type: array
                    minItems: 0
                    maxItems: 100
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        email:
                          type: string
                        phone_number:
                          type: string
                        push_token:
                          type: string
                      additionalProperties: true
                  marker:
                    type: integer
                    example: 123456
                additionalProperties: true
              example:
                records:
                - id: PERSON_ID_1
                  email: george.washington@klaviyo.com
                - id: PERSON_ID_2
                  email: thomas.jefferson@klaviyo.com
                  phone_number: +13239169023
                  push_token: 03df25c845d460bcdad7802d2vf6fc1dfde97283bf75cc993eb6dca835ea2e2r
                marker: 456789
  /v2/data-privacy/deletion-request:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Data Privacy
      operationId: request-deletion
      summary: Request a Deletion
      description: "Request a data privacy-compliant deletion for the person record\
        \ corresponding to an email address, phone number, or person identifier. \n\
        \n**If multiple person records exist for the provided identifier, only one\
        \ of them will be deleted.**\n\nThe arguments should be sent as content type\
        \ application/json.         \n\nNote that only **one** identifier (email,\
        \ phone_number, or person_id) can be specified.\n\nIn addition to your Private\
        \ API key, you need to set exactly one of the following parameters: `email`,\
        \ `phone_number`, `or person_id`, along with the associated `string` value.\
        \ \n\nExamples:\n\nEmail:\n\n  `{\"email\":\"abraham.lincoln@klaviyo.com\"\
        }`\n  \nPhone Number:\n  \n  `{\"phone_number\":\"+13239169023\"}`\n  \nPerson\
        \ ID:\n  \n  `{\"person_id\":\"PERSON_ID\"}`\n"
      requestBody:
        content:
          application/json:
            schema:
              type: string
              format: blob
            examples:
              email:
                summary: email
                value:
                  email: abraham.lincoln@klaviyo.com
              phone_number:
                summary: phone_number
                value:
                  phone_number: +13239169023
              person_id:
                summary: person_id
                value:
                  person_id: PERSON_ID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: string
                example: Submitted new deletion task for customer.
  /v1/campaigns:
    get:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: get-campaigns
      summary: Get Campaigns
      description: Returns a list of all the campaigns you've created. The campaigns
        are returned in reverse sorted order by the time they were created.
      parameters:
      - name: page
        in: query
        description: For pagination, which page of results to return. Default = 0
        schema:
          type: integer
          example: 0
          minimum: 0
      - name: count
        in: query
        description: For pagination, the number of results to return. Max = 100
        schema:
          type: integer
          example: 100
          minimum: 1
          maximum: 100
      responses:
        '200':
          description: A JSON object with a data property that contains an array of
            all the campaigns. Each entry is a separate Campaign object. If no campaigns
            exist, the resulting array will be empty. This request should never return
            an error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: $list
                  data:
                    type: array
                    minItems: 0
                    items:
                      $ref: '#/components/schemas/campaign'
                  start:
                    type: integer
                    example: '0'
                  end:
                    type: integer
                    example: '0'
                  page:
                    type: integer
                    example: '0'
                  total:
                    type: integer
                    example: '1'
                  page_size:
                    type: integer
                    example: '1'
                additionalProperties: true
                example:
                  object: $list
                  data:
                  - object: campaign
                    id: CAMPAIGN_ID
                    name: Campaign Name
                    subject: Company Monthly Newsletter
                    from_email: george.washington@klaviyo.com
                    from_name: George Washington
                    list_id: erRoOX
                    template:
                      object: email-template
                      id: TEMPLATE_ID
                      html: <html><body><p>This is the email content</p></body></html>
                    status: draft
                    sent_at: 2020-12-02 18:45:04
                    created: 2020-12-01 18:45:04
                  page: 0
                  start: 1
                  end: 1
                  total: 25
                  page_size: 1
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: create-campaign
      summary: Create New Campaign
      description: Creates a new campaign. The created campaign is a draft and is
        not automatically sent.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                list_id:
                  type: string
                  example: LIST_ID
                  description: The list you will send the campaign to.
                template_id:
                  type: string
                  example: TEMPLATE_ID
                  description: |2

                    The template that will define the content of the page. Note: the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign.
                from_email:
                  type: string
                  example: george.washington@klaviyo.com
                  description: The email address your email will be sent from and
                    will be used in the `reply-to` header.
                from_name:
                  type: string
                  example: George Washington
                  description: The name or label associated with the email address
                    you're sending from.
                subject:
                  type: string
                  example: Happy Fourth!
                  description: The email subject of the campaign
                name:
                  type: string
                  example: Campaign Name
                  description: If not specified, this will default to the subject
                    of the campaign.
                use_smart_sending:
                  type: boolean
                  example: true
                  description: If set, limits the number of emails sent to an individual
                    within a short period. Valid values are `true` and `false`. If
                    not specified, defaults to `true`.
                add_google_analytics:
                  type: boolean
                  example: false
                  description: If specified, adds Google Analytics tracking tags to
                    links. Valid values are `true` and `false`. If not specified,
                    defaults to `false`.
              required:
              - list_id
              - template_id
              - from_email
              - subject
              - from_name
      responses:
        '200':
          description: The newly created Campaign object with summary information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/campaign'
  /v1/campaign/{campaign_id}:
    get:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: get-campaign-info
      summary: Get Campaign Info
      description: Returns summary information for the campaign specified.
      parameters:
      - name: campaign_id
        required: true
        in: path
        schema:
          type: string
          example: CAMPAIGN_ID
      responses:
        '200':
          description: The Campaign object with summary information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/campaign'
    put:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: update-campaign
      summary: Update Campaign
      description: Updates details of a campaign. You can update a campaign's name,
        subject, from email address, from name, template or list.
      parameters:
      - name: campaign_id
        required: true
        in: path
        schema:
          type: string
          example: CAMPAIGN_ID
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                list_id:
                  type: string
                  example: LIST_ID
                  description: The list you will send the campaign to.
                template_id:
                  type: string
                  example: TEMPLATE_ID
                  description: The ID of the Email Template object that will be the
                    content of this campaign. Note the Email Template is copied when
                    creating this campaign, so future changes to that Email Template
                    will not alter the content of this campaign.
                from_email:
                  type: string
                  example: george.washington@klaviyo.com
                  description: The email address your email will be sent from and
                    will be used in the reply-to header.
                from_name:
                  type: string
                  example: George Washington
                  description: The name or label associated with the email address
                    you're sending from.
                subject:
                  type: string
                  example: Happy Fourth!
                  description: The email subject of the campaign
                name:
                  type: string
                  example: Campaign Name
                  description: A name for this campaign. If not specified, this will
                    default to the subject of the campaign.
                use_smart_sending:
                  type: boolean
                  example: true
                  description: If set, limits the number of emails sent to an individual
                    within a short period. Campaigns initially default to `true`.
                add_google_analytics:
                  type: boolean
                  example: false
                  description: If specified, adds Google Analytics tracking tags to
                    links. Campaigns initially default to `false`.
      responses:
        '200':
          description: The Campaign object with summary information including updated
            details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/campaign'
  /v1/campaign/{campaign_id}/send:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: send-campaign
      summary: Send a Campaign Immediately
      description: Queues a campaign for immediate delivery
      parameters:
      - name: campaign_id
        required: true
        in: path
        schema:
          type: string
          example: CAMPAIGN_ID
      responses:
        '200':
          description: A JSON object with a single key status which should be queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: queued
                additionalProperties: true
                example:
                  status: queued
  /v1/campaign/{campaign_id}/schedule:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: schedule-campaign
      summary: Schedule a Campaign
      description: Schedules a campaign for a time in the future
      parameters:
      - name: campaign_id
        required: true
        in: path
        schema:
          type: string
          example: CAMPAIGN_ID
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                send_time:
                  type: string
                  example: 2022-01-13 00:00:00
                  description: |2

                    A timestamp of the format `%Y-%m-%d %H:%M:%S` in the UTC timezone.

                    Ex:

                    `2022-01-13 00:00:00`
              required:
              - send_time
      responses:
        '200':
          description: A JSON object with a single key status which should be queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: queued
                additionalProperties: true
                example:
                  status: queued
  /v1/campaign/{campaign_id}/cancel:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: cancel-campaign
      summary: Cancel a Campaign
      description: Cancels a campaign send. Marks a campaign as cancelled regardless
        of it's current status.
      parameters:
      - name: campaign_id
        required: true
        in: path
        schema:
          type: string
          example: CAMPAIGN_ID
      responses:
        '200':
          description: The Campaign object with summary information including updated
            details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/campaign'
              example:
                object: campaign
                id: dqQnNW
                name: Campaign Name
                subject: Company Monthly Newsletter
                from_email: george.washington@klaviyo.com
                from_name: George Washington
                list_id: erRoOX
                template:
                  object: email-template
                  id: TEMPLATE_ID
                  html: <html><body><p>This is the email content</p></body></html>
                status: cancelled
                sent_at: null
                created: 2020-06-14 12:00:00
  /v1/campaign/{campaign_id}/clone:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: clone-campaign
      summary: Clone a Campaign
      description: Creates a copy of a campaign. The new campaign starts as a draft.
      parameters:
      - name: campaign_id
        required: true
        in: path
        schema:
          type: string
          example: CAMPAIGN_ID
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: Cloned Campaign
                  description: The name for the new campaign. All other properties
                    of the campaign will remain the same. Note, the template for the
                    new campaign will be cloned from the existing template so changes
                    to the existing campaign's content will not alter the content
                    of the new campaign.
                list_id:
                  type: string
                  example: LIST_ID
                  description: The list you will send the campaign to.
              required:
              - name
              - list_id
      responses:
        '200':
          description: The new Campaign object with summary information including
            updated details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/campaign'
              example:
                object: campaign
                id: dqQnNW
                name: Cloned Campaign
                subject: Company Monthly Newsletter
                from_email: george.washington@klaviyo.com
                from_name: George Washington
                list_id: erRoOX
                template:
                  object: email-template
                  id: TEMPLATE_ID
                  html: <html><body><p>This is the email content</p></body></html>
                status: draft
                sent_at: null
                created: 2020-06-15 12:00:00
  /v1/campaign/{campaign_id}/recipients:
    get:
      security:
      - ApiKeyAuth: []
      tags:
      - Campaigns
      operationId: get-campaign-recipients
      summary: Get Campaign Recipients
      description: Returns summary information about email recipients for the campaign
        specified that includes each recipients email, customer ID, and status.
      parameters:
      - name: campaign_id
        required: true
        in: path
        schema:
          type: string
          example: CAMPAIGN_ID
      - name: count
        in: query
        description: For pagination, the number of results to return. Max = 25,000
        required: false
        schema:
          type: integer
          maximum: 25000
          example: 25000
      - name: sort
        in: query
        description: Sort order to apply to results, either ascending or descending.
          Valid values are `asc` or `desc`. Defaults to `asc`.
        schema:
          type: string
          example: asc
      - name: offset
        required: false
        in: query
        description: For pagination, if a response to this endpoint includes a `next_offset`,
          use that value to get the next page of recipients.
        schema:
          type: string
          example: next_offset
      responses:
        '200':
          description: A list of dictionaries with keys status, email, customer_id
            and variation_id for each email recipient.
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    example: 1
                  data:
                    type: array
                    minItems: 0
                    maxItems: 25000
                    items:
                      type: object
                      properties:
                        email:
                          type: string
                        status:
                          type: string
                        customer_id:
                          type: string
                        variation_id:
                          type: string
                      additionalProperties: true
                  next_offset:
                    type: string
                    example: NEXT_OFFSET
                additionalProperties: true
              example:
                count: 1
                data:
                - email: abraham.lincoln@klaviyo.com
                  status: Sent
                  customer_id: PROFILE_ID
                  variation_id: null
                next_offset: NEXT_OFFSET
  /v1/email-templates:
    get:
      security:
      - ApiKeyAuth: []
      tags:
      - Templates
      operationId: get-templates
      summary: Get All Templates
      description: Returns a list of all the email templates you've created. The templates
        are returned in sorted order by `name`.
      parameters:
      - name: page
        in: query
        description: For pagination, which page of results to return. Default = 0
        schema:
          type: integer
          example: 0
          minimum: 0
      - name: count
        in: query
        description: For pagination, the number of results to return. Max = 100
        schema:
          type: integer
          example: 100
          minimum: 1
          maximum: 100
      responses:
        '200':
          description: Returns a list of all the email templates you've created. The
            templates are returned in sorted order by name.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: $list
                  data:
                    type: array
                    minItems: 0
                    items:
                      $ref: '#/components/schemas/template'
                  page:
                    type: integer
                    example: 0
                  start:
                    type: integer
                    example: 0
                  end:
                    type: integer
                    example: 1
                  total:
                    type: integer
                    example: 1
                  page_size:
                    type: integer
                    example: 1
                additionalProperties: true
                example:
                  object: $list
                  data:
                  - object: email-template
                    id: TEMPLATE_ID
                    name: TEMPLATE_NAME
                    html: <html><head></head><body><p>Some Text</p></body></html>
                    is_writeable: true
                    created: 2021-11-18 03:43:51
                    updated: 2021-11-18 03:43:51
                  page: 0
                  start: 0
                  end: 1
                  total: 123
                  page_size: 1
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Templates
      operationId: create-template
      summary: Create New Template
      description: Creates a new email template.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: New Template Name
                  description: The name of the email template.
                html:
                  type: string
                  example: <html><body><p>This is an email for {{ email }}.</p></body></html>
              required:
              - name
              - html
      responses:
        '200':
          description: The newly created Email Template object with summary information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/template'
  /v1/email-template/{template_id}:
    put:
      security:
      - ApiKeyAuth: []
      tags:
      - Templates
      operationId: update-template
      summary: Update Template
      description: Updates the name and/or HTML content of a template. Only updates
        imported HTML templates; does not currently update drag & drop templates.
      parameters:
      - name: template_id
        required: true
        in: path
        schema:
          type: string
          example: TEMPLATE_ID
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: New Template Name
                  description: The new name of the email template.
                html:
                  type: string
                  example: <html><body><p>This is an email for {{ email }}.</p></body></html>
                  description: The new HTML content for this template.
      responses:
        '200':
          description: The updated Email Template object with summary information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/template'
    delete:
      security:
      - ApiKeyAuth: []
      tags:
      - Templates
      operationId: delete-template
      summary: Delete Template
      description: Deletes a given template.
      parameters:
      - name: template_id
        required: true
        in: path
        schema:
          type: string
          example: TEMPLATE_ID
      responses:
        '200':
          description: The deleted Email Template object with summary information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: email-template
                  id:
                    type: string
                    example: TEMPLATE_ID
                  name:
                    type: string
                    example: TEMPLATE_NAME
                  created:
                    type: string
                    example: YYYY-MM-DD HH:MM:DD
                  updated:
                    type: string
                    example: YYYY-MM-DD HH:MM:DD
                additionalProperties: true
                example:
                  object: email-template
                  id: TEMPLATE_ID
                  name: TEMPLATE_NAME
                  created: YYYY-MM-DD HH:MM:DD
                  updated: YYYY-MM-DD HH:MM:DD
  /v1/email-template/{template_id}/clone:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Templates
      operationId: clone-template
      summary: Clone Template
      description: Creates a copy of a given template with a new name.
      parameters:
      - name: template_id
        required: true
        in: path
        schema:
          type: string
          example: TEMPLATE_ID
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: My Cloned Template
                  description: The new name of the email template.
              required:
              - name
      responses:
        '200':
          description: The newly created Email Template object with summary information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/template'
  /v1/email-template/{template_id}/render:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Templates
      operationId: render-template
      summary: Render Template
      description: Renders the specified template with the provided data and return
        HTML and text versions of the email.
      parameters:
      - name: template_id
        required: true
        in: path
        schema:
          type: string
          example: TEMPLATE_ID
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                context:
                  type: string
                  format: blob
                  example: '{ "name" : "George Washington", "state" : "VA" }'
                  description: This is the context your email template will be rendered
                    with. Email templates are rendered with contexts in a similar
                    manner to how Django templates are rendered. This means that nested
                    template variables can be referenced via dot notation and template
                    variables without corresponding context values are treated as
                    falsy and output nothing.
      responses:
        '200':
          description: The Email Template object with an additional data property
            that contains both the HTML and text versions of the rendered template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rendered-template'
  /v1/email-template/{template_id}/send:
    post:
      security:
      - ApiKeyAuth: []
      tags:
      - Templates
      operationId: send-template
      summary: Render and Send Template
      description: 'Renders the specified template with the provided data and send
        the contents in an email via the service specified. This API is intended to
        test templates only, and is rate limited to the following thresholds: 100/hour,
        1,000/day.'
      parameters:
      - name: template_id
        required: true
        in: path
        schema:
          type: string
          example: TEMPLATE_ID
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                from_email:
                  type: string
                  example: george.washington@klaviyo.com
                from_name:
                  type: string
                  example: George Washington
                subject:
                  type: string
                  example: Happy Fourth!
                to:
                  type: string
                  format: blob
                  description: |
                    **Mixed**. string, or JSON encoded array of objects with "email" and "name" keys.
                    `abraham.lincoln@klaviyo.com`
                    OR
                    `[{"name":"Abraham Lincoln","email":"abraham.lincoln@klaviyo.com"}]`
                  example: '[{"name":"Abraham Lincoln","email":"abraham.lincoln@klaviyo.com"}]'
                context:
                  type: string
                  format: blob
                  example: '{ "name" : "George Washington", "state" : "VA" }'
                  description: |
                    Optional, JSON object.
                    This is the context your email template will be rendered with. Email templates are rendered with contexts in a similar manner to how Django templates are rendered. This means that nested template variables can be referenced via dot notation and template variables without corresponding context values are treated as falsy and output nothing.
                    ex: `{ "name" : "George Washington", "state" : "VA" }`
              required:
              - from_email
              - from_name
              - subject
              - to
      responses:
        '200':
          description: The Email Template object with an additional data property
            that contains the status of the message. If successful, the status will
            be queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rendered-template'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: api_key
  schemas:
    metric:
      type: object
      properties:
        object:
          type: string
        id:
          type: string
        name:
          type: string
        integration:
          type: object
          properties:
            object:
              type: string
            id:
              type: string
            name:
              type: string
            category:
              type: string
          additionalProperties: true
        created:
          type: string
        updated:
          type: string
      additionalProperties: true
    template:
      type: object
      properties:
        object:
          type: string
          example: email-template
        id:
          type: string
          example: TEMPLATE_ID
        name:
          type: string
          example: TEMPLATE_NAME
        html:
          type: string
          example: HTML_STRING
        is_writeable:
          type: boolean
          example: true
        created:
          type: string
          example: TEMPLATE_NAME
        updated:
          type: string
          example: TEMPLATE_NAME
      additionalProperties: true
      example:
        object: email-template
        id: TEMPLATE_ID
        name: TEMPLATE_NAME
        html: <html><head></head><body><p>Some Text</p></body></html>
        is_writeable: true
        created: 2021-11-18 03:43:51
        updated: 2021-11-18 03:43:51
    rendered-template:
      type: object
      properties:
        object:
          type: string
          example: email-template
        id:
          type: string
          example: TEMPLATE_ID
        name:
          type: string
          example: My Cloned Template
        data:
          type: object
          properties:
            html:
              type: string
              example: <html><body><p>This is an email for {{ email }}.</p></body></html>
            text:
              type: string
              example: This is an email for george.washington@klaviyo.com
          additionalProperties: true
      additionalProperties: true
      example:
        object: email-template
        id: TEMPLATE_ID
        name: TEMPLATE_NAME
        data:
          html: <html><body><p>This is an email for {{ email }}.</p></body></html>
          text: This is an email for george.washington@klaviyo.com
    since_integer:
      type: integer
    since_string:
      type: string
    ascending:
      title: asc
      type: string
      example: asc
    descending:
      title: desc
      type: string
      example: desc
    reason_unsubscribed:
      title: unsubscribed
      type: string
      example: unsubscribed
    reason_bounced:
      title: bounced
      type: string
      example: bounced
    reason_invalid_email:
      title: invalid_email
      type: string
      example: invalid_email
    reason_reported_spam:
      title: reported_spam
      type: string
      example: reported_spam
    reason_manually_excluded:
      title: manually_excluded
      type: string
      example: manually_excluded
    string_array:
      type: array
      items:
        type: string
    unit_day:
      title: day
      type: string
      example: day
    unit_week:
      title: week
      type: string
      example: week
    unit_month:
      title: month
      type: string
      example: month
    measurement_count:
      title: count
      type: string
      example: count
    measurement_unique:
      title: unique
      type: string
      example: unique
    measurement_value:
      title: value
      type: string
      example: value
    measurement_sum:
      title: sum
      type: string
      example: sum
    privacy_email:
      title: Delete Email
      type: object
      properties:
        email:
          type: string
          example: abraham.lincoln@klaviyo.com
    privacy_phone:
      title: Delete Phone Number
      type: object
      properties:
        phone_number:
          type: string
          example: +13239169023
    privacy_id:
      title: Delete Person ID
      type: object
      properties:
        person_id:
          type: string
          example: PERSON_ID
    deprecated_get_list_response:
      type: object
      properties:
        object:
          type: string
        start:
          type: integer
        end:
          type: integer
        page:
          type: integer
        size:
          type: integer
        total:
          type: integer
        data:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: object
            properties:
              object:
                type: string
              id:
                type: string
              type:
                type: string
              created:
                type: string
              updated:
                type: string
              person_count:
                type: integer
      example:
        object: $list
        start: 0
        end: 1
        page: 0
        page_size: 1
        total: 1
        data:
        - object: list
          id: LIST_ID
          name: List Name
          type: standard
          created: 2021-01-13 13:00:00
          updated: 2021-01-14 13:00:00
          person_count: 1000
    delete_email:
      title: Delete Email
      type: object
      properties:
        email:
          type: string
          example: example@klaviyo.com
    delete_phone:
      title: Delete Phone Number
      type: object
      properties:
        phone_number:
          type: string
          example: +13239169023
          description: Phone Number
    delete_person:
      title: Delete Person
      type: object
      properties:
        person_id:
          type: string
          example: PERSON_ID
    identify_payload:
      type: object
      required:
      - token
      - properties
      properties:
        token:
          type: string
        properties:
          type: object
          properties:
            $email:
              type: string
            $first_name:
              type: string
            $last_name:
              type: string
            $phone_number:
              type: string
            $title:
              type: string
            $organization:
              type: string
            $city:
              type: string
            $region:
              type: string
            $country:
              type: string
            $zip:
              type: string
            $image:
              type: string
            $consent:
              type: string
            YOUR_CUSTOM_FIELD:
              oneOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
              - type: array
    track_payload_post:
      type: object
      properties:
        data:
          type: string
          format: blob
          example: '{"token": "PUBLIC_KEY", "event": "Ordered Product", "customer_properties":
            {"$email": "abraham.lincoln@klaviyo.com"}, "properties": {"item_name":
            "Boots","$value": 100}}'
      required:
      - data
    identify_payload_post:
      type: object
      properties:
        data:
          type: string
          format: blob
          example: '{"token": "PUBLIC_KEY","properties": {"$email":"ben.franklin@klaviyo.com"}}'
      required:
      - data
    track_payload:
      type: object
      required:
      - token
      - customer_properties
      - properties
      properties:
        token:
          type: string
        customer_properties:
          type: object
          properties:
            $email:
              type: string
            $phone_number:
              type: string
        properties:
          type: object
          properties:
            $event_id:
              type: string
            $value:
              type: string
            YOUR_CUSTOM_FIELD:
              oneOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
              - type: array
        time:
          oneOf:
          - type: string
          - type: integer
    person:
      type: object
      properties:
        object:
          type: string
          example: person
        id:
          type: string
          example: PERSON_ID
        $address1:
          type: string
          example: ''
        $address2:
          type: string
          example: ''
        $city:
          type: string
          example: Mount Vernon
        $country:
          type: string
          example: United States
        $latitude:
          type: string
          example: ''
        $longitude:
          type: string
          example: ''
        $region:
          type: string
          example: Virginia
        $zip:
          type: string
          example: '22121'
        $email:
          type: string
          example: george.washington@klaviyo.com
        $title:
          type: string
          example: President
        $phone_number:
          type: string
          example: +13239169023
        $organization:
          type: string
          example: U.S. Government
        $first_name:
          type: string
          example: George
        $last_name:
          type: string
          example: Washington
        $timezone:
          type: string
          example: US/Eastern
        $id:
          type: string
          example: CUSTOM_ID
        created:
          type: string
          example: 2021-11-04 09:06:13
        updated:
          type: string
          example: 2021-11-23 11:21:03
      additionalProperties: true
      example:
        object: person
        id: PERSON_ID
        $address1: ''
        $address2: ''
        $city: Mount Vernon
        $country: United States
        $latitude: ''
        $longitude: ''
        $region: Virginia
        $zip: '22121'
        $email: george.washington@klaviyo.com
        $title: President
        $phone_number: +13239169023
        $organization: U.S. Government
        $first_name: George
        $last_name: Washington
        $timezone: US/Eastern
        $id: CUSTOM_ID
        created: 2021-11-04 09:06:13
        updated: 2021-11-23 11:21:03
    metric_export:
      type: object
      properties:
        metric:
          type: object
          properties:
            object:
              type: string
            id:
              type: string
            name:
              type: string
            integration:
              type: object
              properties:
                object:
                  type: string
                id:
                  type: string
                name:
                  type: string
                category:
                  type: string
              additionalProperties: true
            created:
              type: string
            updated:
              type: string
          additionalProperties: true
        start_date:
          type: string
        end_date:
          type: string
        unit:
          type: string
        measurement:
          type: string
        by:
          type: string
        where:
          type: string
        results:
          type: array
          items:
            type: object
            properties:
              segment:
                type: string
              data:
                type: array
                items:
                  type: object
                  properties:
                    date:
                      type: string
                    values:
                      type: array
                      items:
                        type: number
                  additionalProperties: true
            additionalProperties: true
      additionalProperties: true
      example:
        metric:
          object: metric
          id: METRIC_ID
          name: Placed Order
          integration:
            category: eCommerce
            object: integration
            id: INTEGRATION_ID
            name: Shopify
          created: 2015-02-12 18:02:34
          updated: 2015-02-12 18:51:41
        start_date: 2015-01-01 00:00:00
        end_date: 2015-01-31 00:00:00
        unit: weekly
        measurement: c
        by: ''
        where: ''
        results:
        - segment: Everyone
          data:
          - date: 2015-01-13 00:00:00
            values:
            - 5
          - date: 2015-01-14 00:00:00
            values:
            - 5
    metric_timeline:
      type: object
      properties:
        object:
          type: string
        count:
          type: integer
        data:
          type: array
          minItems: 0
          maxItems: 100
          items:
            type: object
            properties:
              object:
                type: string
              id:
                type: string
              statistic_id:
                type: string
              timestamp:
                type: integer
              event_name:
                type: string
              event_properties:
                type: object
                properties:
                  $event_id:
                    type: string
                additionalProperties: true
              datetime:
                type: string
              uuid:
                type: string
              person:
                type: object
                properties:
                  object:
                    type: string
                  id:
                    type: string
                additionalProperties: true
        next:
          type: string
      additionalProperties: true
      example:
        object: $list
        count: 1
        data:
        - object: event
          id: EVENT_ID
          statistic_id: STATISTIC_ID
          timestamp: 1234567890
          event_name: Placed Order
          event_properties:
            $value: 100
            items:
            - name: Boots
              sku: ITEM_SKU
              price: 50
              quantity: 2
          datetime: 2021-11-23 11:21:01+00:00
          uuid: UNIQUE_EVENT_ID
          person:
            id: PERSON_ID
            object: person
            $email: george.washington@klaviyo.com
        next: 1400656845-ABCDEFG
    check_membership_response:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            example: PROFILE_ID
          created:
            type: string
            example: YYYY-MM-DDTHH:MM:SSZ
        additionalProperties: true
      example:
      - id: PROFILE_ID_1
        created: YYYY-MM-DDTHH:MM:SSZ
        email: george.washington@klaviyo.com
      - id: PROFILE_ID_2
        created: YYYY-MM-DDTHH:MM:SSZ
        phone_number: +13239169023
      - id: PROFILE_ID_3
        created: YYYY-MM-DDTHH:MM:SSZ
        push_token: PUSH_TOKEN_1
    check_membership_request:
      type: object
      properties:
        emails:
          type: array
          items:
            type: string
          example:
          - george.washington@klaviyo.com
          - abraham.lincoln@klaviyo.com
          description: List of email addresses
        phone_numbers:
          type: array
          items:
            type: string
          example:
          - +13239169023
          - +12028837032
          description: List of phone numbers
        push_tokens:
          type: array
          items:
            type: string
          example:
          - PUSH_TOKEN_1
          - PUSH_TOKEN_2
    global_exclusion_response_data:
      type: object
      properties:
        object:
          type: string
          example: $list
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
                example: exclusion
              email:
                type: string
                example: george.washington@klaviyo.com
              reason:
                type: string
                example: manually_excluded
              timestamp:
                type: string
                example: YYYY-MM-DD HH:MM:SS
            additionalProperties: true
        page:
          type: integer
          example: 0
        start:
          type: integer
          example: 0
        end:
          type: integer
          example: 1
        total:
          type: integer
          example: 1
        page_size:
          type: integer
          example: 1
      additionalProperties: true
      example:
        object: $list
        data:
        - object: exclusion
          email: george.washington@klaviyo.com
          reason: unsubscribed
          timestamp: 2021-11-26 08:48:51
        page: 0
        start: 0
        end: 0
        total: 100
        page_size: 1
    list_subscribe_post_response_data:
      type: array
      minItems: 1
      items:
        type: object
        properties:
          id:
            type: string
          email:
            type: string
          phone_number:
            type: string
      example:
      - id: PERSON_ID_1
        email: george.washington@klaviyo.com
      - id: PERSON_ID_2
        email: thomas.jefferson@klaviyo.com
        phone_number: +13239169023
    200ok:
      type: object
    campaign:
      type: object
      properties:
        object:
          type: string
          example: campaign
        id:
          type: string
          example: CAMPAIGN_ID
        name:
          type: string
          example: Campaign Name
        subject:
          type: string
          example: Company Monthly Newsletter
        from_email:
          type: string
          example: george.washington@klaviyo.com
        from_name:
          type: string
          example: George Washington
        list_id:
          type: string
          example: erRoOX
        template:
          type: object
          properties:
            object:
              type: string
              example: email-template
            id:
              type: string
              example: TEMPLATE_ID
            html:
              type: string
              example: <html><body><p>This is the email content</p></body></html>
          additionalProperties: true
        status:
          type: string
          example: draft
        sent_at:
          type: string
          example: 2020-12-02 18:45:04
        created:
          type: string
          example: 2020-12-01 18:45:04
      additionalProperties: true
      example:
        object: campaign
        id: CAMPAIGN_ID
        name: Campaign Name
        subject: Company Monthly Newsletter
        from_email: george.washington@klaviyo.com
        from_name: George Washington
        list_id: erRoOX
        template:
          object: email-template
          id: TEMPLATE_ID
          html: <html><body><p>This is the email content</p></body></html>
        status: draft
        sent_at: 2020-12-02 18:45:04
        created: 2020-12-01 18:45:04
  responses:
    '400':
      description: Bad request - Request is missing or has a bad parameter, or has
        invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 429
              message:
                type: string
                example: Bad request - Request is missing or has a bad parameter.
          examples:
            bad_request:
              summary: bad request
              value:
                status: 400
                message: Bad request - Request is missing or has a bad parameter.
            not_authorized:
              summary: not authorized
              value:
                status: 400
                message: Not Authorized - Request is missing or has an invalid API
                  key.
    '404':
      description: Not Found - The requested resource doesn't exist.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 404
              message:
                type: string
                example: Not Found - The requested resource does not exist.
    '429':
      description: Rate Limit Reached - Please wait for the designated time period.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 429
              message:
                type: string
                example: 'ServerRate limit reached - please wait: 10 seconds'
    '500':
      description: Server errors - Something is wrong on Klaviyo's end.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 500
              message:
                type: string
                example: An internal API server error occurred. Please check out our
                  support resources at https://klaviyo.com/support for further assistance.
    200ok:
      description: OK
    200ServerSide:
      description: Request reached server
      content:
        text/html:
          schema:
            type: string
          examples:
            success:
              summary: success
              value: '1'
            failure:
              summary: failure
              value: '0'
x-readme:
  samples-languages:
  - curl
  - javascript
  - node
  - php
  - python
  - ruby
  explorer-enabled: false
  proxy-enabled: true
  samples-enabled: true
