Check a configuration file (pbx)
/configuration-import/validate
Check a PBX configuration file (kind external) against the published rules and the PBX of
your API key, without storing anything. The checks that look at this PBX's own data run (for
example an email address one of its users already has). Checks against other PBXs (an email address,
an alternative SIP username or a phone number used elsewhere) do not run here and no answer ever
tells anything about another PBX: they run in Cockpit, when a person reviews the imported version.
Send multipart/form-data with the file as file: a .zip (the file configuration.json and a
files/ folder with sound files) or a plain .json. Fix every error in the answer and send it
again until it is valid.
Needs the configuration-import scope. Rate limit: 6 checks per minute per PBX. One file of a PBX
is checked at a time (409 while another is). A plain .json upload may be at most 5 MB; inside a zip,
configuration.json may be at most 16 MB.
Answers 503 while configuration versions are switched off.
API key created on the Cockpit Integrations page (an "API key" integration).
It is a bearer token owned by the customer's PBX and limited to the scopes
selected when the key was created (e.g. phone-numbers, push-configuration).
Send it in the Authorization header:
Authorization: Bearer <api_key>
Manage keys (create / reveal / revoke) from Integrations → New integration → API key.
- HTTP Authorization Scheme
bearer
application/jsonRequest body · required · multipart/form-data
Responses
1countsobject
notes*array<object>
example.skippedinfo warninginfoOne unsupported feature was left out.errors*array<object>
row.pbx_idThe PBX id must be "00000000-0000-4000-8000-000000000001".extensionExtension00000000-0000-4000-8000-000000000010pbx_id1countsobject
notes*array<object>
example.skippedinfo warninginfoOne unsupported feature was left out.errors*array<object>
row.pbx_idThe PBX id must be "00000000-0000-4000-8000-000000000001".extensionExtension00000000-0000-4000-8000-000000000010pbx_iderrorsobject
https://cockpit.voxbi.com/api/v1/configuration-import/validate
curl -X POST 'https://cockpit.voxbi.com/api/v1/configuration-import/validate' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=@/path/to/file'
const body = new FormData();
body.append('file', fileInput.files[0]); // /path/to/file
const response = await fetch('https://cockpit.voxbi.com/api/v1/configuration-import/validate', {
method: 'POST',
headers: { Authorization: `Bearer ${YOUR_TOKEN}` },
body,
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://cockpit.voxbi.com/api/v1/configuration-import/validate',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
files={
'file': open('/path/to/file', 'rb'),
},
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$ch = curl_init('https://cockpit.voxbi.com/api/v1/configuration-import/validate');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_TOKEN']);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'file' => new CURLFile('/path/to/file'),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);
{ … }
{ … }
"counts": { … },
"notes": [ … ]
{ … }
{ … }
application/json{ … }
application/json{ … }
{ … }
{ … }
"errors": [ … ],
{ … }
{ … }
60application/json