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
| Field | Type | Required | Description |
|---|
scan_token | string | yes | Token returned when the source file was scanned. It identifies the uploaded scan in later calls. |
mode | object | -- | Import mode: full history or cutover. |
cutover_date | object | -- | Date the books move over from the source. Required in cutover mode. |
mappings | object | -- | Answers to the scan's questions, keyed by question. |
prepared_by | object | -- | Name of the person who prepared the migration, shown on the reconciliation pack. Optional, one line. |
Responses
| Status | Description | Body |
|---|
200 | Returns the scan with the saved decisions. | object |
422 | The 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
| 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 | object |
422 | Validation Error | HTTPValidationError |
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
| Field | Type | Required | Description |
|---|
scan_token | string | yes | Token returned when the source file was scanned. It identifies the uploaded scan in later calls. |
Responses
| Status | Description | Body |
|---|
200 | Returns the scan: what the source holds, what Celerp cannot import, and the questions that need an answer. | object |
422 | The 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
| 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 |
|---|
scan_token | string | yes | Scan Token |
company_name | string | yes | Company Name |
name | string | yes | Name |
email | string | yes | Email |
password | string | yes | Password |
Responses
| Status | Description | Body |
|---|
201 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Status | Description | Body |
|---|
200 | Returns 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
| Field | Type | Required | Description |
|---|
scan_token | string | yes | Token returned when the source file was scanned. It identifies the uploaded scan in later calls. |
mode | object | -- | Import mode: full history or cutover. |
cutover_date | object | -- | Date the books move over from the source. Required in cutover mode. |
mappings | object | -- | Answers to the scan's questions, keyed by question. |
prepared_by | object | -- | Name of the person who prepared the migration, shown on the reconciliation pack. Optional, one line. |
Responses
| Status | Description | Body |
|---|
200 | Returns the scan with the saved decisions. | object |
422 | The 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
| Field | Type | Required | Description |
|---|
scan_token | string | yes | Token returned when the source file was scanned. It identifies the uploaded scan in later calls. |
Responses
| Status | Description | Body |
|---|
200 | Returns the scan, or the `run_id` of the run already started from it. | object |
422 | The 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
| Status | Description | Body |
|---|
200 | Returns 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
| Status | Description | Body |
|---|
200 | Returns 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
| Field | Type | Required | Description |
|---|
scan_token | string | yes | Token returned when the source file was scanned. It identifies the uploaded scan in later calls. |
mode | object | -- | Import mode: full history or cutover. |
cutover_date | object | -- | Date the books move over from the source. Required in cutover mode. |
mappings | object | -- | Answers to the scan's questions, keyed by question. |
prepared_by | object | -- | Name of the person who prepared the migration, shown on the reconciliation pack. Optional, one line. |
Responses
| Status | Description | Body |
|---|
200 | Returns the scan with the saved decisions. | object |
422 | The 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
| Status | Description | Body |
|---|
200 | Returns 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
| Field | Type | Required | Description |
|---|
scan_token | string | yes | Token returned when the source file was scanned. It identifies the uploaded scan in later calls. |
Responses
| Status | Description | Body |
|---|
200 | Returns the scan: what the source holds, what Celerp cannot import, and the questions that need an answer. | object |
422 | The 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
| Field | Type | Required | Description |
|---|
email | string | yes | Email address of the login. |
password | string | yes | Password of the login. |
scan_token | string | yes | Token returned when the source file was scanned. It identifies the uploaded scan in later calls. |
company_name | string | yes | Name of the company to create from the source. |
Responses
| Status | Description | Body |
|---|
201 | Returns the session tokens for the staged company, the `run_id`, and whether the run is waiting for modules to load. | object |
422 | The 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
| Field | Type | Required | Description |
|---|
scan_token | string | yes | Token returned when the source file was scanned. It identifies the uploaded scan in later calls. |
company_name | string | yes | Name of the company to create from the source. |
Responses
| Status | Description | Body |
|---|
201 | Returns the `run_id` of the new run and whether it is waiting for modules to load. | object |
422 | The 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
| Name | In | Required | Type | Description |
|---|
run_id | path | yes | string | Identifier of the migration run. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/migrations/:run_id \
-H "Authorization: Bearer $TOKEN"
POST /migrations/{run_id}/cancel
Cancel Run
Parameters
| Name | In | Required | Type | Description |
|---|
run_id | path | yes | string | Identifier of the migration run. |
Responses
| Status | Description | Body |
|---|
202 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/migrations/:run_id/cancel \
-H "Authorization: Bearer $TOKEN"
POST /migrations/{run_id}/discard
Discard Run
Parameters
| Name | In | Required | Type | Description |
|---|
run_id | path | yes | string | Identifier of the migration run. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/migrations/:run_id/discard \
-H "Authorization: Bearer $TOKEN"
POST /migrations/{run_id}/finalize
Finalize Run
Parameters
| Name | In | Required | Type | Description |
|---|
run_id | path | yes | string | Identifier of the migration run. |
Request body
FinalizeIn, optional
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
run_id | path | yes | string | Identifier of the migration run. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/migrations/:run_id/posting-accounts \
-H "Authorization: Bearer $TOKEN"
GET /migrations/{run_id}/reconciliation
Get Reconciliation
Parameters
| Name | In | Required | Type | Description |
|---|
run_id | path | yes | string | Identifier of the migration run. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
run_id | path | yes | string | Identifier of the migration run. |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | -- |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/migrations/:run_id/reconciliation/pack \
-H "Authorization: Bearer $TOKEN"
POST /migrations/{run_id}/start
Start Run
Parameters
| Name | In | Required | Type | Description |
|---|
run_id | path | yes | string | Identifier of the migration run. |
Responses
| Status | Description | Body |
|---|
202 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X POST http://localhost:8000/migrations/:run_id/start \
-H "Authorization: Bearer $TOKEN"