Skip to content

Import a configuration file (pbx)

post /configuration-imports

Send a PBX configuration file (kind external) to be stored as a configuration version of the PBX of your API key. The import never applies anything to the PBX. It adds the file as a configuration version of the PBX, like "Back up now"; a person opens that version in Cockpit, reviews the data and what a restore would change, settles any conflict with other PBXs, and decides to restore it (the restore takes its own safety backup first).

The file is checked in this request with the same checks as POST /configuration-import/validate: a file that breaks a rule answers 422 with every error and nothing is stored. A valid file is answered 202 and stored; a background job converts the audio and stores the version. Poll GET /configuration-imports/{id} until status is ready (the version is stored and waits for review; the answer then holds version_id and a link to the version's page in Cockpit) or failed.

What a restore of the version does (in Cockpit, not here). It restores exactly what the file contains, per entity type. A type the file leaves out of data is not touched; a type it holds (even empty, for example "queue": {}) ends as in the file. Users, locations, phone numbers, parent devices and multicast groups are never deleted when missing from the file. The sets that belong to a parent follow it.

Checks against other PBXs (an email address, an alternative SIP username or a phone number used elsewhere) do not run in the API and no answer tells anything about another PBX. They run in Cockpit on the version's review page, where a person fixes each conflict before restoring.

Limits. At most 10 versions made through the API may wait for review per PBX (409 for the next file until one is restored or deleted). A version nobody restored is removed after 30 days. One file of a PBX is checked at a time (409), and the PBX's versions are made one after the other. The JSON of a file is limited to 16 MB inside a zip; a plain .json upload to 5 MB and a zip to 50 MB.

Needs the configuration-import scope. Rate limit: 6 files per minute per PBX. Answers 503 while configuration versions are switched off.

HTTP: IntegrationApiKey

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
accept header · string
example: application/json

Request body · required · multipart/form-data

Request schema
file*file
The configuration file: a `.zip` of at most 50 MB, or a plain `.json` of at most 5 MB (send a zip above that).

Responses

Accepted. The file is valid and stored for the background job; follow it with the `self` link. Among other fields the body holds the `id`, the `status` (`queued`), the times and the notes.
Response schema
id*string · uuid
Import identifier, to read the status. It is not the id of the version (see `version_id`).
example: 550e8400-e29b-41d4-a716-446655440000
status*string
`queued`: the checked file is stored and waits for a worker. `processing`: the version is being made (audio converted, file stored). `ready`: the version is stored among the PBX's configuration versions and waits for a person to review it in Cockpit (nothing is applied to the PBX). `restored`: a person restored the version in Cockpit (`restored_at`). `failed`: no version was made, the PBX was not changed (see `errors`). `removed`: the version was deleted before anyone restored it, by a person or by the retention (30 days).
enum: queued processing ready restored failed removed
example: ready
namestring | null
The name of the version (the file's `snapshot.name`), shown in the list of configuration versions (set once the version is stored).
example: Move from the old provider
created_atstring · date-time
When the file was accepted.
example: 2026-11-24T10:15:00+01:00
started_atstring | null · date-time
When the version started to be made (null while queued).
example: 2026-11-24T10:15:02+01:00
finished_atstring | null · date-time
When the version was stored or the import failed (null until then).
example: 2026-11-24T10:15:09+01:00
version_idstring | null · uuid
The configuration version this import added to the PBX (when `status` is `ready` or `restored`).
example: 550e8400-e29b-41d4-a716-446655440001
restored_atstring · date-time
When a person restored the version in Cockpit (only when `status` is `restored`).
example: 2026-11-25T09:30:00+01:00
errors*array<object>
Why the import failed (only when `status` is `failed`), in the shape of the validation errors. Readable text, never SQL. Empty otherwise.
codestring
example: row.pbx_id
messagestring
example: The PBX id must be "00000000-0000-4000-8000-000000000001".
modelstring | null
example: extension
model_labelstring | null
example: Extension
rowstring | null
columnstring | null
notesarray<object>
The notes the file's author left about what could not be brought over (single import only).
codestring
example: example.skipped
levelstring
enum: info warning
example: info
textstring
example: One unsupported feature was left out.
subjectstring | null
links*object
selfstring · uri
Where to read this import's status.
example: https://cockpit.voxbi.com/api/v1/configuration-imports/550e8400-e29b-41d4-a716-446655440000
versionstring · uri
The version's page in Cockpit, where a person reviews and restores it (when the version exists).
example: https://cockpit.voxbi.com/admin/configuration-versions/550e8400-e29b-41d4-a716-446655440001/show
Unauthenticated. The `Authorization: Bearer <token>` header was missing, malformed, or names a token that has been revoked or deleted.
Response schema
messagestring
Forbidden. The bearer token authenticated successfully but does not carry the scope this endpoint requires. Re-create the Integrations API key with the missing scope selected (Integrations > New integration > API key). On a write with a user bearer token, the user lacks the Cockpit permission the same change needs (the message names it).
Response schema
messagestring
Conflict. Nothing was stored. Either this PBX already has the most versions made through the API waiting for review (10; restore or delete one in Cockpit, or wait for the 30-day retention), or another file of this PBX is being checked right now (retry shortly).
Response schema
messagestring
Payload Too Large. The file is over the size limit (50 MB). Nothing was checked or stored.
Response schema
messagestring
Unprocessable. Either the request is malformed (no `file`, a wrong extension, an unreadable file, one over the JSON limit of 16 MB: the usual `message` and `errors` of the API), or the file breaks the rules: `valid` is false and `errors` lists every broken rule. Nothing was stored.
Response schema
oneOf
valid*boolean
example: 1
countsobject
Records in the file per entity name (only when valid).
Free-form object
notes*array<object>
The file's own notes about what could not be brought over.
codestring
example: example.skipped
levelstring
enum: info warning
example: info
textstring
example: One unsupported feature was left out.
subjectstring | null
errors*array<object>
Every rule the file breaks (at most 1000). `code` is listed in `x-cockpit-error-codes` of the rule set; `file.invalid` means the file could not be read at all.
codestring
example: row.pbx_id
messagestring
example: The PBX id must be "00000000-0000-4000-8000-000000000001".
modelstring | null
Entity name of the record kind.
example: extension
model_labelstring | null
example: Extension
rowstring | null
The record's id in the file.
example: 00000000-0000-4000-8000-000000000010
columnstring | null
example: pbx_id
messagestring
errorsobject
Free-form object
Too Many Requests. The rate limit for this action has been exceeded. Retry after the window indicated by the Retry-After header.
Response schema
messagestring
Service Unavailable. Configuration versions are switched off on this installation, so configuration import is not available. Nothing was read or stored.
Response schema
messagestring
post https://cockpit.voxbi.com/api/v1/configuration-imports
Base URL
Request sample
curl -X POST 'https://cockpit.voxbi.com/api/v1/configuration-imports' \
  -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-imports', {
  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-imports',
    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-imports');
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);
Sample request · multipart/form-data
{ … }
"file": "/path/to/file"
}
{ … }
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "queued",
"name": "Move from the old provider",
"created_at": "2026-11-24T10:15:00+01:00",
"started_at": null,
"finished_at": null,
"version_id": null,
"errors": [],
"notes": [ … ],
{ … }
"code": "example.skipped",
"level": "info",
"text": "One unsupported feature was left out.",
"subject": null
}
],
"links": { … }
"self": "https://cockpit.voxbi.com/api/v1/configuration-imports/550e8400-e29b-41d4-a716-446655440000"
}
}
{ … }
"message": "Unauthenticated."
}
Content-Type string
example: application/json
{ … }
"message": "Invalid ability provided."
}
Content-Type string
example: application/json
{ … }
"message": "This PBX already has 10 imported versions waiting for review in Cockpit. Restore or delete one of them first."
}
{ … }
"message": "The file is too large. The limit is 50 MB."
}
{ … }
"valid": false,
"errors": [ … ],
{ … }
"code": "row.pbx_id",
"message": "The PBX id must be "00000000-0000-4000-8000-000000000001".",
"model": "extension",
"model_label": "Extension",
"row": "00000000-0000-4000-8000-000000000010",
"column": "pbx_id"
}
],
"notes": []
}
{ … }
"message": "Too Many Attempts."
}
Retry-After integer
Seconds to wait before retrying.
example: 60
Content-Type string
example: application/json
{ … }
"message": "Configuration import is not available on this system: configuration versions are switched off."
}