Skip to main content

Update System Prompts

This workflow sample demonstrates how to update user system prompts.

info

Obtain the authorization token needed to execute the request using POST /api/auth/login.

Obtain the user ID from GET /api/users.

Update System Prompts

Use this workflow to quickly update system prompts for a user.

Request URL

POST /api/users/{userId}/systemprompts
  • userId: The ID of the user to update system prompts for

Note: You can obtain the user ID from the response of GET /api/users.

Request Headers

NameTypeDescription
X-MSTR-AuthTokenHeaderAuthorization token generated by POST /api/auth/login

Request Body Schema

{
"systemPrompts": [
{
"index": 0,
"prompt": "string"
}
]
}
  • index: System Prompt Index
  • prompt: System Prompt Value

Sample Request Body

{
"systemPrompts": [
{
"index": 59,
"prompt": "Alen"
},
{
"index": 74,
"prompt": "60"
}
]
}

You can use this endpoint to clear user system prompts by setting the prompts list to an empty array.

{
"systemPrompts": []
}

Sample Curl Request

curl -X 'POST' 'http://demo.microstrategy.com/MicroStrategyLibrary/api/users/E697E885F6426C1F0B794593D648AFC0/systemprompts' \
-H 'accept: application/json' \
-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \
-H 'Content-Type: application/json' \
-d '{
"systemPrompts": [
{
"index": 59,
"prompt": "Alen"
},
{
"index": 74,
"prompt": "60"
}
]
}'

Response Body Schema

If successful, this API call returns a 200 OK status code and a list of system prompts in the response body.

{
"systemPrompts": [
{
"index": 0,
"prompt": "string"
}
]
}
  • index: System Prompt Index
  • prompt: System Prompt Value

Sample Response

{
"systemPrompts": [
{
"index": 59,
"prompt": "Alen"
},
{
"index": 74,
"prompt": "60"
}
]
}

HTTP Status Codes

Status CodeDescription
200OK
500Internal Server Error
401Unauthorized
400Bad Request