Skip to content

Delete Custom Level



POST /api/v1/incidents/level/delete

Overview

Batch delete custom incident levels in the current workspace.

Prerequisites and Usage Steps

The Key must have incidents.incidentsLevelManage and applies only to the workspace that owns the Key. This module shares the underlying levels and default level configuration with the Issue level API. Changes may affect both Incident and Issue level selection; they do not create an independent copy only for this module. When global levels are enabled on the backend, the actual effective level selection may be determined first by the global configuration. The management list for this workspace still lists only default and workspace custom items and does not include backend global levels. Administrators should confirm the effective policy before making changes and should not treat all items in the management list as available levels.

uuids is a required array; [] succeeds directly with true. If any item starts with system_level_, the entire batch is rejected; otherwise, only matching undeleted items in the current workspace are deleted. Unknown, cross-workspace, and already deleted UUIDs are silently ignored. No deletion count or per-item result is returned; true does not mean every item exists.

This is a soft delete of level configuration. It does not delete Incidents/Issues, clear their historical level values, or automatically migrate references in Monitors/Incidents/escalation configurations. There is currently no runtime protection such as "cannot delete while still in use" or "keep at least one custom level"; after the default is disabled, all custom items can still be deleted. Before deletion, inventory and adjust references and retain necessary levels; after deletion, verify the level list and business display. On failure, read back the current state before retrying; do not conclude that it was not deleted based on a 500.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace.

Body Request Parameters

Parameter Type Required Description
uuids[*] string A single custom level UUID string; must not start with the system_level_ prefix.
Example: issl_example
How to obtain or enter: Same source as uuids.
uuids array Y Required array; [] performs no operation and returns true; only matching custom items in this workspace are deleted, and no count is returned; if the default level prefix is included, the entire batch is rejected.
Null allowed: False
Example: ["issl_example"]
How to obtain or enter: Obtain the uuid of items with isDefault=false from the Incident level list, and inventory references first.

Request Example

curl --request POST 'https://openapi.truewatch.com/api/v1/incidents/level/delete' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"uuids":["issl_example"]}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content boolean Always true; there may be no matching records; no deletion count.
{
  "code": 200,
  "content": true,
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Response

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field is missing, or the field value violates the declared validation conditions Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Correct the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The JSON top level is not an object Partial JSON file format error Submit an object containing the uuids array.
406 ft.NotAllowDeleteDefaultIssueLevel uuids contains any value with the system_level_ prefix Deleting the workspace's default level configuration is not allowed Default levels are enabled or disabled using config_set and cannot be deleted; filter custom items from the list.
500 ft.InternalServerError Database, configuration/identity format, or unhandled system exception Internal error For reads, retry with backoff; for writes, read back the configuration/level list to verify whether it was saved before deciding whether to retry.