Create Response Target

Creates a new response target configuration. You can change an existing configuration with the Update Response Target API.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

POST /api/sonar/response-targets
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d name="Firewall response target" \
     -d description="Blocks attacker IPs on the perimeter firewall" \
     -d model_type="bluemax-ngf" \
     -d profile_guid="66666666-7777-8888-9999-000000000000" \
     -d 'configs={}' \
     -d ip_blacklist_guid="4dc14f3d-ebf8-4032-8a7a-ef9ec6cd3dd2" \
     -X POST \
     https://HOSTNAME/api/sonar/response-targets
Request Parameters
KeyRequiredTypeDescriptionNote
nameYesStringResponse target nameMinimum 1, maximum 50 characters
descriptionNoStringDescriptionMaximum 2,000 characters
model_typeYesStringResponse model type codeValue provided by an installed app that supports response targets
profile_guidYesStringConnect profile GUID36-character GUID
configsYesString key/valueModel-specific configuration valuesJSON object
ip_blacklist_guidYesStringAddress group GUID to register the blocked IP addresses in36-character GUID
Tip
To find the configs items required for a model_type, select the response model on the New Response Target screen under Settings > Response Targets in the web console.

Success Response

{
  "guid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
  • guid (String): GUID of the created response target configuration

Error Responses

Required parameter is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "name should be not null"
}
name value length is invalid

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'name' must be shorter than or equal to 50 characters."
}
Response model is not found

HTTP status code 500

{
  "error_code": "response-model-not-found",
  "error_msg": null
}
Address group does not exist

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "address group not found: 4dc14f3d-ebf8-4032-8a7a-ef9ec6cd3dd2"
}
Connect profile does not exist

HTTP status code 500

{
  "error_code": "profile-not-found",
  "error_msg": null
}
Response target name already exists

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "duplicated response target name: Firewall response target"
}
configs value is too large

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "too long response target configs (> 65535)"
}
No permission

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}