# IRPCConversationOperations.AddOrUpdateConversation

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Conversations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/index.md)

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

Badges: `Vault API / standard` `write` `session`

Creates a conversation, or renames an existing one of the caller.

- **Service:** [Conversations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/index.md) `MFiles.IRPCConversationOperations`
- **gRPC method:** `/MFiles.IRPCConversationOperations/AddOrUpdateConversation`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/add-or-update-conversation`
- **Request:** [`AddOrUpdateConversationRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/AddOrUpdateConversation/index.md#request)
- **Response:** [`AddOrUpdateConversationResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/AddOrUpdateConversation/index.md#response)
- **Book and level:** Vault API, standard
- **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

- With `id` 0, or an ID that does not exist, the server creates a new conversation with a new
  ID and `sort_key`, owned by the caller. Read the new ID from the response.
- With the ID of an existing conversation of the caller, only `title` is changed and `modified`
  is updated; `type` cannot be changed. The conversation of another user fails with "Access is
  denied.".
- `user_id`, `sort_key`, `created` and `modified` in the request are ignored.

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

## Request: AddOrUpdateConversationRequest

> 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 |
|---|---|---|
| `conversation` | [`Conversation`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Conversation/index.md) | The conversation. Set `title` and, for a new one, `type`; set `id` to rename an existing one. |
| `conversation.id` | `uint32` | The ID of the conversation, assigned by the server. |
| `conversation.user_id` | `uint32` | The ID of the user account that owns the conversation. Set by the server. |
| `conversation.type` | [`ConversationType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ConversationType/index.md) | The kind of conversation. Set when the conversation is created. Values: `CONVERSATION_TYPE_UNDEFINED` (0), `CONVERSATION_TYPE_AINO` (1). |
| `conversation.title` | `string` | The title of the conversation, as plain text. |
| `conversation.sort_key` | `uint32` | Orders conversations; newer conversations have larger values. Used for paging. |
| `conversation.created` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | When the conversation was created (UTC). |
| `conversation.modified` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | When the conversation was created or last renamed (UTC). |

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

## Response: AddOrUpdateConversationResponse

> 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 |
|---|---|---|
| `updated_conversation` | [`Conversation`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Conversation/index.md) | The conversation as stored. |
| `updated_conversation.id` | `uint32` | The ID of the conversation, assigned by the server. |
| `updated_conversation.user_id` | `uint32` | The ID of the user account that owns the conversation. Set by the server. |
| `updated_conversation.type` | [`ConversationType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ConversationType/index.md) | The kind of conversation. Set when the conversation is created. Values: `CONVERSATION_TYPE_UNDEFINED` (0), `CONVERSATION_TYPE_AINO` (1). |
| `updated_conversation.title` | `string` | The title of the conversation, as plain text. |
| `updated_conversation.sort_key` | `uint32` | Orders conversations; newer conversations have larger values. Used for paging. |
| `updated_conversation.created` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | When the conversation was created (UTC). |
| `updated_conversation.modified` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | When the conversation was created or last renamed (UTC). |
