PromptsAdd Prompts (Bulk)

Add Prompts (Bulk)

Add up to 100 tracked prompts to a domain in one call, with optional topic and tag names.

curl --request POST \
  --url https://api.aiclicks.io/api/v1/prompts/bulk \
  --header 'Authorization: Bearer ak_live_xxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
    "prompts": [
      { "text": "best CRM for small business", "topics": ["CRM"], "tags": ["Commercial"] },
      { "text": "how to migrate from spreadsheets to a CRM", "topics": ["CRM", "Migration"] }
    ]
  }'
{
  "data": {
    "added": [
      {
        "id": "21c1f9aa-9b6d-4e3a-8a31-2b0c0e1f2a3b",
        "text": "best CRM for small business",
        "estimated_search_volume": 8100,
        "created_at": "2026-11-09T10:00:11.118000+00:00",
        "topics": ["CRM"],
        "tags": ["Commercial"]
      }
    ],
    "duplicates": ["how to migrate from spreadsheets to a CRM"],
    "errors": []
  },
  "generated_at": "2026-11-09T10:00:11.218000+00:00"
}

Adds up to 100 prompts to one domain in one request. Each prompt can have topic names and tag names. The new prompts join the analysis of the domain immediately.

This endpoint takes names, not IDs, for topics and tags. If a topic name does not exist, the API creates the topic. If a tag name does not exist, the API skips that tag. If a prompt gets no known tag, the API gives it the default tags of the domain.

The API skips a prompt that has the same text as an active prompt. The API also skips a prompt that has the same text as an earlier prompt in the same request. The response lists the skipped texts in duplicates.

To add one prompt with topic and tag IDs, use POST /api/v1/prompts.

This is a billed write. Each added prompt uses one prompt credit from the team of the domain. The API checks the credits before it adds a prompt. If the team does not have a credit for each new prompt, the call returns 400 and the API adds no prompts.

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.

header
X-Request-Idstring

Optional UUID for log correlation. If you do not send it, the API makes one and returns it in the response.

Body parameters

body
domain_idstring
Required

UUID of the domain. Find domains with GET /api/v1/domains.

body
promptsarray
Required

The prompts to add. Send 1 to 100 items.

Response

data.addedarray
Required

The prompts that the API added. Each item has id, text, estimated_search_volume, created_at, topics (names) and tags (names).

data.duplicatesarray
Required

The texts that the API skipped. Each text is the same as an active prompt or as an earlier item in the request. Skipped prompts use no credit.

data.errorsarray
Required

Other items that failed. Each item is { "query": "<text>", "error": "<reason>" }, for example "Empty prompt text". Failed items use no credit.

generated_atstring
Required

ISO-8601 time when the server made this response.

Side effects

Errors

400 Bad Requesterror

The team does not have a credit for each new prompt. The message gives the numbers, for example "Not enough remaining prompts. You have 1 prompts but need 2." The API adds no prompts.

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. Or the plan of the team does not include API access (the Starter plan does not).

404 Not Founderror

domain_id is not a valid UUID, or the domain does not exist.

422 Unprocessable Entityerror

The body is not valid. For example, prompts is empty, has more than 100 items, or a required field is missing.

429 Too Many Requestserror

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