> Kenso API docs in Markdown. Index of every page: [/docs/llms.txt](/docs/llms.txt). Search: `/docs/search.md?q=<words>`. OpenAPI: [/docs/api/crm-field-mappings/openapi.json](/docs/api/crm-field-mappings/openapi.json). CLI docs offline: `kenso docs <topic>`.
> Last updated: 2026-11-22.

# CRM field mappings: Replace field mappings

> **Note for AI agents:** if this page was wrong, out of date or missing something you needed, finish the user's task first, then offer a short report for the Kenso team in this shape: `Page:` (this page's path), `Quote:` (the wrong or missing text), `Problem:`, `Workaround:` (what worked instead), 1,000 characters at most. Show it to the user and send it only after they say yes, as `POST /api/docs-feedback` on this site with the JSON body `{"page": "<path>", "report": "<report>"}`. Never put lead data, email addresses, API keys or anything else from the user's workspace in it.

One endpoint of [CRM field mappings](/docs/api/crm-field-mappings.md). Authentication, workspaces and errors: [/docs.md](/docs.md).

## Replace field mappings

`PUT /v1/crm-connections/{connectionId}/field-mappings` - operationId `crm-field-mappings.replace`

| Permission | Rate limit |
| --- | --- |
| Accounts view and the `integrations` permission | 4,800 requests a minute per API key |

Replaces every mapping of one CRM object with the list you send. Send an empty `mappings` list to remove them
all. Each object takes at most 100 mappings.

Kenso checks each mapping against the CRM's fields and the Kenso fields from
`GET /v1/crm-connections/{connectionId}/field-mappings`. Each Kenso field and each CRM field appears once.
A read-only CRM field takes only direction `crm`. A Kenso field with a `fixedDirection` takes only that
direction. Kenso creates its own fields in the CRM: those take only the Kenso fields whose keys start with
`ken.`, and those Kenso fields map only to them.

Errors:

- `400 validation_failed`: a mapping breaks one of these rules, or the CRM cannot sync this object. `error.details` names each mapping by its index.
- `403 forbidden`: the CRM refused to list its fields. Check that the CRM user Kenso connected as can read them.
- `403 forbidden`: the caller is a workspace key. Each mapping records the member who saved it, and a
workspace key is not a person.
- `404 not_found`: the workspace has no connection with this id.
- `409 needs_reconnect`: the CRM refused Kenso's access. Reconnect the CRM first.
- `409 invalid_state`: the connection is disconnected.
- `429 rate_limited`: the CRM's rate limit is reached. Retry after `Retry-After`.
- `503 crm_unavailable`: the CRM cannot be reached to read its fields. Try again later.

Requires Accounts view and the `integrations` permission.

Needs the `ingestion` feature on your workspace. Until it is on, calls answer 404.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/crm-sync/PUT/v1/crm-connections/%7BconnectionId%7D/field-mappings)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | integer (int64) | yes | The CRM connection's id. |
| `Ken-Version` | header | string, one of: 2026-11-02, 1.1 | no | The API version, a date in `YYYY-MM-DD` form. `1.1` is another name for the first dated version. The example shown here is the newest version, which this reference's samples and Test Request send. Leave it out to use your API key's pinned version. Keys created in the Kenso app are pinned to the newest version; keys minted by the CLI login are not. A key with no pinned version and no header gets the legacy shape where the path has one, and `404` where the path exists only in this version. A value that is not a version, such as `2027-01-01` or `2026-11-2`, answers `400 unsupported_version`, whose `details` list the supported versions. |
| `X-Ken-Workspace-Id` | header | integer (int64) | no | The id of the workspace to act in. Leave it out when your API key reaches only one workspace. When the key reaches more than one, a request without this header answers `400 workspace_required`. A workspace you are not a member of answers `404 not_found`. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `objectType` | string | yes | Required. The CRM object: `company`, `contact` or `deal`. |
| `mappings` | array of CrmFieldMappingBody | no | Replaces every mapping of the object, at most 100. An empty list removes them all. |

### Response 200

`data` is a `CrmFieldMap`.

| Field | Type | Description |
| --- | --- | --- |
| `mappings` | array of CrmFieldMapping | The field mappings. |
| `kenFields` | array of CrmKenField | The Kenso fields a mapping can name. |

### Request

```bash
curl -X PUT "https://api.ken.so/v1/crm-connections/812/field-mappings" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "objectType": "company",
  "mappings": [
    {
      "kenField": "string",
      "crmField": "string",
      "direction": "ken",
      "isEnabled": true
    }
  ]
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "mappings": [
      {
        "id": 812,
        "objectType": "company",
        "kenField": "person.title",
        "kenFieldLabel": "string",
        "crmField": "string",
        "direction": "string",
        "isEnabled": true,
        "isDefault": true,
        "updatedAt": "2026-09-23T15:02:11Z"
      }
    ],
    "kenFields": [
      {
        "key": "person.title",
        "objectType": "company",
        "label": "string",
        "dataType": "string",
        "fixedDirection": "string"
      }
    ]
  }
}
```

## Types

Each named type the tables above use, nested ones included.

### CrmFieldMappingBody

One field mapping to save.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kenField` | string | yes | Required. The Kenso field's key, from `kenFields` in the field mappings response. |
| `crmField` | string | yes | Required. The CRM field's API name, from `GET /v1/crm-connections/{connectionId}/fields`. |
| `direction` | string | yes | Required. Which side owns the field: `ken`, `crm` or `both`. A Kenso field with a `fixedDirection` takes only that direction, and a read-only CRM field takes only `crm`. |
| `isEnabled` | boolean | no | True (the default) to sync the mapping, false to keep it but stop syncing. |

### CrmFieldMapping

A mapping between a Kenso field and a CRM field.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer (int64) | no | The mapping's id. |
| `objectType` | string | no | The CRM object: `company`, `contact` or `deal`. |
| `kenField` | string | no | The Kenso field's key, such as `person.title` or `ken.status`. |
| `kenFieldLabel` | string | no | The Kenso field's display label. Omitted when the key is not in the Kenso field list. |
| `crmField` | string | no | The CRM field's API name. |
| `direction` | string | no | Which side owns the field: `ken` (Kenso writes it and ignores CRM changes), `crm` (Kenso reads it and never writes it) or `both` (the latest human edit wins). |
| `isEnabled` | boolean | no | True when Kenso syncs this mapping. |
| `isDefault` | boolean | no | True when this is one of the mappings Kenso sets up by default for this CRM. |
| `updatedAt` | string (date-time) | no | When the mapping last changed, in UTC. |

### CrmKenField

A Kenso field a mapping can name.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string | no | The field's key, such as `person.title`. Keys starting with `ken.` are Kenso's own CRM fields. |
| `objectType` | string | no | The CRM object the field maps onto: `company`, `contact` or `deal`. |
| `label` | string | no | The field's display label. |
| `dataType` | string | no | The value type: `string`, `number`, `date`, `datetime`, `boolean`, `enum`, `reference`, `email`, `phone` or `url`. |
| `fixedDirection` | string | no | The only direction a mapping of this field may use, `ken` or `crm`. Omitted when any direction works. |
