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

# Annotation - Update

> Update the status of an annotation.

This endpoint updates the status of an annotation. It supports:

* Updating annotation status
* Verifying annotation ownership before updating
* Returning updated annotation with related data

<Note>
  Authentication is **required**. You must provide a valid session with an organization ID, and the annotation must belong to your organization.
</Note>

### Path

<ParamField path="id" type="string" required>
  The ID of the annotation to update (CUID format).
</ParamField>

### Body

#### Required

<ParamField body="status" type="string" required>
  The new status for the annotation. Valid status values depend on your organization's configuration.
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique identifier of the annotation (CUID format).
</ResponseField>

<ResponseField name="messageId" type="string">
  ID of the message this annotation refers to.
</ResponseField>

<ResponseField name="organizationId" type="string">
  ID of the organization the annotation belongs to.
</ResponseField>

<ResponseField name="comment" type="string">
  Comment or feedback text for the annotation.
</ResponseField>

<ResponseField name="sentiment" type="string">
  Sentiment of the annotation (e.g., `positive`, `negative`, `neutral`).
</ResponseField>

<ResponseField name="status" type="string">
  Updated status of the annotation.
</ResponseField>

<ResponseField name="createdById" type="string">
  ID of the user who created the annotation.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when the annotation was created.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp of when the annotation was last updated.
</ResponseField>

<ResponseField name="createdBy" type="object">
  Information about the user who created the annotation.

  <Expandable title="CreatedBy object" defaultOpen>
    <ResponseField name="email" type="string">
      Email address of the user who created the annotation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="tags" type="array">
  Tags associated with the annotation.

  <Expandable title="Tags array items">
    <ResponseField name="tag" type="object">
      Tag information.

      <Expandable title="Tag object">
        <ResponseField name="id" type="string">
          Tag ID.
        </ResponseField>

        <ResponseField name="name" type="string">
          Tag name.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### Error Responses

| Status Code | Type         | Description                                                                                    |
| ----------- | ------------ | ---------------------------------------------------------------------------------------------- |
| 400         | Bad Request  | Status field is required but was not provided.                                                 |
| 401         | UNAUTHORIZED | Missing or invalid authentication session, or annotation does not belong to your organization. |
| 404         | NOT\_FOUND   | Annotation with the specified ID does not exist.                                               |

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PATCH 'https://dashboard.laburen.com/api/annotations/clxxxxxxxxxxxxxxxxx' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
  --data-raw '{
      "status": "completed"
  }'
  ```

  ```javascript JavaScript theme={null}
  const apiUrl = 'https://dashboard.laburen.com/api';
  const apiKey = '<API_KEY>';

  const response = await fetch(`${apiUrl}/annotations/clxxxxxxxxxxxxxxxxx`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${apiKey}`,
    },
    body: JSON.stringify({
      status: 'completed',
    }),
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  api_url = "https://dashboard.laburen.com/api"
  api_key = "<API_KEY>"

  response = requests.patch(
      f"{api_url}/annotations/clxxxxxxxxxxxxxxxxx",
      headers={
          "Content-Type": "application/json",
          "Authorization": f"Bearer {api_key}",
      },
      json={
          "status": "completed",
      },
  )

  data = response.json()
  print(data)
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "clxxxxxxxxxxxxxxxxx",
    "messageId": "clxxxxxxxxxxxxxxxxx",
    "organizationId": "clxxxxxxxxxxxxxxxxx",
    "comment": "The agent provided incorrect information about pricing",
    "sentiment": "negative",
    "status": "completed",
    "createdById": "clxxxxxxxxxxxxxxxxx",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T11:45:00.000Z",
    "createdBy": {
      "email": "user@example.com"
    },
    "tags": [
      {
        "tag": {
          "id": "clxxxxxxxxxxxxxxxxx",
          "name": "bug"
        }
      }
    ]
  }
  ```
</ResponseExample>
