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

Use this API to delete notifications.

# Endpoint

`POST https://api.velt.dev/v1/notifications/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" required>
      Organization ID
    </ParamField>

    <ParamField body="documentId" type="string">
      Document ID (Optional)
    </ParamField>

    <ParamField body="locationId" type="string">
      Location ID (Optional)
    </ParamField>

    <ParamField body="userId" type="string">
      User ID (Optional)
    </ParamField>

    <ParamField body="notificationIds" type="string[]">
      Array of Notification IDs (Optional)
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### 1. Delete by organizationId and documentId

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

#### 2. Delete by organizationId, documentId and notificationIds

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

#### 3. Delete by organizationId and userId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "userId": "yourUserId"
  }
}
```

#### 4. Delete by organizationId, userId and notificationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "userId": "yourUserId",
    "notificationIds": [
      "yourNotificationId"
    ]
  }
}
```

#### 5. Delete by organizationId, documentId and userId

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

#### 6. Delete by organizationId, documentId, userId and notificationIds

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

#### 7.Delete by organizationId, documentId and locationId

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

#### 8. Delete by organizationId, documentId, locationId and notificationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationId": "yourLocationId",
    "notificationIds": [
      "yourNotificationId"
    ]
  }
}
```

#### 9. Delete by organizationId, locationId and userId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "locationId": "yourLocationId",
    "userId": "yourUserId",
  }
}
```

#### 10. Delete by organizationId, locationId, userId, and notificationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "locationId": "yourLocationId",
    "userId": "yourUserId",
    "notificationIds": [
      "yourNotificationId"
    ]
  }
}
```

#### 11. Delete by organizationId, documentId, locationId and userId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationId": "yourLocationId",
    "userId": "yourUserId",
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
   "result": {
       "status": "success",
       "message": "Notification(s) deleted successfully.",
       "data": {
           "8955243231506071": {
               "success": true,
               "message": "Notification deleted."
           }
       }
   }
}
```

#### When some notifications are not found

```JSON theme={null}
{
   "result": {
       "status": "success",
       "message": "Notification(s) deleted successfully.",
       "data": {
           "89552432315060712": {
               "success": false,
               "message": "Failed to delete notification."
           },
           "8955243231506071": {
               "success": true,
               "message": "Notification deleted."
           }
       }
   }
}
```

#### Failure Response

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

<ResponseExample>
  ```js theme={null}
  {
     "result": {
         "status": "success",
         "message": "Notification(s) deleted successfully.",
         "data": {
             "8955243231506071": {
                 "success": true,
                 "message": "Notification deleted."
             }
         }
     }
  }
  ```
</ResponseExample>
