Create Signature
Creates a new signature.
Required Permissions
Requires the MEMBER role or higher.
HTTP Request
POST /api/sonar/signatures
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d signature="sig" \
-d capecs="CAPEC-1" \
-X POST \
https://HOSTNAME/api/sonar/signatures
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| guid | X | String | Signature identifier | 36-character GUID. Randomly generated if not set |
| signature | O | String | Signature code | Min 1, max 255 characters |
| description | X | String | Signature description | Maximum 2000 characters |
| app_code | X | String | App code | Min 1, max 50 characters |
| capecs | O | String list | CAPEC ID list | Comma-separated CAPEC IDs |
Success Response
{}
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "signature should be not null"
}
Invalid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
Signature code exceeds maximum length
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'signature' must be shorter than or equal to 255 characters."
}
Invalid CAPEC ID format
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "invalid capec format: invalid-capec-id"
}
No permission
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}