> This page is for Unified.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# /field-mappings/{field_mapping_id}

DELETE https://api.merge.dev/api/chat/v1/field-mappings/{field_mapping_id}

Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.

Reference: https://docs.merge.dev/merge-unified/chat/linked-account/field-mapping/field-mappings-destroy

## Authentication

- `Authorization` header (bearer token, required) — Token-based authentication with required prefix "Bearer"

## Servers

- `https://api.merge.dev/api/chat/v1` (Production, default)
- `https://api-eu.merge.dev/api/chat/v1` (ProductionEU)
- `https://api-ap.merge.dev/api/chat/v1` (ProductionAPSE1)

## Request

### Path parameters

- `field_mapping_id` (string, required)

### Headers

- `X-Account-Token` (string, required) — Token identifying the end user.

## Response

### 204

- `model` (FieldMappingApiInstance, required)
- `warnings` (list of WarningValidationProblem, required)
- `errors` (list of ErrorValidationProblem, required)
- `logs` (list of DebugModeLog, optional)

## Types

### FieldMappingApiInstance

- `id` (string, optional)
- `is_integration_wide` (boolean, optional)
- `target_field` (FieldMappingApiInstanceTargetField, optional, nullable)
- `remote_field` (FieldMappingApiInstanceRemoteField, optional, nullable)
- `jmes_path` (string, optional, nullable)
- `advanced_mapping_expression` (string, optional, nullable)

### WarningValidationProblem

- `title` (string, required)
- `detail` (string, required)
- `problem_type` (string, required)
- `source` (ValidationProblemSource, optional)
- `block_merge_link` (boolean, optional)
- `raw_error` (string, optional)
- `error_code` (integer, optional)

### ErrorValidationProblem

- `title` (string, required)
- `detail` (string, required)
- `problem_type` (string, required)
- `source` (ValidationProblemSource, optional)
- `block_merge_link` (boolean, optional)
- `raw_error` (string, optional)
- `error_code` (integer, optional)

### DebugModeLog

- `log_id` (string, required)
- `dashboard_view` (string, required)
- `log_summary` (DebugModelLogSummary, required)

### FieldMappingApiInstanceTargetField

- `name` (string, required)
- `description` (string, required)
- `is_organization_wide` (boolean, required)

### FieldMappingApiInstanceRemoteField

- `remote_key_name` (string, required, nullable)
- `schema` (map from string to any, required, nullable)
- `remote_endpoint_info` (FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo, required)

### ValidationProblemSource

- `pointer` (string, required)

### DebugModelLogSummary

- `url` (string, required)
- `method` (string, required)
- `status_code` (integer, required)

### FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo

- `method` (string, required, nullable)
- `url_path` (string, required, nullable)
- `field_traversal_path` (list of string, required, nullable)

## Examples

**Response**

```json
{
  "model": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "is_integration_wide": true,
    "target_field": {
      "name": "example_target_field_name",
      "description": "this is a example description of a target field",
      "is_organization_wide": true
    },
    "remote_field": {
      "remote_key_name": "example_remote_field_key",
      "schema": {
        "type": "string"
      },
      "remote_endpoint_info": {
        "method": "GET",
        "url_path": "/example-url-path",
        "field_traversal_path": [
          "example_remote_field_key"
        ]
      }
    },
    "jmes_path": "[0].example_jmes_path",
    "advanced_mapping_expression": "$[0].example_jsonata"
  },
  "warnings": [
    {
      "title": "Unrecognized Field",
      "detail": "An unrecognized field, age, was passed in with request data.",
      "problem_type": "UNRECOGNIZED_FIELD",
      "source": {
        "pointer": "/age"
      },
      "block_merge_link": true,
      "raw_error": "string",
      "error_code": 1
    }
  ],
  "errors": [
    {
      "title": "Missing Required Field",
      "detail": "custom_fields is a required field on model.",
      "problem_type": "MISSING_REQUIRED_FIELD",
      "source": {
        "pointer": "/model/custom_fields"
      },
      "block_merge_link": true,
      "raw_error": "string",
      "error_code": 1
    }
  ],
  "logs": [
    {
      "log_id": "99433219-8017-4acd-bb3c-ceb23d663832",
      "dashboard_view": "https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832",
      "log_summary": {
        "url": "www.exampleintegration.com/api/v1/exampleapi",
        "method": "POST",
        "status_code": 200
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.merge.dev/api/chat/v1/field-mappings/field_mapping_id"

headers = {
    "X-Account-Token": "X-Account-Token",
    "Authorization": "Bearer <token>"
}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.merge.dev/api/chat/v1/field-mappings/field_mapping_id';
const options = {
  method: 'DELETE',
  headers: {'X-Account-Token': 'X-Account-Token', Authorization: 'Bearer <token>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.merge.dev/api/chat/v1/field-mappings/field_mapping_id"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("X-Account-Token", "X-Account-Token")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.merge.dev/api/chat/v1/field-mappings/field_mapping_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["X-Account-Token"] = 'X-Account-Token'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.merge.dev/api/chat/v1/field-mappings/field_mapping_id")
  .header("X-Account-Token", "X-Account-Token")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.merge.dev/api/chat/v1/field-mappings/field_mapping_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Account-Token' => 'X-Account-Token',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.merge.dev/api/chat/v1/field-mappings/field_mapping_id");
var request = new RestRequest(Method.DELETE);
request.AddHeader("X-Account-Token", "X-Account-Token");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Account-Token": "X-Account-Token",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.merge.dev/api/chat/v1/field-mappings/field_mapping_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```