Visitar URL original
Update Source Mapping | Klaviyo API ReferenceSkip to content

This page is available as Markdown at https://developers.klaviyo.com/en/reference/update_source_mapping.md. Its OpenAPI document is at https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/update_source_mapping.json. An index of every page is at https://developers.klaviyo.com/llms.txt.

KlaviyoKlaviyoDevelopers

PATCHhttps://a.klaviyo.com/api/source-mappings/{id}

Update the source mapping with the given ID.

Revision header
revision: 2026-10-15required
Scopes
custom-objects:write
Rate limits
Burst: 3/sSteady: 60/m

Path parameters

  • id#stringrequired

    The ULID ID of the source mapping

    Example: 01K5HQC66PGHV35SYJC5ZV3DZA

Query parameters

  • fields[source-mapping]#string[]

    For more information please visit API overview

    Allowed values:
    • id
    • property_mappings
    • relationship_mappings

Headers

  • revision#stringrequired

    API endpoint revision (format: YYYY-MM-DD[.suffix])

    2026-10-15

Request body

Content type: application/vnd.api+jsonrequired

  • data#objectrequired
    Show 3 fields
    • type#stringrequired
      Allowed values:
      • source-mapping
    • id#stringrequired

      The ULID ID of the source mapping

      Example: 01K5HQC66PGHV35SYJC5ZV3DZA

    • attributes#objectrequired
      Show 2 fields
      • property_mappings#oneOf[]nullable

        A mapping of source property IDs to source mappings

        One of:

        1. Option 1: ConstantPropertyMapping
          • id#integerrequired

            Property ID. Must be a positive integer.

            Example: 1

          • type#stringrequired

            String literal for serialization

            Allowed values:
            • constant
          • value#integer | number | string | booleanrequired

            Constant value assigned to every record

            Example: active

        2. Option 2: SimplePropertyMapping
          • id#integerrequired

            Property ID

            Example: 1

          • type#stringrequired

            String literal for serialization

            Allowed values:
            • simple
          • source#objectrequired
            Show 3 fields
            • source_id#stringrequired

              Data source ULID ID

              Example: 01JXKX2HM7NV4QPTR5WE8BF6GY

            • id_path#stringrequired

              JSONPath ID selector

              Example: $['object_record']['subscription_id']

            • data_path#stringrequired

              JSONPath data selector

              Example: $['object_record']['service_plan']

      • relationship_mappings#object[]nullable

        A mapping of source relationship IDs to source mappings

        Show 3 fields
        • relationship_id#stringrequired

          Object schema relationship ULID ID

          Example: 01K97SE7GH4TE57FVNQY310QAK

        • type#stringrequired

          String literal for serialization

          Allowed values:
          • simple

          Example: simple

        • source#oneOfrequired

          Data source mapping

          One of:

          1. Option 1: CustomObjectRelationshipSource
            • source_id#stringrequired

              Data source ULID ID

              Example: 01JXKX2HM7NV4QPTR5WE8BF6GY

            • type#stringrequired

              String literal for serialization

              Allowed values:
              • custom-object
            • id_path#stringrequired

              JSONPath data selector to owning ID

              Example: $['object_record']['subscription_id']

            • related_id_path#stringrequired

              JSONPath data selector to related ID

              Example: $['object_record']['pet_id']

            • update_strategy#stringnullable

              Strategy for updating relationships with each new RawDataRecord ingestion

              Allowed values:
              • additive
              • replace_from_origin

              Default: replace_from_origin

              Example: replace_from_origin

          2. Option 2: ProfileRelationshipSource
            • source_id#stringrequired

              Data source ULID ID

              Example: 01JXKX2HM7NV4QPTR5WE8BF6GY

            • type#stringrequired

              String literal for serialization

              Allowed values:
              • profile
            • id_path#stringrequired

              JSONPath data selector to owning ID

              Example: $['relationships']['owners'][*]['id']

            • related_id_paths#object[]required

              List of profile identifier mappings to JSONPath data selectors

              Show 2 fields
              • identifier_type#stringrequired

                Profile identifier type

                Allowed values:
                • anonymous
                • email
                • external-id
                • klaviyo-id
                • phone
              • path#stringrequired

                JSONPath data selector to related ID

                Example: $['relationships']['owners'][*]['email']

            • update_strategy#stringnullable

              Strategy for updating relationships with each new RawDataRecord ingestion

              Allowed values:
              • additive
              • replace_from_origin

              Default: replace_from_origin

              Example: replace_from_origin

Responses

200Success

Content type: application/vnd.api+json

  • data#objectrequired
    Show 4 fields
    • type#stringrequired
      Allowed values:
      • source-mapping
    • id#stringrequired

      The ULID ID of the source mapping

      Example: 01K5HQC66PGHV35SYJC5ZV3DZA

    • attributes#objectrequired
      Show 2 fields
      • property_mappings#oneOf[]required

        A mapping of source property IDs to source mappings

        One of:

        1. Option 1: ConstantPropertyMapping
          • id#integerrequired

            Property ID. Must be a positive integer.

            Example: 1

          • type#stringrequired

            String literal for serialization

            Allowed values:
            • constant
          • value#integer | number | string | booleanrequired

            Constant value assigned to every record

            Example: active

        2. Option 2: SimplePropertyMapping
          • id#integerrequired

            Property ID

            Example: 1

          • type#stringrequired

            String literal for serialization

            Allowed values:
            • simple
          • source#objectrequired
            Show 3 fields
            • source_id#stringrequired

              Data source ULID ID

              Example: 01JXKX2HM7NV4QPTR5WE8BF6GY

            • id_path#stringrequired

              JSONPath ID selector

              Example: $['object_record']['subscription_id']

            • data_path#stringrequired

              JSONPath data selector

              Example: $['object_record']['service_plan']

      • relationship_mappings#object[]required

        A mapping of source relationship IDs to source mappings

        Show 3 fields
        • relationship_id#stringrequired

          Object schema relationship ULID ID

          Example: 01K97SE7GH4TE57FVNQY310QAK

        • type#stringrequired

          String literal for serialization

          Allowed values:
          • simple

          Example: simple

        • source#oneOfrequired

          Data source mapping

          One of:

          1. Option 1: CustomObjectRelationshipSource
            • source_id#stringrequired

              Data source ULID ID

              Example: 01JXKX2HM7NV4QPTR5WE8BF6GY

            • type#stringrequired

              String literal for serialization

              Allowed values:
              • custom-object
            • id_path#stringrequired

              JSONPath data selector to owning ID

              Example: $['object_record']['subscription_id']

            • related_id_path#stringrequired

              JSONPath data selector to related ID

              Example: $['object_record']['pet_id']

            • update_strategy#stringnullable

              Strategy for updating relationships with each new RawDataRecord ingestion

              Allowed values:
              • additive
              • replace_from_origin

              Default: replace_from_origin

              Example: replace_from_origin

          2. Option 2: ProfileRelationshipSource
            • source_id#stringrequired

              Data source ULID ID

              Example: 01JXKX2HM7NV4QPTR5WE8BF6GY

            • type#stringrequired

              String literal for serialization

              Allowed values:
              • profile
            • id_path#stringrequired

              JSONPath data selector to owning ID

              Example: $['relationships']['owners'][*]['id']

            • related_id_paths#object[]required

              List of profile identifier mappings to JSONPath data selectors

              Show 2 fields
              • identifier_type#stringrequired

                Profile identifier type

                Allowed values:
                • anonymous
                • email
                • external-id
                • klaviyo-id
                • phone
              • path#stringrequired

                JSONPath data selector to related ID

                Example: $['relationships']['owners'][*]['email']

            • update_strategy#stringnullable

              Strategy for updating relationships with each new RawDataRecord ingestion

              Allowed values:
              • additive
              • replace_from_origin

              Default: replace_from_origin

              Example: replace_from_origin

  • meta#object

    Response-level metadata

    Show 1 field
    • agent_hints#object

      Optional hints emitted by the API for agent callers

      Show 1 field
      • next_steps#string[]

        Suggested follow-up actions for agents to take after this response

4XXClient Error

Content type: application/vnd.api+json

  • errors#object[]required
    Show 5 fields
    • id#stringrequired
    • code#stringrequired
    • title#stringrequired
    • detail#stringrequired
    • source#object
      Show 2 fields
      • pointer#string
      • parameter#string

5XXServer Error

Content type: application/vnd.api+json

  • errors#object[]required
    Show 5 fields
    • id#stringrequired
    • code#stringrequired
    • title#stringrequired
    • detail#stringrequired
    • source#object
      Show 2 fields
      • pointer#string
      • parameter#string