REST API
Company Backups API
Generated from the Celerp 2.5.5 OpenAPI schema, 12 October 2026.
POST /company-backups/bootstrap/discard
Discard Company Backup During Initial Setup
Delete a company backup uploaded during first-time setup. It is closed once any user exists.
Request body
| Field | Type | Required | Description |
|---|
upload_token | string | yes | Token returned when the backup file was uploaded. |
Responses
| Status | Description | Body |
|---|
204 | Success. No response body is returned. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/bootstrap/discard \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /company-backups/bootstrap/import-module
Bootstrap Import Module
Parameters
| Name | In | Required | Type | Description |
|---|
x-setup-code | header | -- | string, optional | Setup code that authorizes this request while the instance is still being set up. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/bootstrap/import-module \
-H "Authorization: Bearer $TOKEN"
POST /company-backups/bootstrap/prepare
Bootstrap Prepare
Parameters
| Name | In | Required | Type | Description |
|---|
x-setup-code | header | -- | string, optional | Setup code that authorizes this request while the instance is still being set up. |
Request body
| Field | Type | Required | Description |
|---|
upload_token | string | yes | Token returned when the backup file was uploaded. |
consent | array of string | -- | Names of modules from outside Celerp that may be turned on. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/bootstrap/prepare \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /company-backups/bootstrap/read
Bootstrap Read
Parameters
| Name | In | Required | Type | Description |
|---|
x-setup-code | header | -- | string, optional | Setup code that authorizes this request while the instance is still being set up. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/bootstrap/read \
-H "Authorization: Bearer $TOKEN"
POST /company-backups/bootstrap/restore
Bootstrap Restore
Create the first owner and restore the backup as their company in one commit, then
sign them in. Repeating it with the same account opens the same company.
Parameters
| Name | In | Required | Type | Description |
|---|
x-setup-code | header | -- | string, optional | Setup code that authorizes this request while the instance is still being set up. |
Request body
| Field | Type | Required | Description |
|---|
upload_token | string | yes | Upload Token |
name | string | yes | Name |
email | string | yes | Email |
password | string | yes | Password |
company_name | string, optional | -- | Company Name |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/bootstrap/restore \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /company-backups/bootstrap/staged
Bootstrap Staged
The upload token was issued against the setup code and names one private upload,
so showing or deleting that upload needs nothing more.
Parameters
| Name | In | Required | Type | Description |
|---|
upload_token | query | yes | string | Token returned when the backup file was uploaded, used to read back the staged file. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/company-backups/bootstrap/staged \
-H "Authorization: Bearer $TOKEN"
POST /company-backups/discard
Discard Uploaded Company Backup
Delete the caller's uploaded company backup. Nothing else is touched.
Request body
| Field | Type | Required | Description |
|---|
upload_token | string | yes | Token returned when the backup file was uploaded. |
Responses
| Status | Description | Body |
|---|
204 | Success. No response body is returned. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/discard \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /company-backups/download
Download Backup
Back up the company the session is on and serve the file, deleted once sent.
Parameters
| Name | In | Required | Type | Description |
|---|
run_id | query | -- | string, optional | Identifier of the migration run whose provenance is recorded in the backup. Omit it for a plain backup. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/company-backups/download \
-H "Authorization: Bearer $TOKEN"
POST /company-backups/import-module
Import Module for Company Backup
Install a module an uploaded company backup needs, as the Modules page does. The module is installed turned off. Send the module archive as a multipart upload with the `upload_token`.
Responses
| Status | Description | Body |
|---|
200 | Returns the uploaded backup's preview, checked again. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/import-module \
-H "Authorization: Bearer $TOKEN"
POST /company-backups/prepare
Prepare Modules for Company Backup
Turn on the modules an uploaded company backup needs, then restart Celerp to load them. Bundled modules are turned on. A module from outside Celerp is turned on only when it is named in `consent`.
Request body
| Field | Type | Required | Description |
|---|
upload_token | string | yes | Token returned when the backup file was uploaded. |
consent | array of string | -- | Names of modules from outside Celerp that may be turned on. |
Responses
| Status | Description | Body |
|---|
200 | Returns `restart` and `restarting`, both false when no restart was needed. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/prepare \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /company-backups/reactivate
Reactivate Restored Company
Reactivate the deactivated company an uploaded backup was already restored as, instead of restoring a copy, and switch the caller to it. Connectors that deactivation disconnected are named in the response and are not reconnected.
Request body
| Field | Type | Required | Description |
|---|
upload_token | string | yes | Token returned when the backup file was uploaded. |
mode | string | yes | How to restore: `settings` or `new_company`. |
plan_fingerprint | string | yes | Fingerprint of the restore plan the preview returned. |
company_name | string, optional | -- | Name for the restored company. Optional. |
Responses
| Status | Description | Body |
|---|
200 | Returns the company ID and name, the outcome, the connectors to reconnect, and session tokens for the company. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/reactivate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
POST /company-backups/read
Read Company Backup
Upload a company backup file and check it. The file is held privately until it is restored or discarded. Send it as a multipart upload with a `mode` of `settings` (the default) or `new_company`. The response previews what restoring does.
Responses
| Status | Description | Body |
|---|
200 | Returns the `upload_token`, a summary of the backup, and the plan for restoring it. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/read \
-H "Authorization: Bearer $TOKEN"
POST /company-backups/restore
Restore Company Backup
Restore an uploaded company backup as the preview showed it, and switch the caller to the restored company. Send the `plan_fingerprint` from the preview. The request is refused if the backup or the plan changed since. Repeating a restore that finished opens the company it made.
Request body
| Field | Type | Required | Description |
|---|
upload_token | string | yes | Token returned when the backup file was uploaded. |
mode | string | yes | How to restore: `settings` or `new_company`. |
plan_fingerprint | string | yes | Fingerprint of the restore plan the preview returned. |
company_name | string, optional | -- | Name for the restored company. Optional. |
Responses
| Status | Description | Body |
|---|
200 | Returns the company ID and name, the outcome, the team members and role permissions restored, and session tokens for the company. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/restore \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
GET /company-backups/staged
Staged Backup
Parameters
| Name | In | Required | Type | Description |
|---|
upload_token | query | yes | string | Token returned when the backup file was uploaded, used to read back the staged file. |
mode | query | -- | string | How the backup would be restored, which decides the preview returned. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/company-backups/staged \
-H "Authorization: Bearer $TOKEN"
POST /company-backups/start-company/read
Read Company Backup for a Login With No Company
Upload a company backup file for a login that has no company left, and check it. The request carries the login's email and password as form fields with the file. The response previews what restoring does.
Responses
| Status | Description | Body |
|---|
200 | Returns the `upload_token`, a summary of the backup, and the plan for restoring it. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/start-company/read \
-H "Authorization: Bearer $TOKEN"
POST /company-backups/start-company/restore
Restore Company Backup for a Login With No Company
Restore an uploaded company backup as the company of a login that has none left, as the preview showed it, and sign in to that company. Send the `plan_fingerprint` from the preview.
Request body
| Field | Type | Required | Description |
|---|
email | string | yes | Email address of the login. |
password | string | yes | Password of the login. |
upload_token | string | yes | Token returned when the backup file was uploaded. |
plan_fingerprint | string | yes | Fingerprint of the restore plan the preview returned. |
company_name | string, optional | -- | Name for the restored company. Optional. |
Responses
| Status | Description | Body |
|---|
200 | Returns the company ID and name, the outcome, and session tokens for the company. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/company-backups/start-company/restore \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'