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

FieldTypeRequiredDescription
upload_tokenstringyesToken returned when the backup file was uploaded.

Responses

StatusDescriptionBody
204Success. No response body is returned.--
422The 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

NameInRequiredTypeDescription
x-setup-codeheader--string, optionalSetup code that authorizes this request while the instance is still being set up.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/company-backups/bootstrap/import-module \
  -H "Authorization: Bearer $TOKEN"

POST /company-backups/bootstrap/prepare

Bootstrap Prepare

Parameters

NameInRequiredTypeDescription
x-setup-codeheader--string, optionalSetup code that authorizes this request while the instance is still being set up.

Request body

FieldTypeRequiredDescription
upload_tokenstringyesToken returned when the backup file was uploaded.
consentarray of string--Names of modules from outside Celerp that may be turned on.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

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

NameInRequiredTypeDescription
x-setup-codeheader--string, optionalSetup code that authorizes this request while the instance is still being set up.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

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

NameInRequiredTypeDescription
x-setup-codeheader--string, optionalSetup code that authorizes this request while the instance is still being set up.

Request body

FieldTypeRequiredDescription
upload_tokenstringyesUpload Token
namestringyesName
emailstringyesEmail
passwordstringyesPassword
company_namestring, optional--Company Name

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

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

NameInRequiredTypeDescription
upload_tokenqueryyesstringToken returned when the backup file was uploaded, used to read back the staged file.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

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

FieldTypeRequiredDescription
upload_tokenstringyesToken returned when the backup file was uploaded.

Responses

StatusDescriptionBody
204Success. No response body is returned.--
422The 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

NameInRequiredTypeDescription
run_idquery--string, optionalIdentifier of the migration run whose provenance is recorded in the backup. Omit it for a plain backup.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

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

StatusDescriptionBody
200Returns the uploaded backup's preview, checked again.--
422The 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

FieldTypeRequiredDescription
upload_tokenstringyesToken returned when the backup file was uploaded.
consentarray of string--Names of modules from outside Celerp that may be turned on.

Responses

StatusDescriptionBody
200Returns `restart` and `restarting`, both false when no restart was needed.--
422The 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

FieldTypeRequiredDescription
upload_tokenstringyesToken returned when the backup file was uploaded.
modestringyesHow to restore: `settings` or `new_company`.
plan_fingerprintstringyesFingerprint of the restore plan the preview returned.
company_namestring, optional--Name for the restored company. Optional.

Responses

StatusDescriptionBody
200Returns the company ID and name, the outcome, the connectors to reconnect, and session tokens for the company.--
422The 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

StatusDescriptionBody
200Returns the `upload_token`, a summary of the backup, and the plan for restoring it.--
422The 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

FieldTypeRequiredDescription
upload_tokenstringyesToken returned when the backup file was uploaded.
modestringyesHow to restore: `settings` or `new_company`.
plan_fingerprintstringyesFingerprint of the restore plan the preview returned.
company_namestring, optional--Name for the restored company. Optional.

Responses

StatusDescriptionBody
200Returns the company ID and name, the outcome, the team members and role permissions restored, and session tokens for the company.--
422The 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

NameInRequiredTypeDescription
upload_tokenqueryyesstringToken returned when the backup file was uploaded, used to read back the staged file.
modequery--stringHow the backup would be restored, which decides the preview returned.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

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

StatusDescriptionBody
200Returns the `upload_token`, a summary of the backup, and the plan for restoring it.--
422The 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

FieldTypeRequiredDescription
emailstringyesEmail address of the login.
passwordstringyesPassword of the login.
upload_tokenstringyesToken returned when the backup file was uploaded.
plan_fingerprintstringyesFingerprint of the restore plan the preview returned.
company_namestring, optional--Name for the restored company. Optional.

Responses

StatusDescriptionBody
200Returns the company ID and name, the outcome, and session tokens for the company.--
422The 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 '{ ... }'