Use this API to list, retrieve, restart, and stop the batched background operations running on an instance.

These endpoints require administrator access to the instance.

Get the list of batched background operations

GET /api/v4/admin/batched_background_operations

This feature was introduced in GitLab 19.1.

Parameters

NameTypeDescription
database
Query
StringThe name of the database, the default main
Allowed values: main, ci, sec
Default: main
job_class_name
Query
StringFilter operations by job class name

Responses

CodeDescriptionSchema
200OKAPIEntitiesBatchedBackgroundOperation
400Bad Request—
401401 Unauthorized—
403403 Forbidden—

Retrieve a batched background operation

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

This feature was introduced in GitLab 19.1.

Parameters

NameTypeDescription
id
Path, required
IntegerThe batched background operation id
database
Query
StringThe name of the database
Allowed values: main, ci, sec
Default: main

Responses

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

Restart a batched background operation

PUT /api/v4/admin/batched_background_operations/{id}/restart

This feature was introduced in GitLab 19.2.

Parameters

NameTypeDescription
id
Path, required
IntegerThe batched background operation id

Request body (application/json)

PropertyTypeDescription
databaseStringThe name of the database
Allowed values: main, ci, sec
Default: main

Responses

CodeDescriptionSchema
200OKAPIEntitiesBatchedBackgroundOperation
400Bad Request—
401401 Unauthorized—
403403 Forbidden—
404404 Not found—
422You can restart only stopped operations.—

Stop a batched background operation

PUT /api/v4/admin/batched_background_operations/{id}/stop

This feature was introduced in GitLab 19.2.

Parameters

NameTypeDescription
id
Path, required
IntegerThe batched background operation id

Request body (application/json)

PropertyTypeDescription
databaseStringThe name of the database
Allowed values: main, ci, sec
Default: main

Responses

CodeDescriptionSchema
200OKAPIEntitiesBatchedBackgroundOperation
400Bad Request—
401401 Unauthorized—
403403 Forbidden—
404404 Not found—
422You can stop only queued, active or paused operations.—

Schemas

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

APIEntitiesBatchedBackgroundOperation

PropertyTypeDescription
column_nameStringExample: id
created_atString (date-time)Example: 2025-05-15T10:00:00Z
finished_atString (date-time)Example: 2025-05-15T11:00:00Z
idStringExample: <cluster>:<partition_id>:<id/uuid>
job_class_nameStringExample: UsersDeleteUnconfirmedSecondaryEmails
on_hold_untilString (date-time)Example: 2025-05-15T10:15:00Z
partitionIntegerExample: 1
started_atString (date-time)Example: 2025-05-15T10:05:00Z
statusStringExample: active
table_nameStringExample: users