# IRPCBackgroundOperationsAdmin.StartBackgroundOperation

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/StartBackgroundOperation/

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

Starts a background operation now, such as a full refresh of an external object type from its
external database.

- **Service:** [Background operations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/index.md) `MFiles.IRPCBackgroundOperationsAdmin`
- **gRPC method:** `/MFiles.IRPCBackgroundOperationsAdmin/StartBackgroundOperation`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/start-background-operation`
- **Request:** [`StartBackgroundOperationRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/StartBackgroundOperation/index.md#request)
- **Response:** [`StartBackgroundOperationResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/StartBackgroundOperation/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

- **Starts a background operation and returns before it completes** (with
  `wait_until_started`, after it has started); follow it with
  [GetBackgroundOperationStatus](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetBackgroundOperationStatus/index.md)
  or [WaitForBackgroundOperationCompletion](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/WaitForBackgroundOperationCompletion/index.md).
- External object type refreshes are full refreshes. They fail when the object type's external
  connection is disabled; external location refreshes fail when the location is disabled.
- In a multi-server vault, a refresh may run on the server responsible for it instead of the
  one you called.
- Requires a vault session and the vault right `change_metadata_structure`.

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

## Request: StartBackgroundOperationRequest

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 to start. |
| `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). |
| `restart_if_already_running` | `bool` | True to signal a new start even if the operation is already running; false to leave a running operation alone. |
| `wait_until_started` | `bool` | True to return only after the operation has actually started. Has no effect if `restart_if_already_running` is false and the operation is already running. |

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

## Response: StartBackgroundOperationResponse

No fields.

<a id="related"></a>

## Related methods

- [GetBackgroundOperationStatus](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetBackgroundOperationStatus/index.md): Gets the run state of a background operation, such as an external object type refresh.
- [WaitForBackgroundOperationCompletion](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/WaitForBackgroundOperationCompletion/index.md): Waits until a background operation has finished, or stops it.
