---
title: "Upgrading to Revision 2023-07-15 or newer"
description: "Klaviyo Developers | Migrate to the standardized Relationships object released in the 2023-07-15 revision."
url: "https://developers.klaviyo.com/en/docs/migrate_to_2023_07_15_relationships"
category: "Legacy API migration resources"
lastUpdated: "2026-11-10"
related: ["https://developers.klaviyo.com/en/docs/llms.txt","https://developers.klaviyo.com/en/docs/migration_resources.md"]
---

# Upgrading to Revision 2023-07-15 or newer

> This is the Markdown version of https://developers.klaviyo.com/en/docs/migrate_to_2023_07_15_relationships

Klaviyo Developers | Migrate to the standardized Relationships object released in the 2023-07-15 revision.

> [!WARNING]
> **v1/v2 legacy APIs retired on June 30, 2024.**
> To learn more about Klaviyo’s API lifecycle, check out our updated <a href="https://developers.klaviyo.com/en/docs/api_versioning_and_deprecation_policy.md" target="_blank">API versioning and deprecation policy</a>.

Klaviyo is standardizing how we handle relationships in our APIs and implemented consistently typed objects across API endpoints. Following the `2023-07-15` revision changes, you can create a profile in our APIs in the same shape, regardless of whether you’re calling the profiles endpoint or the events endpoint.

Use this guide to upgrade from an older revision, to revision `2023-07-15` or newer.

The kinds of changes include:

- 1:1 relationships now use singular tense and an object, instead of plural and an array.
  - Example: GET `https://a.klaviyo.com/api/flow-actions/{flow_action_id}/?include=flow` , now `flow` instead of `flows`.
- Related object IDs relocated from the attributes payload to relationships.
  - Example: POST `https://a.klaviyo.com/api/tags/`.
- Specifying a relationship between two Klaviyo objects allows for improved consistency and greater interoperability across endpoints.
  - Example: You can now create/update a profile for an event in the same way you would when using the profiles API directly with a POST request to `https://a.klaviyo.com/api/events/`.

## Events API

### [Create Event](https://developers.klaviyo.com/en/reference/create_event.md) and [Create Client Event](https://developers.klaviyo.com/en/reference/create_client_event.md)

#### Why

Events are related to other top-level profile and metric objects. Consistently specify the attributes for profiles, as well as metrics, when creating events for a particular profile or creating or updating a profile.

You can also specify a profile for an event in the same way as using the Profiles API.

#### Before and after

POST request to `https://a.klaviyo.com/client/events`:

```json Before
{
  "data": {
    "type": "event",
    "attributes": {
      "profile": {
        "$email": "kim@klaviyo.com",
        "$phone_number": "+19148675309",
        "$kid": "12234345",
        "$id": "abc123",
        "$exchange_id": "ksdfxl-sdfssdf",
        "fun fact": "i like coffee",
      },
      "metric": {
        "name": "Viewed Product"
      },
      "properties": {
        "itemId": "123"
      },
      "time": "2022-11-08T00:00:00",
      "value": 9.99
    }
  }
}
```
```json After
{
  "data": {
    "type": "event",
    "attributes": {
      "profile": {
        "data": {
          "type": "profile",
          "id": "12234345",
          "attributes": {
            "email": "kim@klaviyo.com",
            "phone_number": "+19148675309",
            "anonymous_id": "123456",
            "external_id": "abc123",
            "_kx": "ksdfxl-sdfssdf",
            "properties": {
              "fun fact": "i like coffee"
            }
          }
        },
        "metric": {
          "data": {
            "type": "metric",
            "attributes": {
              "name": "Viewed Product"
            }
          }
        },
        "properties": {
          "itemId": "123"
        },
        "time": "2022-11-08T00:00:00",
        "value": 9.99
      }
    }
  }
}
```

### [Get Event](https://developers.klaviyo.com/en/reference/get_event.md) and [Get Events](https://developers.klaviyo.com/en/reference/get_events.md)

The `metric_id` and `profile_id` have been removed from the top-level attributes on the event payload.
The relationships keys are now singular.

#### Why

The metric and profile IDs are related object IDs and can be accessed under relationships.

The relationships between an event and profile and event and metric are 1:1, which should be specified as singular.

#### Before and after

GET request to `/api/events/{event_id}`:

```json Before
{
  "data": {
    "type": "event",
    "attributes": {
      "metric_id": "AbC123",
      "profile_id": "01F2VWQ645BES947MP1BPAKVMB",
      "timestamp": 1688154729,
      "event_properties": {
         ...
      },
      "datetime": "2023-06-30 19:52:09+00:00",
      "uuid": "98fbfa80-177f-11ee-8001-f71585a038b4"
    },
    "relationships": {
        "profiles": {
            "data": [
                {"type": "profile", "id": "01F2VWQ645BES947MP1BPAKVMB"}
            ]
        },
        "metrics": {
            "data": [
                {"type": "metric", "id": "AbC123"}
            ]
        },
    }
}
```
```json After
{
  "data": {
    "type": "event",
    "attributes": {
      "timestamp": 1688154729,
      "event_properties": {
         ...
      },
      "datetime": "2023-06-30 19:52:09+00:00",
      "uuid": "98fbfa80-177f-11ee-8001-f71585a038b4"
    },
    "relationships": {
        "profile": {
            "data": {"type": "profile", "id": "01F2VWQ645BES947MP1BPAKVMB"}
        },
        "metric": {
            "data": {"type": "metric", "id": "AbC123"}
        },
    }
}
```

## Flows API

### [Get Flow Action](https://developers.klaviyo.com/en/reference/get_flow_action.md) and [Get Flow Message](https://developers.klaviyo.com/en/reference/get_flow_message.md)

When including the related flow for a flow action, or related action for a message, specify as singular instead of plural.

#### Why

This is a to-one relationship, which should be specified as singular.

#### Before and after

GET request to `/api/flow-actions/{flow_action_id}/?include=flow`:

```json Before
{
  "data": {
    "type": "flow-action",
    "attributes": {...},
    "relationships": {
        "flows": {
            "data": [
                {"type": "flow", "id": "HgkVeu"}
            ]
        }
    }
}
```
```json After
{
  "data": {
    "type": "flow-action",
    "attributes": {...},
    "relationships": {
        "flow": {
            "data": {"type": "flow", "id": "HgkVeu"}
        }
    }
}
```

The relationship to the flow will return a singular object instead of an array.

GET request to `/api/flow-actions/{flow_action_id}/relationships/flow/`:

```json Before
{
    "data": [
        {
            "type": "flow",
            "id": "HgkVeu"
        }
    ]
}
```
```json After
{
    "data": {
        "type": "flow",
        "id": "HgkVeu"
    }
}
```

## Tags API

### [Create Tag](https://developers.klaviyo.com/en/reference/create_tag.md)

When creating a tag, the related tag group must now be specified as a relationship instead of using a `tag_group_id` field.

#### Why

This is the standard JSON:API method for assigning relationships when creating resources.

#### Before and after

POST request to `/api/tags/`:

```json Before
{
  "data": {
    "type": "tag",
    "attributes": {
      "name": "My Tag",
      "tag_group_id": "zyxw9876-vu54-ts32-rq10-zyxwvu654321"
    }
  }
}
```
```json After
{
  "data": {
    "type": "tag",
    "attributes": {
      "name": "My Tag",
    },
    "relationships": {
      "tag-group": {
        "type": "tag-group",
        "id": "zyxw9876-vu54-ts32-rq10-zyxwvu654321"
      }
    }
  }
}
```

### [Get Tag Tag Group](https://developers.klaviyo.com/en/reference/get_tag_group_for_tag.md)

The response from this endpoint will return a single object now, the related tag group, instead of a list containing one object.

#### Why

Singular-to-one relationships (i.e., "tag-group", not "tag-groups") will return single objects.

#### Before and after

GET request to `/api/tags/1/tag-group/`:

```json Before
{
  "data": [
    {
      "type": "tag-group",
      "id": "zyxw9876-vu54-ts32-rq10-zyxwvu654321"
      ...
    }
  ]
}
```
```json After
{
  "data": {
      "type": "tag-group",
      "id": "zyxw9876-vu54-ts32-rq10-zyxwvu654321"
      ...
  }
}
```

## Campaigns API

### [Get Campaigns](https://developers.klaviyo.com/en/reference/get_campaigns.md), [Create Campaign](https://developers.klaviyo.com/en/reference/create_campaign.md), [Get Campaign](https://developers.klaviyo.com/en/reference/get_campaign.md), [Update Campaign](https://developers.klaviyo.com/en/reference/update_campaign.md), [Create Campaign Clone](https://developers.klaviyo.com/en/reference/clone_campaign.md), [Get Campaign Message](https://developers.klaviyo.com/en/reference/get_campaign_message.md), [Update Campaign Message](https://developers.klaviyo.com/en/reference/update_campaign_message.md), and [Assign Campaign Message Template](https://developers.klaviyo.com/en/reference/assign_template_to_campaign_message.md)

When using the campaigns API, the related campaign message (for campaigns) and the related campaign (for campaign messages) will no longer be returned in a `message` or `campaign_id` string field.  Instead it will be returned as a relationship, in the relationship section of the response.

When using the Campaign Message API, any related templates will be referenced using relationships.

#### Why

This is the standard JSON:API method for posting and returning relationship data from a resource.

#### Before and after

GET request to `/api/campaigns/{campaign_id}/`:

```json Before
{
  "data": {
    "type": "campaign",
    "id": "1",
    "attributes": {
      ...
      "message": "123"
    }
  }
}
```
```json After
{
  "data": {
    "type": "campaign",
    "id": "1",
    "attributes": {
      ...
    },
    "relationships": {
      "campaign-messages": {
        "data": [
          {
            "type": "campaign-message",
            "id": "123"
          }
        ]
      }
    }
  }
}
```

GET request to `/api/campaign-messages/{campaign_message_id}/`:

```json Before
{
  "data": {
    "type": "campaign-message",
    "id": "1",
    "attributes": {
      ...
      "content": {
        "subject": "Hello",
        "template_id": "1",
        "template_name": "My Template"
      }
    }
  }
}
```
```json After
{
  "data": {
    "type": "campaign-message",
    "id": "1",
    "attributes": {
      ...
      "content": {
        "subject": "Hello",
      }
    },
    "relationships": {
      "templates": {
        "data": {
          "type": "template",
          "id": "1"
        }
      }
    }
  }
}
```

GET request to `/api/campaign-messages/{campaign_message_id}/?include=template`:

```json Before
{
  "data": {
    "type": "campaign-message",
    "id": "1",
    "attributes": {
      ...
      "content": {
        "subject": "Hello",
        "template_id": "1",
        "template_name": "My Template"
      }
    }
  }
}
```
```json After
{
  "data": {
    "type": "campaign-message",
    "id": "1",
    "attributes": {
      ...
      "content": {
        "subject": "Hello",
      }
    },
    "relationships": {
      "template": {
        "data": {
          "type": "template",
          "id": "1"
        }
      }
    }
  },
  "included": [
    {
      "type": "template",
      "id": "1",
      "attributes": {
        "name": "My Template"
      }
    }
  ]
}
```

## Catalogs API

### [Create Catalog Variant](https://developers.klaviyo.com/en/reference/create_catalog_variant.md)

When creating a catalog variant, the related item will be specified as a singular-to-one relationship using the `item` field, rather than a list containing one item using `items`.

#### Why

This relationship is singular, and should be specified as a single item.

#### Before and after

POST request to `/api/catalog-variants/`:

```json Before
{
  "data": {
    "type": "catalog-variant",
    "attributes": {
      ...
    },
    "relationships": {
      "items": {
        "data": [
          {
            "type": "catalog-item",
            "id": "$custom:::$default:::SAMPLE-DATA-ITEM-1"
          }
        ]
      }
    }
  }
}
```
```json After
{
  "data": {
    "type": "catalog-variant",
    "attributes": {
      ...
    },
    "relationships": {
      "item": {
        "data": {
          "type": "catalog-item",
          "id": "$custom:::$default:::SAMPLE-DATA-ITEM-1"
        }
      }
    }
  }
}
```

### [Spawn Create Items Job](https://developers.klaviyo.com/en/reference/bulk_create_catalog_items.md), [Spawn Update Items Job](https://developers.klaviyo.com/en/reference/bulk_update_catalog_items.md), [Spawn Delete Items Job](https://developers.klaviyo.com/en/reference/bulk_delete_catalog_items.md), [Spawn Create Variants Job](https://developers.klaviyo.com/en/reference/bulk_create_catalog_variants.md), [Spawn Update Variants Job](https://developers.klaviyo.com/en/reference/bulk_update_catalog_variants.md), [Spawn Delete Variants Job](https://developers.klaviyo.com/en/reference/bulk_delete_catalog_variants.md), [Spawn Create Categories Job](https://developers.klaviyo.com/en/reference/bulk_create_catalog_categories.md), [Spawn Update Categories Job](https://developers.klaviyo.com/en/reference/bulk_update_catalog_categories.md), and [Spawn Delete Categories Job](https://developers.klaviyo.com/en/reference/bulk_delete_catalog_categories.md)

The request payload for the bulk catalog APIs is changing slightly: an additional `data` element is inserted into the payload before the resource array.

#### Why

This is standardization to align with the similar structure in the relationships section of payloads.

#### Before and after

POST request to `/api/catalog-item-bulk-create-jobs/`:

```json Before
{
  "data": {
    "type": "catalog-item-bulk-create-job",
    "attributes": {
      "items": [
        {"type": "catalog-item", ...}
      ]
    }
  }
}
```
```json After
{
  "data": {
    "type": "catalog-item-bulk-create-job",
    "attributes": {
      "items": {
        "data": [
          {"type": "catalog-item", ...}
        ]
      }
    }
  }
}
```

## Client API and Profiles API

### [Create Client Subscriptions](https://developers.klaviyo.com/en/reference/create_client_subscription.md) and [Subscribe Profiles](https://developers.klaviyo.com/en/reference/bulk_subscribe_profiles.md)

When subscribing a profile, the related list will be specified as a relationship instead of an embedded `list_id`, and the profiles to subscribe will be specified as profile resource objects instead of `email`, `phone_number`, or `id`.

#### Why

This is the standard JSON:API method for assigning relationships when creating resources.

#### Before and after

POST request to `/api/profile-subscription-bulk-create-jobs/`:

```json Before
{
  "data": {
    "type": "profile-subscription-bulk-create-job",
    "attributes": {
      "list_id": "Y6nRLr",
      "subscriptions": [
        {"email": "jason.myers@klaviyo.com", "channels": {...}},
        ...
      ],
    }
  }
}
```
```json After
{
  "data": {
    "type": "profile-subscription-bulk-create-job",
    "attributes": {
      "profiles": {
        "data": [
          {
            "type": "profile",
            "attributes": {
              "email": "jason.myers@klaviyo.com",
              "subscriptions": {...}
        	  },
             ...
          ]
        }
      }
    },
    "relationships": {
      "list": {
        "data": {"type": "list", "id": "Y6nRLr"}
      }
    }
  }
}
```

### [Unsubscribe Profiles](https://developers.klaviyo.com/en/reference/bulk_unsubscribe_profiles.md)

List and profiles are specified via relationships, and the URL path and type have been updated.

#### Before and after

POST request to `/api/profile-unsubscription-bulk-create-jobs/`:

```json Before
{
  "data": {
    "type": "profile-subscription-bulk-create-job",
    "attributes": {
      "list_id": "Y6nRLr",
      "subscriptions": [
        {"email": "jason.myers@klaviyo.com", "channels": {...}},
        ...
      ],
    }
  }
}
```
```json After
{
  "data": {
    "type": "profile-subscription-bulk-delete-job",
    "attributes": {
      "profiles": {
        "data": [
          {
            "type": "profile",
            "attributes": {
              "email": "jason.myers@klaviyo.com"
        	  },
          },
          ...
         ]
        }
      }
    },
    "relationships": {
      "list": {
        "data": {"type": "list", "id": "Y6nRLr"}
      }
    }
  }
}
```

### [Suppress Profiles](https://developers.klaviyo.com/en/reference/bulk_suppress_profiles.md)

Profiles are specified under `profiles`, and the URL path and resource type have been updated.

#### Before and after

POST request to `/api/profile-suppression-bulk-create-jobs/`:

```json Before
{
  "data": {
    "type": "profile-suppression-bulk-create-job",
    "attributes": {
      "suppressions": [
          {
            "email": "jason.myers@klaviyo.com",
          },
          ...
      ]
    }
  }
}
```
```json After
{
  "data": {
    "type": "profile-suppression-bulk-create-job",
    "attributes": {
      "profiles": {
        "data": [
          {
           "type": "profile",
            "attributes": {
              "email": "jason.myers@klaviyo.com",
           },
           ...
         ]
      }
    }
  }
}
```

### [Unsuppress Profiles](https://developers.klaviyo.com/en/reference/bulk_unsuppress_profiles.md)

Profiles are specified under `profiles`, and the URL path and resource type have been updated.

#### Before and after

POST request to `/api/profile-unsuppression-bulk-create-jobs`:

```json Before
{
  "data": {
    "type": "profile-unsuppression-bulk-create-job",
    "attributes": {
      "suppressions": [
        {
          "email": "jason.myers@klaviyo.com"
        }
      ]
    }
  }
}
```
```json After
{
  "data": {
    "type": "profile-suppression-bulk-delete-job",
    "attributes": {
      "profiles": {
        "data": [
          {
           "type": "profile",
            "attributes": {
              "email": "jason.myers@klaviyo.com",
           },
           ...
         ]
      }
    }
  }
}
```

## Data Privacy API

### [Request Profile Deletion](https://developers.klaviyo.com/en/reference/request_profile_deletion.md)

When requesting deletion of a profile, the related profile will be specified as a relationship to the profile resource instead of top level identifiers.

#### Why

This is the standard JSON:API method for specifying relationships to other resources.

#### Before and after

POST request to `/api/data-privacy-deletion-jobs/`:

```json Before
{
  "data": {
    "type": "data-privacy-deletion-job",
    "attributes": {
      "profile_id": "01F2VWQ645BES947MP1BPAKVMB",
      "email": "matt.kemp@klaviyo-demo.com",
      "phone_number": "+15005550006"
    }
  }
}
```
```json After
{
  "data": {
    "type": "data-privacy-deletion-job",
    "attributes": {
      "profile": {
        "data": {
          {
            "type": "profile",
            "id": "01F2VWQ645BES947MP1BPAKVMB",
            "attributes": {
              "email": "matt.kemp@klaviyo-demo.com",
              "phone_number": "+15005550006"
            }
          }
        }
      }
    }
  }
}
```
