The new prompt text. The API removes spaces at the start and end. The text must not be empty. The maximum is 500 characters. The text must not contain < or >. You can send the current text if you only want to change topics or tags.
Update Prompt
Change the text of an active prompt. You can also replace its topics and add or remove tags in the same call.
curl --request POST \
--url https://api.aiclicks.io/api/v1/prompts/update \
--header 'Authorization: Bearer ak_live_xxx' \
--header 'Content-Type: application/json' \
--data '{
"domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
"prompt_id": "21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
"text": "best CRM for small teams",
"topic_ids": ["a7d0e2c4-1b3f-4d5a-9e6b-7c8d9e0f1a2b"],
"add_tag_ids": ["c9f2a4b6-3d5e-4f7a-8b9c-0d1e2f3a4b5c"]
}'
import httpx, os
resp = httpx.post(
"https://api.aiclicks.io/api/v1/prompts/update",
headers={"Authorization": f"Bearer {os.environ['AICLICKS_API_KEY']}"},
json={
"domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
"prompt_id": "21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
"text": "best CRM for small teams",
"topic_ids": ["a7d0e2c4-1b3f-4d5a-9e6b-7c8d9e0f1a2b"],
"add_tag_ids": ["c9f2a4b6-3d5e-4f7a-8b9c-0d1e2f3a4b5c"],
},
)
resp.raise_for_status()
print(resp.json()["data"]["text"])
const resp = await fetch("https://api.aiclicks.io/api/v1/prompts/update", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AICLICKS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
domain_id: "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
prompt_id: "21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
text: "best CRM for small teams",
topic_ids: ["a7d0e2c4-1b3f-4d5a-9e6b-7c8d9e0f1a2b"],
add_tag_ids: ["c9f2a4b6-3d5e-4f7a-8b9c-0d1e2f3a4b5c"],
}),
});
const { data } = await resp.json();
console.log(data.text, data.tags);
{
"data": {
"id": "21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
"text": "best CRM for small teams",
"estimated_search_volume": 2900,
"created_at": "2026-06-17T10:00:11.118000+00:00",
"topics": ["CRM"],
"tags": ["Branded", "Commercial"]
},
"generated_at": "2026-11-09T10:00:11.218000+00:00"
}
{
"detail": "Only team admins, co-admins, and editors can manage tags"
}
{
"detail": "Prompts not found among this domain's active prompts: 21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b"
}
{
"detail": "A prompt with the same text already exists in this domain."
}
{
"detail": [
{
"type": "value_error",
"loc": ["body", "text"],
"msg": "Value error, Prompt text cannot be empty"
}
]
}
Changes the text of one active prompt. In the same call, you can replace the topics of the prompt and add or remove tags.
The prompt keeps its ID. Answers that the API collected before the change stay on the prompt. These answers are for the old text. If you want a clean history, archive the prompt with POST /api/v1/prompts/archive and add a new prompt.
If the new text is the same as another active prompt of the domain, the call returns 409. The comparison ignores letter case and extra spaces. The API gets a new search volume for the new text.
Authorizations
Your API key in the format Bearer ak_live_<your-key>. Create a key in the dashboard under Settings → Developers. The key must have access to the team that owns domain_id.
Must be application/json.
Body parameters
UUID of the domain that owns the prompt.
UUID of an active prompt of the domain. Find prompt IDs with GET /api/v1/prompts.
Topic UUIDs that replace all topics of the prompt. If you do not send this field, the topics do not change. If you send [], the API removes all topics. Each topic must be in the domain of the prompt.
Tag UUIDs to add. The API ignores IDs that are not in the domain. Default [].
Tag UUIDs to remove. The API ignores IDs that are not in the domain. Default [].
If you send add_tag_ids or remove_tag_ids, the caller must have the admin, co-admin or editor role on the team. The team manager can always change tags.
Response
The prompt after the change. It has id, text, estimated_search_volume, created_at, topics (names, sorted) and tags (names, sorted).
ISO-8601 time when the server made this response.
Side effects
- The API stores the new text and a new estimated search volume.
- No prompt credit is used or refunded.
- The API clears the cache of
GET /api/v1/prompts,GET /api/v1/tagsandGET /api/v1/topicsfor the domain.
Errors
A topic in topic_ids is in a different domain than the prompt.
The API key is missing, malformed or revoked.
The caller is not a member of the team of the domain, or the API key has no access to this domain. If you change tags, the caller does not have the admin, co-admin or editor role. The plan of the team can also not include API access.
prompt_id is not an active prompt of the domain, or a topic in topic_ids does not exist.
Another active prompt of the domain has the same text. The API changes nothing.
The body is not valid. For example, text is empty, has more than 500 characters, or contains < or >.
You sent too many requests. Read the Retry-After header to know how long to wait.