---
title: "Update Source Mapping"
description: "How to call Update Source Mapping (PATCH /api/source-mappings/{id}) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/v2026-07-15/reference/update_source_mapping"
revision: "2026-07-15"
latestUrl: "https://developers.klaviyo.com/en/reference/update_source_mapping"
operationId: "update_source_mapping"
method: "PATCH"
endpoint: "https://a.klaviyo.com/api/source-mappings/{id}"
authentication: "privateKey"
scopes: ["custom-objects:write"]
rateLimits: {"burst":"3/s","steady":"60/m"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
openApi: "https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/update_source_mapping.json"
jsonApi: {"fields":{"source-mapping":["id","property_mappings","relationship_mappings"]}}
related: ["https://developers.klaviyo.com/en/v2026-07-15/reference/custom-objects/llms.txt","https://developers.klaviyo.com/en/v2026-07-15/reference/get_source_mapping.md"]
---

# Update Source Mapping

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

```http
PATCH https://a.klaviyo.com/api/source-mappings/{id}
```

Update the source mapping with the given ID.

- Revision header: `revision: 2026-07-15` (required)
- Scopes: `custom-objects:write`
- Rate limits: Burst: `3/s`, Steady: `60/m`
- OpenAPI: [Download this endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/update_source_mapping.json)

## Example request

```bash
curl --request PATCH \
     --url 'https://a.klaviyo.com/api/source-mappings/01K5HQC66PGHV35SYJC5ZV3DZA' \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-07-15' \
     --header 'content-type: application/vnd.api+json' \
     --data '{
  "data": {
    "type": "source-mapping",
    "id": "01K5HQC66PGHV35SYJC5ZV3DZA",
    "attributes": {}
  }
}'
```

## Path parameters

- `id` (string, required): The ULID ID of the source mapping Example: `01K5HQC66PGHV35SYJC5ZV3DZA`

## Query parameters

- `fields[source-mapping]` (string[]): For more information please visit [API overview](https://developers.klaviyo.com/en/v2026-07-15/reference.md) Allowed values: `id`, `property_mappings`, `relationship_mappings`

## Headers

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

## Request body

Content type: `application/vnd.api+json` (required)

- `data` (object, required)
  - `type` (string, required): Allowed values: `source-mapping`
  - `id` (string, required): The ULID ID of the source mapping Example: `01K5HQC66PGHV35SYJC5ZV3DZA`
  - `attributes` (object, required)
    - `property_mappings` (oneOf[], nullable): A mapping of source property IDs to source mappings
      - One of:
        - Option 1: `ConstantPropertyMapping` Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/update_source_mapping.json).
        - Option 2: `SimplePropertyMapping` Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/update_source_mapping.json).
    - `relationship_mappings` (object[], nullable): A mapping of source relationship IDs to source mappings
      - `relationship_id` (string, required): Object schema relationship ULID ID Example: `01K97SE7GH4TE57FVNQY310QAK`
      - `type` (string, required): String literal for serialization Allowed values: `simple` Example: `simple`
      - `source` (oneOf, required): Data source mapping Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/update_source_mapping.json).

### Example request body

```json
{
  "data": {
    "type": "source-mapping",
    "id": "01K5HQC66PGHV35SYJC5ZV3DZA",
    "attributes": {}
  }
}
```

## Responses

### 200: Success

Content type: `application/vnd.api+json`

- `data` (object, required)
  - `type` (string, required): Allowed values: `source-mapping`
  - `id` (string, required): The ULID ID of the source mapping Example: `01K5HQC66PGHV35SYJC5ZV3DZA`
  - `attributes` (object, required)
    - `property_mappings` (oneOf[], required): A mapping of source property IDs to source mappings
      - One of:
        - Option 1: `ConstantPropertyMapping` Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/update_source_mapping.json).
        - Option 2: `SimplePropertyMapping` Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/update_source_mapping.json).
    - `relationship_mappings` (object[], required): A mapping of source relationship IDs to source mappings Same fields as SimpleRelationshipMapping in the request body above.
  - `links` (object, required)
    - `self` (string<uri>, required)
- `links` (ObjectLinks): Same fields as the first ObjectLinks above.
- `meta` (object): Response-level metadata
  - `agent_hints` (object): Optional hints emitted by the API for agent callers
    - `next_steps` (string[]): Suggested follow-up actions for agents to take after this response

#### Example response body

```json
{
  "data": {
    "type": "source-mapping",
    "id": "01K5HQC66PGHV35SYJC5ZV3DZA",
    "attributes": {
      "property_mappings": [
        {
          "id": 1,
          "type": "constant",
          "value": "active"
        }
      ],
      "relationship_mappings": [
        {
          "relationship_id": "01K97SE7GH4TE57FVNQY310QAK",
          "type": "simple",
          "source": {
            "source_id": "01JXKX2HM7NV4QPTR5WE8BF6GY",
            "type": "custom-object",
            "id_path": "$['object_record']['subscription_id']",
            "related_id_path": "$['object_record']['pet_id']",
            "update_strategy": "replace_from_origin"
          }
        }
      ]
    },
    "links": {
      "self": "https://www.example.com"
    }
  },
  "links": {
    "self": "https://www.example.com"
  },
  "meta": {
    "agent_hints": {
      "next_steps": [
        "string"
      ]
    }
  }
}
```

### 4XX: Client Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```

### 5XX: Server Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```
