> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mithunai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rename, archive or restore a conversation

> Change a conversation's title, labels or archived state. Only the owner may: a moderator who can read someone else's conversation gets 404 when changing it.

Only the conversation's owner can update it. A moderator who can read someone else's conversation still cannot rename or archive it, and gets `404` as if it did not exist.

Send at least one of `title`, `archived` or `metadata`. A field that is absent or `null` is left unchanged; a body that changes nothing returns `400`. The assistant, owner and messages of a conversation cannot be changed.

Archiving hides the conversation from [List conversations](/api-reference/conversations/list-conversations) and refuses new questions with `409`. Set `archived` to `false` to restore it.

This request also resolves the conversation's assistant. If that assistant can no longer answer (it is `disabled` or `archived`, or has no knowledge attached), this request returns `400` `validation_error`.

<ParamField path="conversation_id" type="string" required>
  The conversation ID.
</ParamField>

<ParamField body="title" type="string">
  A new title. 1 to 200 characters after trimming, on a single line.
</ParamField>

<ParamField body="archived" type="boolean">
  `true` to archive the conversation, `false` to restore it. Must be a JSON boolean.
</ParamField>

<ParamField body="metadata" type="object">
  Replaces the conversation's metadata as a whole; it is not merged. Send `{}` to clear it. The same
  limits apply as when you create a conversation: at most 20 entries, keys up to 64 characters
  matching `^[a-z][a-z0-9_.-]*$`, values up to 512 characters on a single line.
</ParamField>

## Response

Returns `200 OK` with the updated conversation.

<ResponseField name="id" type="string" required>
  The conversation ID.
</ResponseField>

<ResponseField name="assistant_id" type="string" required>
  The assistant that answers in this conversation.
</ResponseField>

<ResponseField name="title" type="string" required>
  The conversation title.
</ResponseField>

<ResponseField name="status" type="string" required>
  `active` or `archived`.
</ResponseField>

<ResponseField name="turn_state" type="string" required>
  `idle` or `awaiting_answer`.
</ResponseField>

<ResponseField name="message_count" type="integer" required>
  The number of messages.
</ResponseField>

<ResponseField name="created_at" type="string" required>
  ISO 8601 creation timestamp with a UTC offset.
</ResponseField>

<ResponseField name="updated_at" type="string" required>
  ISO 8601 timestamp of this update.
</ResponseField>

<ResponseField name="owner" type="object" required>
  The owning participant: `type` is `user` or `service`, and `id` is its identifier.
</ResponseField>

<ResponseField name="metadata" type="object" required>
  Your metadata entries.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl --request PATCH "$MITHUNAI_URL/arukz/api/v1/conversations/c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60" \
    --header "Authorization: Bearer $MITHUNAI_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{"title": "API key rotation", "archived": true}'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os, requests

  conversation_id = "c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60"
  response = requests.patch(
      f"{os.environ['MITHUNAI_URL']}/arukz/api/v1/conversations/{conversation_id}",
      headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
      json={"title": "API key rotation", "archived": True},
      timeout=60,
  )
  response.raise_for_status()
  print(response.json())
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const conversationId = 'c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60'
  const response = await fetch(
    `${process.env.MITHUNAI_URL}/arukz/api/v1/conversations/${conversationId}`,
    {
      method: 'PATCH',
      headers: {
        Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ title: 'API key rotation', archived: true }),
    },
  )
  console.log(await response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60",
    "assistant_id": "5b0e2c7a-91d4-4f3e-8a6b-2d7c9e1f4a38",
    "title": "API key rotation",
    "status": "archived",
    "turn_state": "idle",
    "message_count": 2,
    "created_at": "2026-09-24T10:15:02.184311+00:00",
    "updated_at": "2026-09-24T10:31:44.050912+00:00",
    "owner": { "type": "service", "id": "9a7d3e51-2f6c-4b88-a0d4-6e1b5c3f7a92" },
    "metadata": { "source": "support-portal" }
  }
  ```

  ```json 400 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  { "code": "validation_error", "message": "The update contained no changes." }
  ```

  ```json 404 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  { "code": "not_found", "message": "The requested resource was not found." }
  ```
</ResponseExample>
