Skip to content

Modify Default Configuration Status



POST /api/v1/incidents/level/config/set

Overview

Enable or disable the default incident level for the current workspace.

Before You Call and Usage Steps

The Key must have incidents.incidentsLevelManage, and it applies only to the workspace that owns the Key. This module shares the underlying levels and default level configuration with the Issue level API, so changes may affect both Incident and Issue level selection; it does not create an independent copy within this module only. When global levels are enabled in the backend, the effective level selection may be determined first by the global configuration, and the workspace management list still lists only defaults and workspace custom items, excluding backend global levels. Ask an administrator to confirm the effective behavior before making changes, and do not treat every item in the management list as an available level.

You must pass isDisabled as a boolean: true disables the four default levels, false enables them; the default items are not deleted, saving of workspace custom levels is not affected, and existing Incident/Issue/Monitor references are not modified. The protection "at least one available custom level / default levels that are still referenced cannot be disabled" is not currently enabled, so create and migrate suitable levels before disabling, to avoid losing available choices. Setting the value repeatedly writes the configuration and records enable/disable audit entries; side effects are not guaranteed to be absent.

The response differs from config_get: this endpoint returns the configuration database entity, and the target value is in content.config.isDisabled; the read endpoint returns content.isDisabled. On timeout or failure, first use config_get to confirm whether the target value has been saved, then decide whether to retry.

Request Headers

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

Body Request Parameters

Parameter Name Type Required Description
isDisabled bool Y Required boolean, true to disable / false to enable; cannot be omitted/null/string; the default levels are not deleted and references are not migrated.
Allow null: False
Example: true
How to obtain or fill in: The workspace administrator confirms whether the four default levels continue to participate in level selection.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/incidents/level/config/set' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"isDisabled":true}'

Response

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

Field Type Description
content.id integer or null Database row ID; use uuid for business identification, and a snapshot taken before submission may be null.
content.uuid string UUID of this resource.
content.status integer Database status, 0 active / 3 deleted; different from the incident business status incidentsStatus.
content.creator string Creator principal; for an API Key this is generally wsak_ plus the resource UUID.
content.updator string Most recent updater principal; may be empty if never updated.
content.createAt integer Creation time in Unix seconds.
content.updateAt integer Most recent update time in Unix seconds.
content.deleteAt integer Deletion time in Unix seconds; -1 if not deleted.
content.workspaceUUID string UUID of the current workspace.
content.keyCode string Fixed value IssueLevelDisabled, shared with Issue levels.
content.config object Saved switch object.
content.config.isDisabled boolean Saved target value: true disables the four default levels, false enables them.
content.declaration object Common declarations of the current workspace.
{
  "code": 200,
  "content": {
    "id": 123,
    "uuid": "ctcf_example",
    "status": 0,
    "creator": "wsak_example",
    "updator": "",
    "createAt": 1785427200,
    "updateAt": -1,
    "deleteAt": -1,
    "workspaceUUID": "wksp_example",
    "keyCode": "IssueLevelDisabled",
    "config": {
      "isDisabled": true
    },
    "declaration": {}
  },
  "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 A request field is missing, or a field value violates the declared validation conditions Parameter parsing failed Verify the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError The request JSON syntax is invalid Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The top level of the JSON is not an object Some json file format error Submit an object containing the isDisabled boolean.
500 ft.InternalServerError Database, configuration/identity format, or unhandled system exception Internal error Reads can be retried with backoff; for writes, first read back the configuration/level list to verify whether it was saved, then decide whether to retry.

Feedback

Is this page helpful?