# updateConversationMessage

```graphql
mutation UpdateConversationMessage($conversationId: ID!, $messageId: ID!, $input: UpdateConversationMessageInput!) {
  updateConversationMessage(conversationId: $conversationId, messageId: $messageId, input: $input) {
    id
    conversationId
    parentId
    seq
    role
    createdBy
    senderType
    senderId
    senderDisplayName
    parts
    model
    runUsage {
      scope
      model
      inputTokens
      outputTokens
      cacheCreationInputTokens
      cacheReadInputTokens
      reasoningTokens
      totalTokens
      modelCalls
      costCredits
    }
    tokenUsage
    finishReason
    costCredits
    status
    editedAt
    idempotencyKey
    metadata
    createdAt
    updatedAt
  }
}
```

Replace the parts of an existing message to edit it in place; to keep the original, create a branch instead.

## Arguments

| Name             | Type                            | Required | Description                                          |
| ---------------- | ------------------------------- | -------- | ---------------------------------------------------- |
| `conversationId` | ID!                             | Yes      |                                                      |
| `messageId`      | ID!                             | Yes      | Message to edit; it must belong to the conversation. |
| `input`          | UpdateConversationMessageInput! | Yes      |                                                      |
| `input.parts`    | JSON!                           | Yes      | Replacement message parts (1 to 200).                |

## Variables

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

## Responses

| Status | Description                                     |
| ------ | ----------------------------------------------- |
| 200    | The Message! in data.updateConversationMessage. |

## 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 UpdateConversationMessage($conversationId: ID!, $messageId: ID!, $input: UpdateConversationMessageInput!) {\n  updateConversationMessage(conversationId: $conversationId, messageId: $messageId, input: $input) {\n    id\n    conversationId\n    parentId\n    seq\n    role\n    createdBy\n    senderType\n    senderId\n    senderDisplayName\n    parts\n    model\n    runUsage {\n      scope\n      model\n      inputTokens\n      outputTokens\n      cacheCreationInputTokens\n      cacheReadInputTokens\n      reasoningTokens\n      totalTokens\n      modelCalls\n      costCredits\n    }\n    tokenUsage\n    finishReason\n    costCredits\n    status\n    editedAt\n    idempotencyKey\n    metadata\n    createdAt\n    updatedAt\n  }\n}",
  "variables": {
    "conversationId": "string",
    "messageId": "string",
    "input": {
      "parts": {}
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateConversationMessage": {
      "id": "string",
      "conversationId": "string",
      "parentId": "string",
      "seq": 0,
      "role": "string",
      "createdBy": "string",
      "senderType": "string",
      "senderId": "string",
      "senderDisplayName": "string",
      "parts": {},
      "model": "string",
      "runUsage": {
        "scope": "string",
        "model": "string",
        "inputTokens": 0,
        "outputTokens": 0,
        "cacheCreationInputTokens": 0,
        "cacheReadInputTokens": 0,
        "reasoningTokens": 0,
        "totalTokens": 0,
        "modelCalls": 0,
        "costCredits": "string"
      },
      "tokenUsage": {},
      "finishReason": "string",
      "costCredits": "string",
      "status": "string",
      "editedAt": "string",
      "idempotencyKey": "string",
      "metadata": {},
      "createdAt": "string",
      "updatedAt": "string"
    }
  }
}
```
