Set Prompt Topics
Replace all topics of one active prompt. An empty list removes all topics.
curl --request POST \
--url https://api.aiclicks.io/api/v1/prompts/topics \
--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",
"topic_ids": [
"a7d0e2c4-1b3f-4d5a-9e6b-7c8d9e0f1a2b",
"e3f4a5b6-7c8d-4e9f-a0b1-c2d3e4f5a6b7"
]
}'
import httpx, os
resp = httpx.post(
"https://api.aiclicks.io/api/v1/prompts/topics",
headers={"Authorization": f"Bearer {os.environ['AICLICKS_API_KEY']}"},
json={
"domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
"prompt_id": "21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
"topic_ids": [
"a7d0e2c4-1b3f-4d5a-9e6b-7c8d9e0f1a2b",
"e3f4a5b6-7c8d-4e9f-a0b1-c2d3e4f5a6b7",
],
},
)
resp.raise_for_status()
print(resp.json()["data"])
const resp = await fetch("https://api.aiclicks.io/api/v1/prompts/topics", {
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",
topic_ids: [
"a7d0e2c4-1b3f-4d5a-9e6b-7c8d9e0f1a2b",
"e3f4a5b6-7c8d-4e9f-a0b1-c2d3e4f5a6b7",
],
}),
});
console.log((await resp.json()).data);
{
"data": { "success": true },
"generated_at": "2026-11-09T10:00:11.218000+00:00"
}
{
"detail": "Prompts not found among this domain's active prompts: 21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b"
}
{
"detail": "Query 21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b or topic e3f4a5b6-7c8d-4e9f-a0b1-c2d3e4f5a6b7 not found"
}
Replaces all topics of one active prompt with the topics in topic_ids. The prompt loses the topics that are not in the list. If you send an empty list, the API removes all topics from the prompt.
Each topic must be in the same domain as the prompt. Find topic IDs with GET /api/v1/topics. To make a new topic, use POST /api/v1/topics.
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.
The full new list of topic UUIDs for the prompt. Send [] to remove all topics. Each topic must be in the domain of the prompt.
Response
true when the API replaced the topics. To see the new topics, call GET /api/v1/prompts.
ISO-8601 time when the server made this response.
Side effects
- 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. 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.
The body is not valid. For example, topic_ids is missing, or a value is not a UUID.
You sent too many requests. Read the Retry-After header to know how long to wait.