---
title: Delete Alert By Id
slug: suite-documentation/delete-alert-by-id
docTags: 
createdAt: 2026-08-26T09:20:43.563Z
---

## Endpoint Information

- **URL**: `{gateway-url}/alerts/{id}/plan/{planId}`
- **Method**: `DELETE`
- **Authentication**: Required (`Bearer Token`)
- **Company Header**: Required (`X-Company-Id`)

## Headers

| Header          | Type   | Required | Description                                                                  |
| --------------- | ------ | -------- | ---------------------------------------------------------------------------- |
| `Authorization` | String | Yes      | Bearer token used for authentication. Example: `Bearer <your_access_token>`. |
| `X-Company-Id`  | Long   | Yes      | The company ID used to scope the request.                                    |
| `Accept`        | String | No       | Recommended value: `application/json`.                                       |

## Path Parameters

| Parameter | Type | Required | Description                                                                    |
| --------- | ---- | -------- | ------------------------------------------------------------------------------ |
| `id`      | Long | Yes      | The unique ID of the alert to delete. Must be a positive number.               |
| `planId`  | Long | Yes      | The unique ID of the test plan that owns the alert. Must be a positive number. |

## Request Body

This endpoint does not require a request body.

## Response Body

If the delete operation is completed successfully, the endpoint returns HTTP `200 OK` with an empty JSON object.

```json
{}
```

## Response Fields

This endpoint does not return response fields.

The response does not include `data`, `result.code`, or `result.message`.

## Behavior Notes

- The service first checks whether the given `planId` exists and is accessible.
- Then it deletes the alert record matching both `id` and `planId`.
- If the plan exists but there is no alert matching the given `id` and `planId`, the current implementation still completes successfully and returns `{}`.

## Error Response Format

Error responses use the common problem detail format.

```json
{
  "instance": "/alerts/999/plan/999999",
  "status": 404,
  "title": "Not Found",
  "type": "https://errors.testinium.com/exception",
  "timestamp": "2026-08-18T12:08:41.165927056Z",
  "errorType": "EXCEPTION",
  "errors": {
    "code": 10003,
    "message": "Plan with id 999999 not found!"
  }
}
```

## Error Codes

| HTTP Code | Error Message           | Description                                                                                  |
| --------- | ----------------------- | -------------------------------------------------------------------------------------------- |
| 400       | `BAD_REQUEST`           | The request is malformed, contains invalid path parameters, or a required header is missing. |
| 401       | `UNAUTHORIZED`          | Authentication failed, authentication is required, or the token is invalid.                  |
| 403       | `FORBIDDEN`             | The user does not have permission to access the requested resource or company.               |
| 404       | `NOT_FOUND`             | The related test plan could not be found.                                                    |
| 500       | `INTERNAL_SERVER_ERROR` | An unexpected error occurred on the server side.                                             |

## Application Error Codes

| Code    | Error Type   | HTTP Code | Description                                                                                 |
| ------- | ------------ | --------- | ------------------------------------------------------------------------------------------- |
| `10000` | `EXCEPTION`  | 401       | Authentication failed.                                                                      |
| `10001` | `EXCEPTION`  | 401       | Authentication is required to access this resource.                                         |
| `10002` | `EXCEPTION`  | 401       | The provided token is invalid.                                                              |
| `10003` | `EXCEPTION`  | 403 / 404 | The user is not authorized for the resource, or the requested test plan could not be found. |
| `10004` | `EXCEPTION`  | 400       | A required header is missing. For example, `X-Company-Id` is not provided.                  |
| `10007` | `EXCEPTION`  | 403       | The user does not have access to the requested resource.                                    |
| `20005` | `VALIDATION` | 400       | The `id` or `planId` path parameter is invalid. For example, it is not a positive number.   |
| `20008` | `VALIDATION` | 400       | The `id` or `planId` path parameter has an invalid type.                                    |

## Example Request

```bash
curl --location --request DELETE '{gateway-url}/alerts/{id}/plan/{planId}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--header 'X-Company-Id: <company_id>'
```

