> ## 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.

# Delete Comment Annotations

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

# Endpoint

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

# 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">
      Organization ID
    </ParamField>

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

    <ParamField body="locationIds" type="string[]">
      Array of Location IDs
    </ParamField>

    <ParamField body="annotationIds" type="string[]">
      Array of Annotation IDs
    </ParamField>

    <ParamField body="userIds" type="string[]">
      Array of User IDs
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

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

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

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

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

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

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

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

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

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

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

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

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

#### 7. Delete annotations by documentId. This will work if the document was created without an organization.

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

#### 8. Delete annotations by documentId and locationIds. This will work if the document was created without an organization.

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

#### 9. Delete annotations by documentId and userIds. This will work if the document was created without an organization.

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

#### 10. Delete annotations by documentId and annotationIds. This will work if the document was created without an organization.

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

#### 11. Delete annotations by documentId, locationIds, and userIds. This will work if the document was created without an organization.

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

#### 12. Delete annotations by documentId, locationIds, and annotationIds. This will work if the document was created without an organization.

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

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Annotations deleted successfully.",
    "data": {
      "yourAnnotationId1": {
        "success": true,
        "id": "yourAnnotationId",
        "message": "Deleted Successfully"
      },
      "yourAnnotationId2": {
        "success": false,
        "id": "yourAnnotationId2",
        "message": "Annotation not found."
      }
    }
  }
}
```

#### Failure Response

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

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Annotations deleted successfully.",
      "data": {
        "yourAnnotationId": {
          "success": true,
          "id": "yourAnnotationId",
          "message": "Deleted Successfully"
        }
      }
    }
  }
  ```
</ResponseExample>
