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

# Get Comment Annotations

Use this API to retrieve comment annotations from a document within an organization.
Additional filters can be applied using location IDs, annotation IDs, or user IDs.

<Warning>
  Use this for SDK v3 or prior versions.
</Warning>

# Endpoint

`POST https://api.velt.dev/v1/commentannotations/get`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="organizationId" type="string" required>
      Organization ID
    </ParamField>

    <ParamField body="documentId" type="string" required>
      Document ID
    </ParamField>

    <ParamField body="locationIds" type="string[]">
      Array of Location IDs. Limit: Only 30 IDs can be passed at a time.
    </ParamField>

    <ParamField body="annotationIds" type="string[]">
      Array of Annotation IDs. Limit: Only 30 IDs can be passed at a time.
    </ParamField>

    <ParamField body="userIds" type="string[]">
      Array of User IDs. Limit: Only 30 IDs can be passed at a time.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### 1. Get annotations by organizationId and documentId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
  }
}
```

#### 2. Get annotations by organizationId, documentId, and locationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationIds": [
      "locationx"
    ],
  }
}
```

#### 3. Get annotations by organizationId, documentId, locationIds, and userIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationIds": [
      "locationx"
    ],
    "userIds": [
      "yourUserId"
    ],
  }
}
```

#### 4. Get annotations by organizationId, documentId, and userIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "userIds": [
      "yourUserId"
    ],
  }
}
```

#### 5. Get annotations by organizationId, documentId, and annotationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "annotationIds": [
      "yourAnnotationId1",
      "yourAnnotationId2"
    ],
  }
}
```

#### 6. Get annotations by organizationId, documentId, locationIds, and annotationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationIds": [
      "locationx"
    ],
    "annotationIds": [
      "yourAnnotationId1",
      "yourAnnotationId2"
    ],
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Annotations fetched successfully.",
    "data": [
      {
        "annotationId": "yourAnnotationId",
        "comments": [
          {
            "commentId": 123456,
            "commentText": "This is a sample comment text.",
            "commentHtml": "<p>This is a sample comment text.</p>",
            "from": {
              "userId": "user123",
              "name": "John Doe",
              "email": "john.doe@example.com"
            },
            "lastUpdated": "2023-06-15T10:30:00Z"
          }
        ],
        "from": {
          "userId": "user123",
          "name": "John Doe",
          "email": "john.doe@example.com"
        },
        "color": "#00FF00",
        "createdAt": "2023-06-15T10:30:00Z",
        "lastUpdated": "2023-06-15T10:30:00Z",
        "status": {
          "id": "OPEN",
          "name": "Open",
          "color": "#0000FF",
          "type": "default"
        }
      },
      null // null is returned only if you provided an annotationId that doesn't exist
    ]
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Annotations fetched successfully.",
      "data": [
        {
          "annotationId": "yourAnnotationId",
          "comments": [
            {
              "commentId": 123456,
              "commentText": "This is a sample comment text.",
              "commentHtml": "<p>This is a sample comment text.</p>",
              "from": {
                "userId": "user123",
                "name": "John Doe",
                "email": "john.doe@example.com"
              },
              "lastUpdated": "2023-06-15T10:30:00Z",
              "type": "text",
            }
          ],
          "from": {
            "userId": "user123",
            "name": "John Doe",
            "email": "john.doe@example.com"
          },
          "color": "#00FF00",
          "createdAt": "2023-06-15T10:30:00Z",
          "lastUpdated": "2023-06-15T10:30:00Z",
          "status": {
            "id": "OPEN",
            "name": "Open",
            "color": "#0000FF",
            "type": "default"
          }
        },
        null // null is returned only if you provided an annotationId that doesn't exist
      ]
    }
  }
  ```
</ResponseExample>
