REST API

Company Backups API

Generated from the Celerp 2.9.0 OpenAPI schema, .

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"

GET /company-backups/handoffs

Company Handoffs

This company's copies sent; only its owner sees them, and each link they carry.

Responses

StatusDescriptionBody
200Successful Response--

Example

curl -X GET http://localhost:8000/company-backups/handoffs \
  -H "Authorization: Bearer $TOKEN"

POST /company-backups/handoffs/{copy_id}/new-link

New Company Handoff Link

Replace the link for the same stored copy: the old link stops working, and the 14 days and three downloads start again.

Parameters

NameInRequiredTypeDescription
copy_idpathyesstringIdentifier of the shared backup copy for which a replacement handoff link is requested.

Request body

FieldTypeRequiredDescription
operation_idstringyesOperation Id

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/company-backups/handoffs/:copy_id/new-link \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /company-backups/handoffs/{copy_id}/restore

Restore Company Handoff

Parameters

NameInRequiredTypeDescription
copy_idpathyesstringIdentifier of the shared backup copy whose handoff is to be restored.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/company-backups/handoffs/:copy_id/restore \
  -H "Authorization: Bearer $TOKEN"

POST /company-backups/handoffs/{copy_id}/revoke

Revoke Company Handoff

The link stops working at once; Undo restores it for a short time.

Parameters

NameInRequiredTypeDescription
copy_idpathyesstringIdentifier of the shared backup copy whose handoff link is to be revoked.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/company-backups/handoffs/:copy_id/revoke \
  -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"

GET /company-backups/kept

Kept Backups

The backups kept of this company each time a copy replaced it, newest first.

Responses

StatusDescriptionBody
200Successful Response--

Example

curl -X GET http://localhost:8000/company-backups/kept \
  -H "Authorization: Bearer $TOKEN"

DELETE /company-backups/kept/{kept_id}

Delete Kept Backup

Delete a kept backup. Not undoable: it is the file itself, so the page asks first.

Parameters

NameInRequiredTypeDescription
kept_idpathyesstringIdentifier of the retained company backup to delete.

Responses

StatusDescriptionBody
204Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/company-backups/kept/:kept_id \
  -H "Authorization: Bearer $TOKEN"

GET /company-backups/kept/{kept_id}/download

Download Kept Backup

Parameters

NameInRequiredTypeDescription
kept_idpathyesstringIdentifier of the retained company backup to download.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/company-backups/kept/:kept_id/download \
  -H "Authorization: Bearer $TOKEN"

POST /company-backups/kept/{kept_id}/replace

Restore Kept Backup

Undo a replace: put a kept backup back in place of this company, the same way, so the version it replaces is kept in turn.

Parameters

NameInRequiredTypeDescription
kept_idpathyesstringIdentifier of the retained company backup to restore in place of the current company.

Request body

FieldTypeRequiredDescription
company_namestring--Company Name

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/company-backups/kept/:kept_id/replace \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

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_tokenstringyesUpload Token
consentarray of string--Consent
modestring--Mode
openOpenIn, optional----

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/replace

Replace With Copy

Replace the caller's company of the same lineage with a staged copy of it, as the preview offered, once its owner typed its name; a backup of it is kept first. Switches the caller to the company the copy became.

Request body

FieldTypeRequiredDescription
upload_tokenstringyesUpload Token
company_namestring--Company Name
modestringyesMode
plan_fingerprintstringyesPlan Fingerprint

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/company-backups/replace \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

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 '{ ... }'

POST /company-backups/send-handoff

Send Handoff

Request body

FieldTypeRequiredDescription
operation_idstringyesOperation Id
keystringyesKey
firm_namestringyesFirm Name
recipientstringyesRecipient
reply_tostringyesReply To
notestring--Note

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/company-backups/send-handoff \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /company-backups/sender

Last Sender

The firm name and reply address of the last send, for the next send form.

Responses

StatusDescriptionBody
200Successful Response--

Example

curl -X GET http://localhost:8000/company-backups/sender \
  -H "Authorization: Bearer $TOKEN"

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 '{ ... }'