PromptsUpdate Prompt

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"]
  }'
{
  "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"
}

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

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. Find prompt IDs with GET /api/v1/prompts.

body
textstring
Required

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.

body
topic_idsarray

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.

body
add_tag_idsarray

Tag UUIDs to add. The API ignores IDs that are not in the domain. Default [].

body
remove_tag_idsarray

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

dataobject
Required

The prompt after the change. It has id, text, estimated_search_volume, created_at, topics (names, sorted) and tags (names, sorted).

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. 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.

404 Not Founderror

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

409 Conflicterror

Another active prompt of the domain has the same text. The API changes nothing.

422 Unprocessable Entityerror

The body is not valid. For example, text is empty, has more than 500 characters, or contains < or >.

429 Too Many Requestserror

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