Replaces the whole list of contact field mappings. Send an empty list to remove them all. Sources and modes are explained in Get contact field mappings.
Request#
| Field | Type | Required | Description |
|---|---|---|---|
mappings |
array of objects | Yes | Up to 50 mappings. A bare JSON array is also accepted as the body. |
Each mapping:
| Field | Type | Required | Description |
|---|---|---|---|
contact_field |
string | Yes | 1 to 64 letters, digits or underscores. first_name, last_name, email, or a custom field name. |
source |
string | Yes | analysis.<field>, variable.<key> or metadata.<key>. The part after the dot is 1 to 128 letters, digits, _, . or -. |
mode |
string | No | overwrite, fill_if_empty or accumulate. Default overwrite. |
Example request#
curl -X PUT https://api.tried.com.au/contact-field-mappings \
-H "Authorization: Bearer $TRIED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mappings": [
{ "contact_field": "first_name", "source": "analysis.caller_first_name", "mode": "fill_if_empty" },
{ "contact_field": "last_outcome", "source": "analysis.call_summary" }
]
}'const res = await fetch("https://api.tried.com.au/contact-field-mappings", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
mappings: [
{ contact_field: "first_name", source: "analysis.caller_first_name", mode: "fill_if_empty" },
{ contact_field: "last_outcome", source: "analysis.call_summary" },
],
}),
});
const data = await res.json();import os, requests
res = requests.put(
"https://api.tried.com.au/contact-field-mappings",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
json={
"mappings": [
{"contact_field": "first_name", "source": "analysis.caller_first_name", "mode": "fill_if_empty"},
{"contact_field": "last_outcome", "source": "analysis.call_summary"},
]
},
)
data = res.json()Response#
200 OK
The saved mappings, with defaults applied, and the allowed modes.
{
"mappings": [
{ "contact_field": "first_name", "source": "analysis.caller_first_name", "mode": "fill_if_empty" },
{ "contact_field": "last_outcome", "source": "analysis.call_summary", "mode": "overwrite" }
],
"modes": ["overwrite", "fill_if_empty", "accumulate"]
}Errors#
| Status | When |
|---|---|
400 |
Body fails validation, for example 0.source: source is analysis.<field>, variable.<key> or metadata.<key>. |
401 |
Missing or invalid API key. |
403 |
The key's IP allowlist or scopes reject the request, or the caller's dashboard role is not admin or developer (Requires role: admin or developer). This route needs the calls scope. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.