REST API

Migrations API

Generated from the Celerp 2.5.5 OpenAPI schema, 12 October 2026.

POST /migrations/bootstrap/decisions

Save Bootstrap Migration Decisions

Save the choices for a scanned source on a new installation that has no user yet: the import mode, the cutover date, the answers to the scan's questions and who prepared it. Every problem is returned at once, keyed by field. It is closed for good once any user exists.

Request body

FieldTypeRequiredDescription
scan_tokenstringyesToken returned when the source file was scanned. It identifies the uploaded scan in later calls.
modeobject--Import mode: full history or cutover.
cutover_dateobject--Date the books move over from the source. Required in cutover mode.
mappingsobject--Answers to the scan's questions, keyed by question.
prepared_byobject--Name of the person who prepared the migration, shown on the reconciliation pack. Optional, one line.

Responses

StatusDescriptionBody
200Returns the scan with the saved decisions.object
422The request failed validation. The response lists each invalid field and why.HTTPValidationError

Example

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

POST /migrations/bootstrap/scan

Bootstrap Scan

Parameters

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

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/migrations/bootstrap/scan \
  -H "Authorization: Bearer $TOKEN"

POST /migrations/bootstrap/scan/read

Read Bootstrap Migration Scan

Return the view of a scanned source file on a new installation that has no user yet. It is closed for good once any user exists.

Request body

FieldTypeRequiredDescription
scan_tokenstringyesToken returned when the source file was scanned. It identifies the uploaded scan in later calls.

Responses

StatusDescriptionBody
200Returns the scan: what the source holds, what Celerp cannot import, and the questions that need an answer.object
422The request failed validation. The response lists each invalid field and why.HTTPValidationError

Example

curl -X POST http://localhost:8000/migrations/bootstrap/scan/read \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /migrations/bootstrap/start

Bootstrap Start

Create the first owner, the staged company and a preparing run in one commit, then start it (``_claim``). The bootstrap lock serializes racing starts; the loser re-checks and is refused. If the response is lost after the commit, the owner signs in and is taken back to the run. The setup code is consumed only after the commit.

Parameters

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

Request body

FieldTypeRequiredDescription
scan_tokenstringyesScan Token
company_namestringyesCompany Name
namestringyesName
emailstringyesEmail
passwordstringyesPassword

Responses

StatusDescriptionBody
201Successful Responseobject
422Validation ErrorHTTPValidationError

Example

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

POST /migrations/scan

Scan Migration Source

Upload a source file from another system and scan it, as a company owner. Send the file as a multipart upload. Nothing is imported at this step.

Responses

StatusDescriptionBody
200Returns the `scan_token` and the scan: what the source holds, what Celerp cannot import, and the questions that need an answer.object

Example

curl -X POST http://localhost:8000/migrations/scan \
  -H "Authorization: Bearer $TOKEN"

POST /migrations/scan/decisions

Save Migration Decisions

Save the choices for a scanned source: the import mode, the cutover date, the answers to the scan's questions and who prepared it. Every problem is returned at once, keyed by field.

Request body

FieldTypeRequiredDescription
scan_tokenstringyesToken returned when the source file was scanned. It identifies the uploaded scan in later calls.
modeobject--Import mode: full history or cutover.
cutover_dateobject--Date the books move over from the source. Required in cutover mode.
mappingsobject--Answers to the scan's questions, keyed by question.
prepared_byobject--Name of the person who prepared the migration, shown on the reconciliation pack. Optional, one line.

Responses

StatusDescriptionBody
200Returns the scan with the saved decisions.object
422The request failed validation. The response lists each invalid field and why.HTTPValidationError

Example

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

POST /migrations/scan/read

Read Migration Scan

Return the view of a scanned source file. When the caller already started a migration from this scan, it returns that run's `run_id` instead, so a client whose start response was lost can return to the run.

Request body

FieldTypeRequiredDescription
scan_tokenstringyesToken returned when the source file was scanned. It identifies the uploaded scan in later calls.

Responses

StatusDescriptionBody
200Returns the scan, or the `run_id` of the run already started from it.object
422The request failed validation. The response lists each invalid field and why.HTTPValidationError

Example

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

GET /migrations/sources

List Migration Sources

List the source systems the migration importer reads. Each source names the files it accepts, with their extensions and maximum sizes.

Responses

StatusDescriptionBody
200Returns the sources, each with its key, display name and accepted files.array of object

Example

curl -X GET http://localhost:8000/migrations/sources \
  -H "Authorization: Bearer $TOKEN"

GET /migrations/staged

Get Staged Migration Run

Return the latest migration run of the staged company the session is scoped to, which tells a client where the session belongs.

Responses

StatusDescriptionBody
200Returns the migration run.object

Example

curl -X GET http://localhost:8000/migrations/staged \
  -H "Authorization: Bearer $TOKEN"

POST /migrations/start-company/decisions

Save Migration Decisions for a Login With No Company

Save the choices for a scanned source that was uploaded for a login with no company: the import mode, the cutover date, the answers to the scan's questions and who prepared it. Every problem is returned at once, keyed by field.

Request body

FieldTypeRequiredDescription
scan_tokenstringyesToken returned when the source file was scanned. It identifies the uploaded scan in later calls.
modeobject--Import mode: full history or cutover.
cutover_dateobject--Date the books move over from the source. Required in cutover mode.
mappingsobject--Answers to the scan's questions, keyed by question.
prepared_byobject--Name of the person who prepared the migration, shown on the reconciliation pack. Optional, one line.

Responses

StatusDescriptionBody
200Returns the scan with the saved decisions.object
422The request failed validation. The response lists each invalid field and why.HTTPValidationError

Example

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

POST /migrations/start-company/scan

Scan Migration Source for a Login With No Company

Upload a source file from another system for a login that has no company left. The request authenticates with the login's email and password as HTTP Basic credentials. Send the file as a multipart upload. Nothing is imported at this step.

Responses

StatusDescriptionBody
200Returns the `scan_token` and the scan: what the source holds, what Celerp cannot import, and the questions that need an answer.object

Example

curl -X POST http://localhost:8000/migrations/start-company/scan \
  -H "Authorization: Bearer $TOKEN"

POST /migrations/start-company/scan/read

Read Migration Scan for a Login With No Company

Return the view of a scanned source file that was uploaded for a login with no company.

Request body

FieldTypeRequiredDescription
scan_tokenstringyesToken returned when the source file was scanned. It identifies the uploaded scan in later calls.

Responses

StatusDescriptionBody
200Returns the scan: what the source holds, what Celerp cannot import, and the questions that need an answer.object
422The request failed validation. The response lists each invalid field and why.HTTPValidationError

Example

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

POST /migrations/start-company/start

Start Migration for a Login With No Company

Start a migration as the company of a login that has none left, then sign in to that company. The request carries the login's email and password, the scan token and the company name. If the login already has a company the request is refused.

Request body

FieldTypeRequiredDescription
emailstringyesEmail address of the login.
passwordstringyesPassword of the login.
scan_tokenstringyesToken returned when the source file was scanned. It identifies the uploaded scan in later calls.
company_namestringyesName of the company to create from the source.

Responses

StatusDescriptionBody
201Returns the session tokens for the staged company, the `run_id`, and whether the run is waiting for modules to load.object
422The request failed validation. The response lists each invalid field and why.HTTPValidationError

Example

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

POST /migrations/start-from-scan

Start Migration From Scan

Start a migration from a scan and its saved decisions. It creates a staged company and a migration run. A repeated start from the same scan returns the run it already created.

Request body

FieldTypeRequiredDescription
scan_tokenstringyesToken returned when the source file was scanned. It identifies the uploaded scan in later calls.
company_namestringyesName of the company to create from the source.

Responses

StatusDescriptionBody
201Returns the `run_id` of the new run and whether it is waiting for modules to load.object
422The request failed validation. The response lists each invalid field and why.HTTPValidationError

Example

curl -X POST http://localhost:8000/migrations/start-from-scan \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /migrations/{run_id}

Get Run

Parameters

NameInRequiredTypeDescription
run_idpathyesstringIdentifier of the migration run.

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/migrations/:run_id \
  -H "Authorization: Bearer $TOKEN"

POST /migrations/{run_id}/cancel

Cancel Run

Parameters

NameInRequiredTypeDescription
run_idpathyesstringIdentifier of the migration run.

Responses

StatusDescriptionBody
202Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/migrations/:run_id/cancel \
  -H "Authorization: Bearer $TOKEN"

POST /migrations/{run_id}/discard

Discard Run

Parameters

NameInRequiredTypeDescription
run_idpathyesstringIdentifier of the migration run.

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/migrations/:run_id/discard \
  -H "Authorization: Bearer $TOKEN"

POST /migrations/{run_id}/finalize

Finalize Run

Parameters

NameInRequiredTypeDescription
run_idpathyesstringIdentifier of the migration run.

Request body

FinalizeIn, optional

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

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

GET /migrations/{run_id}/posting-accounts

Get Posting Accounts

The posting accounts finishing this migration will set, and the choices for each.

Parameters

NameInRequiredTypeDescription
run_idpathyesstringIdentifier of the migration run.

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/migrations/:run_id/posting-accounts \
  -H "Authorization: Bearer $TOKEN"

GET /migrations/{run_id}/reconciliation

Get Reconciliation

Parameters

NameInRequiredTypeDescription
run_idpathyesstringIdentifier of the migration run.

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/migrations/:run_id/reconciliation \
  -H "Authorization: Bearer $TOKEN"

GET /migrations/{run_id}/reconciliation/pack

Get Reconciliation Pack

Parameters

NameInRequiredTypeDescription
run_idpathyesstringIdentifier of the migration run.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/migrations/:run_id/reconciliation/pack \
  -H "Authorization: Bearer $TOKEN"

POST /migrations/{run_id}/start

Start Run

Parameters

NameInRequiredTypeDescription
run_idpathyesstringIdentifier of the migration run.

Responses

StatusDescriptionBody
202Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/migrations/:run_id/start \
  -H "Authorization: Bearer $TOKEN"