Updated on 2026-01-13 GMT+08:00

Adding a Category to a Specified Template

Function

This API is used to add a template category based on the specified template ID and project ID. The category name and parent category ID can be specified.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/scan-templates/{template_id}/classifications

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which is used to identify a specific project.

template_id

Yes

String

Template ID, which is used to identify a specific scan template.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

classification_name

Yes

String

Name of a classification, which is used to create a template classification.

parent_id

No

String

Parent classification ID, which indicates the parent classification of the classification.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

msg

String

Returned message, which is used to describe the operation result or status information.

status

String

Returned status, which indicates whether the operation is successful. For example, 200 indicates that the operation is successful, and 400 indicates that the request is invalid.

Status code: 201

Classification added.

Example Requests

POST /v1/{project_id}/scan-templates/{template_id}/classifications

{
  "classification_name" : "string",
  "parent_id" : "string"
}

Example Responses

None

Status Codes

Status Code

Description

200

Request succeeded. The adding result is returned.

201

Classification added.

401

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

403

Unauthorized to access the resource.

404

The specified template is not found.

Error Codes

See Error Codes.