Help Center/ Data Security Center/ API Reference/ API Description/ Policy Center/ Enabling or Disabling a Security Policy
Updated on 2026-01-13 GMT+08:00

Enabling or Disabling a Security Policy

Function

This API is used to enable or disable security policies in batches.

Calling Method

For details, see Calling APIs.

URI

PUT /v1/{project_id}/security-policies

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

operation

Yes

String

Operation type, which can be enable or disable.

Request Parameters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

ids

No

Array of longs

Policy ID list.

Response Parameters

Status code: 200

Operation succeeded.

Status code: 201

Resource being created.

None

Example Requests

PUT /v1/{project_id}/security-policies

{
  "ids" : [ 0 ]
}

Example Responses

None

Status Codes

Status Code

Description

200

Operation succeeded.

201

Resource being created.

401

Unauthorized. The user is not logged in or the token is invalid.

403

Unauthorized to access the resource.

404

The specified project does not exist.

Error Codes

See Error Codes.