PromptsSet Prompt Topics

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"
    ]
  }'
{
  "data": { "success": true },
  "generated_at": "2026-11-09T10:00:11.218000+00:00"
}

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

header
Authorizationstring
Required

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.

header
Content-Typestring
Required

Must be application/json.

Body parameters

body
domain_idstring
Required

UUID of the domain that owns the prompt.

body
prompt_idstring
Required

UUID of an active prompt of the domain.

body
topic_idsarray
Required

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

data.successboolean
Required

true when the API replaced the topics. To see the new topics, call GET /api/v1/prompts.

generated_atstring
Required

ISO-8601 time when the server made this response.

Side effects

Errors

400 Bad Requesterror

A topic in topic_ids is in a different domain than the prompt.

401 Unauthorizederror

The API key is missing, malformed or revoked.

403 Forbiddenerror

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.

404 Not Founderror

prompt_id is not an active prompt of the domain, or a topic in topic_ids does not exist.

422 Unprocessable Entityerror

The body is not valid. For example, topic_ids is missing, or a value is not a UUID.

429 Too Many Requestserror

You sent too many requests. Read the Retry-After header to know how long to wait.