# IRPCWebCompanionTaskOperation.AddWebCompanionTask

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Server integration API](https://developer.m-files.com/APIs/gRPC-API/integration/index.md) > [Web companion tasks](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWebCompanionTaskOperation/index.md)

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

Badges: `Server integration API / specialized` `internal: not for applications` `write` `session`

Stores a task for M-Files Web Companion and returns the task ID.

- **Service:** [Web companion tasks](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWebCompanionTaskOperation/index.md) `MFiles.IRPCWebCompanionTaskOperation`
- **gRPC method:** `/MFiles.IRPCWebCompanionTaskOperation/AddWebCompanionTask`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/add-web-companion-task`
- **Request:** [`AddWebCompanionTaskRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWebCompanionTaskOperation/AddWebCompanionTask/index.md#request)
- **Response:** [`AddWebCompanionTaskResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWebCompanionTaskOperation/AddWebCompanionTask/index.md#response)
- **Book and level:** Server integration API, specialized
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

**For M-Files components only.** M-Files Web calls it before handing a file over to M-Files Web
Companion. Applications should not call it.

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

## Request: AddWebCompanionTaskRequest

> 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 |
|---|---|---|
| `add_web_companion_request` | [`WebCompanionTask`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.WebCompanionTask/index.md) | The Web Companion Task information. |
| `add_web_companion_request.app_id` | `string` | Web Companion App ID. |
| `add_web_companion_request.data` | `string` | Display string of the task data. |
| `add_web_companion_request.action_type` | [`WebCompanionActionType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.WebCompanionActionType/index.md) | Web Companion Action type. Values: `WEB_COMPANION_ACTION_TYPE_VIEW` (0), `WEB_COMPANION_ACTION_TYPE_EDIT` (1), `WEB_COMPANION_ACTION_TYPE_CHECKIN` (2), `WEB_COMPANION_ACTION_TYPE_SAVE_FILE_EXTENSION` (3), `WEB_COMPANION_ACTION_TYPE_CO_AUTHOR` (4). |

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

## Response: AddWebCompanionTaskResponse

> 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 |
|---|---|---|
| `id` | `int64` | The ID of the stored task. |
