Get AI prompt
Gets the detailed information of the specified AI prompt.
HTTP Request
GET /api/sonar/ai/prompts/:guid
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
https://HOSTNAME/api/sonar/ai/prompts/a1b2c3d4-e5f6-7890-abcd-ef1234567890
Request Parameters
Path Parameters
| Key | Type | Description | Notes |
|---|---|---|---|
| guid | String | Prompt identifier | 36-character GUID |
Success Response
{
"prompt": {
"guid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Log Analysis",
"type": "qna",
"prompt": "Analyze the logs and detect anomalies.",
"description": "Prompt for log analysis",
"enabled": true,
"builtin": false,
"created": "2024-01-15 10:30:00+0900",
"updated": "2024-01-15 10:30:00+0900"
}
}
- prompt (Object): Prompt information
- guid (String): Prompt GUID
- name (String): Prompt name
- type (String): Prompt type.
plan,action,qna - prompt (String): Prompt content
- description (String): Prompt description
- enabled (Boolean): Whether the prompt is enabled
- builtin (Boolean): Whether the prompt is a built-in app prompt
- created (String): Date and time of creation (
yyyy-MM-dd HH:mm:ssZ) - updated (String): Date and time of last modification (
yyyy-MM-dd HH:mm:ssZ)
Error Responses
Identifier is not in valid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
Prompt is not found
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "prompt not found"
}