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

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string`

Organization ID

**documentId** `string` *required*

Document ID

**locationIds** `string[]`

Array of Location IDs

**annotationIds** `string[]`

Array of Annotation IDs

**userIds** `string[]`

Array of User IDs

## **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"
  }
}
```

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.