Set Prompt Tags
Add tags to, or remove tags from, up to 100 active prompts in one call.
curl --request POST \
--url https://api.aiclicks.io/api/v1/prompts/tags \
--header 'Authorization: Bearer ak_live_xxx' \
--header 'Content-Type: application/json' \
--data '{
"domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
"prompt_ids": [
"21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
"5b7e2d10-4c3a-4f8e-9d21-6a0b1c2d3e4f"
],
"add_tag_ids": ["c9f2a4b6-3d5e-4f7a-8b9c-0d1e2f3a4b5c"],
"remove_tag_ids": ["a1b2c3d4-1111-4aaa-8bbb-000000000002"]
}'
import httpx, os
resp = httpx.post(
"https://api.aiclicks.io/api/v1/prompts/tags",
headers={"Authorization": f"Bearer {os.environ['AICLICKS_API_KEY']}"},
json={
"domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
"prompt_ids": [
"21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
"5b7e2d10-4c3a-4f8e-9d21-6a0b1c2d3e4f",
],
"add_tag_ids": ["c9f2a4b6-3d5e-4f7a-8b9c-0d1e2f3a4b5c"],
"remove_tag_ids": ["a1b2c3d4-1111-4aaa-8bbb-000000000002"],
},
)
resp.raise_for_status()
print(resp.json()["data"])
const resp = await fetch("https://api.aiclicks.io/api/v1/prompts/tags", {
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_ids: [
"21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
"5b7e2d10-4c3a-4f8e-9d21-6a0b1c2d3e4f",
],
add_tag_ids: ["c9f2a4b6-3d5e-4f7a-8b9c-0d1e2f3a4b5c"],
remove_tag_ids: ["a1b2c3d4-1111-4aaa-8bbb-000000000002"],
}),
});
const { data } = await resp.json();
console.log(data.affected_prompt_count);
{
"data": {
"applied_add_tag_ids": ["c9f2a4b6-3d5e-4f7a-8b9c-0d1e2f3a4b5c"],
"applied_remove_tag_ids": ["a1b2c3d4-1111-4aaa-8bbb-000000000002"],
"affected_prompt_count": 2
},
"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: 5b7e2d10-4c3a-4f8e-9d21-6a0b1c2d3e4f"
}
Adds tags to, and removes tags from, a set of active prompts. You can send up to 100 prompt IDs. The API applies the same change to each prompt.
The API ignores tag IDs that are not in the domain. The response gives the tag IDs that the API applied. Find tag IDs with GET /api/v1/tags. To make a new tag, use POST /api/v1/tags.
The caller must have the admin, co-admin or editor role on the team. The team manager can always change tags. A viewer gets 403.
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 prompts and the tags.
UUIDs of the prompts to change. Send 1 to 100 IDs. Each ID must be an active prompt of the domain.
Tag UUIDs to add to each prompt. If a prompt already has a tag, nothing changes for that tag. Default [].
Tag UUIDs to remove from each prompt. Default [].
Response
The tag IDs from add_tag_ids that are in the domain. The API added these tags.
The tag IDs from remove_tag_ids that are in the domain. The API removed these tags.
The number of prompts that the API changed.
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
The API key is missing, malformed or revoked.
The caller does not have the admin, co-admin or editor role. Or the caller is not a member of the team, or the API key has no access to this domain. The plan of the team can also not include API access.
One or more IDs are not active prompts of the domain. The message lists these IDs. The API changes no prompts.
The body is not valid. For example, prompt_ids is empty, has more than 100 items, or has a value that is not a UUID.
You sent too many requests. Read the Retry-After header to know how long to wait.