Use this API to list, retrieve, pause, and resume the batched background migrations running on an instance.

These endpoints require administrator access to the instance.

Get the list of batched background migrations

GET /api/v4/admin/batched_background_migrations

FE version

Parameters

NameTypeDescription
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
status
Query
StringFilter by status
Allowed values: paused, active, finished, failed, finalizing, finalized
database
Query
StringThe name of the database, the default main
Allowed values: main, ci, mr_diff, sec
Default: main
job_class_name
Query
StringFilter migrations by job class name

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesBatchedBackgroundMigration
400Bad Request—
401401 Unauthorized—
403403 Forbidden—

Retrieve a batched background migration

GET /api/v4/admin/batched_background_migrations/{id}

Fetches details of a specific batched migration, with optional filtering by database target.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the batched background migration
database
Query
StringName of the database
Allowed values: main, ci, mr_diff, sec
Default: main

Responses

CodeDescriptionSchema
200OKAPIEntitiesBatchedBackgroundMigration
400Bad Request—
401401 Unauthorized—
403403 Forbidden—
404404 Not found—

Pause a batched background migration

PUT /api/v4/admin/batched_background_migrations/{id}/pause

Pauses an active batched background migration temporarily.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the batched background migration

Request body (application/json)

PropertyTypeDescription
databaseStringName of the database
Allowed values: main, ci, mr_diff, sec
Default: main

Responses

CodeDescriptionSchema
200OKAPIEntitiesBatchedBackgroundMigration
400Bad Request—
401401 Unauthorized—
403403 Forbidden—
404404 Not found—
422You can pause only active batched background migrations.—

Resume a batched background migration

PUT /api/v4/admin/batched_background_migrations/{id}/resume

Resumes execution of a previously paused batched background migration.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the batched background migration

Request body (application/json)

PropertyTypeDescription
databaseStringName of the database
Allowed values: main, ci, mr_diff, sec
Default: main

Responses

CodeDescriptionSchema
200OKAPIEntitiesBatchedBackgroundMigration
400Bad Request—
401401 Unauthorized—
403403 Forbidden—
404404 Not found—
422You can resume only paused batched background migrations.—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesBatchedBackgroundMigration

PropertyTypeDescription
column_nameStringExample: id
created_atString (date-time)Example: 2022-11-28T16:26:39+02:00
estimated_time_remainingStringExample: 1 day
idStringExample: 1234
job_class_nameStringExample: CopyColumnUsingBackgroundMigrationJob
progressNumberExample: 50
statusStringExample: active
table_nameStringExample: events