# updateConversationReadState

```graphql
mutation UpdateConversationReadState($conversationId: ID!, $input: UpdateConversationReadStateInput!) {
  updateConversationReadState(conversationId: $conversationId, input: $input) {
    conversationId
    lastReadMessageId
    unreadCount
  }
}
```

Advance the read cursor of the caller to a message of the conversation when the user has seen messages; the cursor never moves backwards.

## Arguments

| Name              | Type                              | Required | Description                                                                           |
| ----------------- | --------------------------------- | -------- | ------------------------------------------------------------------------------------- |
| `conversationId`  | ID!                               | Yes      |                                                                                       |
| `input`           | UpdateConversationReadStateInput! | Yes      |                                                                                       |
| `input.messageId` | ID!                               | Yes      | Advances the read cursor to this message; an older message does not move it backward. |

## Variables

```json
{
  "conversationId": "string",
  "input": {
    "messageId": "string"
  }
}
```

## Responses

| Status | Description                                                     |
| ------ | --------------------------------------------------------------- |
| 200    | The ConversationReadState! in data.updateConversationReadState. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateConversationReadState($conversationId: ID!, $input: UpdateConversationReadStateInput!) {\n  updateConversationReadState(conversationId: $conversationId, input: $input) {\n    conversationId\n    lastReadMessageId\n    unreadCount\n  }\n}",
  "variables": {
    "conversationId": "string",
    "input": {
      "messageId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateConversationReadState": {
      "conversationId": "string",
      "lastReadMessageId": "string",
      "unreadCount": 0
    }
  }
}
```
