# IRPCBackgroundOperationsAdmin.GetBackgroundOperationStatus

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Background operations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetBackgroundOperationStatus/

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Gets the run state of a background operation, such as an external object type refresh.

- **Service:** [Background operations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/index.md) `MFiles.IRPCBackgroundOperationsAdmin`
- **gRPC method:** `/MFiles.IRPCBackgroundOperationsAdmin/GetBackgroundOperationStatus`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-background-operation-status`
- **Request:** [`GetBackgroundOperationStatusRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetBackgroundOperationStatus/index.md#request)
- **Response:** [`GetBackgroundOperationStatusResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetBackgroundOperationStatus/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires a vault session and the vault right `change_metadata_structure`.
- An unknown operation fails with "Not found.".

<a id="request"></a>

## Request: GetBackgroundOperationStatusRequest

A structure that specifies the request type for the corresponding method.

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `background_operation_id` | [`BackgroundOperationID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.BackgroundOperationID/index.md) | The operation: `type`, and `id` (the object type ID or the external location ID for the refresh types). |
| `background_operation_id.type` | [`BackgroundOperationType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.BackgroundOperationType/index.md) | Operation type. Values: `BACKGROUND_OPERATION_TYPE_UNKNOWN` (0), `BACKGROUND_OPERATION_TYPE_INDEX_METADATA` (1), `BACKGROUND_OPERATION_TYPE_REFRESH_EXTERNAL_OBJECT_TYPE` (2), `BACKGROUND_OPERATION_TYPE_REFRESH_EXTERNAL_LOCATION` (3), `BACKGROUND_OPERATION_TYPE_PERFORM_OCR_TASK` (4), `BACKGROUND_OPERATION_TYPE_RUN_PERFORMANCE_MEASUREMENTS` (5), `BACKGROUND_OPERATION_TYPE_CLEAN_UP_ACL_DEPENDENCY_SETS` (6). |
| `background_operation_id.id` | `int32` | Specifies an ID for the operation (e.g. object type ID). |

<a id="response"></a>

## Response: GetBackgroundOperationStatusResponse

A structure that specifies the response type for the corresponding method.

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `scheduled_job_run_info` | [`ScheduledJobRunInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ScheduledJobRunInfo/index.md) | The run state of the operation: running or not, last and next run, errors and progress. |
| `scheduled_job_run_info.is_running` | `bool` | True if the job is currently running. |
| `scheduled_job_run_info.next_run_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The next time the job will run. Zero to indicate no next run time. |
| `scheduled_job_run_info.last_run_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The last time the job ran. Zero to indicate that the job has never run (or is still running for the first time). |
| `scheduled_job_run_info.last_run_succeeded` | `bool` | True if the last run at ftLastRun was successful, false otherwise. |
| `scheduled_job_run_info.last_run_errors` | `string` | Error string from the last run (if any). |
| `scheduled_job_run_info.last_run_cancelled` | `bool` | True if the job is cancelled. |
| `scheduled_job_run_info.current_step` | `int32` | -1 or a current job step. 0 indicates the beginning. When positive, value depends on the underlying job that is being executed. Steps are numbered sequentially from 1 to forward. |
| `scheduled_job_run_info.curent_step_completion` | `int32` | -1 or the completion percent of a current job. This is always an estimate. |
| `scheduled_job_run_info.output` | [`ScheduledJobOutputInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ScheduledJobOutputInfo/index.md) | The output information on the job. Available only when the job is not running (e.g. bRunning and is false). |
| `scheduled_job_run_info.output.id` | `int32` | Job ID. |
| `scheduled_job_run_info.output.message` | `string` | General output info message. |
| `scheduled_job_run_info.output.type` | [`JobType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.JobType/index.md) | Job type. Values: `JOB_TYPE_UNINITIALIZED` (0), `JOB_TYPE_BACKUP` (1), `JOB_TYPE_RESTORE` (2), `JOB_TYPE_COPY_VAULT` (3), `JOB_TYPE_VERIFY_VAULT` (4), `JOB_TYPE_ARCHIVE_OBJECTS` (5), `JOB_TYPE_ARCHIVE_OLD_VERSIONS` (6), `JOB_TYPE_RESTORE_FROM_ARCHIVE` (7), `JOB_TYPE_OPTIMIZE_VAULT` (8), `JOB_TYPE_RECALCULATE_PROPERTY` (9), `JOB_TYPE_MIGRATE_VAULT` (10), `JOB_TYPE_ENCRYPT_FILE_DATA` (11). |
| `scheduled_job_run_info.output.data` | [`JobOutputInfoDataUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.JobOutputInfoDataUnion/index.md) | The job output info details as a union. |
