Save the column mapping for an import (user)
Saves how the file's columns map onto contact fields. Each entry maps one
column (column = a file_columns[].id from mapping-options) onto one
field. field must be one of the allow-listed target fields; any other
value (including private_owner_id, pbx_id, is_private, or a groups
column) is rejected with 422, so a client cannot forge a mapping to assign
contacts to another user or tenant. A contactPhoneNumbers mapping must
carry a type sub-field. A single-value field may be mapped to at most one
column; only fields flagged multiple: true (currently
contactPhoneNumbers) may take several columns, otherwise a duplicate
mapping is rejected with 422. Only an incomplete import can be mapped
(otherwise 409).
User bearer token. Default authentication for customer-facing endpoints.
Obtain a token by calling POST /login with your credentials, then send it
on every subsequent request as Authorization: Bearer <token>. The token
inherits the permissions and PBX scope of the authenticated user.
- HTTP Authorization Scheme
bearer- Bearer format
Bearer <token>
application/jsonRequest body · required
mappings*array<object>
name10subfieldsarray<object>
typemobileResponses
550e8400-e29b-41d4-a716-446655440000incomplete pending processing completed completed_with_errors failedincompletecsv xls xlsx nullcsv42311"UTF-81mappingsarray<object>
name10subfieldsarray<object>
typemobile2026-01-15T09:30:00Z2026-01-15T09:31:00Z2026-01-15T09:31:45Zrecordsarray<object>
550e8400-e29b-41d4-a716-4466554400101errorsarray<object>
7emailmessagesarray<string>
row_dataobject
Authorization Token is missingmessagearray<string>
The given data was invalid.errorsobject
filterarray<string>
sortarray<string>
pagearray<string>
per_pagearray<string>
https://cockpit.voxbi.com/api/v1/contacts/imports/{id}/mappings
curl -X PUT 'https://cockpit.voxbi.com/api/v1/contacts/imports/{id}/mappings' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{"mappings":[{"field":"name1","column":0},{"field":"name2","column":1},{"field":"contactPhoneNumbers","column":2,"subfields":[{"name":"type","value":"mobile"}]}]}'
const response = await fetch('https://cockpit.voxbi.com/api/v1/contacts/imports/{id}/mappings', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
body: JSON.stringify({
"mappings": [
{
"field": "name1",
"column": 0
},
{
"field": "name2",
"column": 1
},
{
"field": "contactPhoneNumbers",
"column": 2,
"subfields": [
{
"name": "type",
"value": "mobile"
}
]
}
]
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.put('https://cockpit.voxbi.com/api/v1/contacts/imports/{id}/mappings',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
json={
"mappings": [
{
"field": "name1",
"column": 0
},
{
"field": "name2",
"column": 1
},
{
"field": "contactPhoneNumbers",
"column": 2,
"subfields": [
{
"name": "type",
"value": "mobile"
}
]
}
]
}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
'http' => [
'method' => 'PUT',
'header' => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
'content' => '{
\"mappings\": [
{
\"field\": \"name1\",
\"column\": 0
},
{
\"field\": \"name2\",
\"column\": 1
},
{
\"field\": \"contactPhoneNumbers\",
\"column\": 2,
\"subfields\": [
{
\"name\": \"type\",
\"value\": \"mobile\"
}
]
}
]
}',
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/contacts/imports/{id}/mappings', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"mappings": [ … ]
{ … },
{ … },
{ … }
"subfields": [ … ]
{ … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"message": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
application/json{ … }
"errors": { … }
"filter": [ … ],
"sort": [ … ],
"page": [ … ],
"per_page": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057