> ## Documentation Index
> Fetch the complete documentation index at: https://docs.get-spotlight.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch create topics & prompts

> Create multiple topics and prompts in a single request.

The recommended way to add prompts. One call can create new topics, add prompts to those new topics, and also add prompts to existing topics — all at once.

### Path parameters

<ParamField path="brandId" type="string" required>
  Brand UUID. Obtain from [List brands](/api-reference/brands/list).
</ParamField>

### Request body

<ParamField body="topics" type="TopicInput[]" required>
  Array of topics. Each topic can be new (provide `name`) or existing (provide `id`).

  <Expandable title="TopicInput — new topic" />

  <Expandable title="TopicInput — existing topic" />

  <Expandable title="PromptInput" />
</ParamField>

### Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -s -X POST \
    -H "x-spotlight-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "topics": [
        {
          "name": "Pricing",
          "prompts": [
            { "text": "How does the pricing compare to alternatives?", "customerJourney": "consideration" },
            { "text": "Is there a free tier available?" }
          ]
        },
        {
          "id": "existing-topic-uuid",
          "prompts": [
            { "text": "What do customers say about support response times?" }
          ]
        }
      ]
    }' \
    "https://app.get-spotlight.com/api/v1/brands/BRAND_ID/topics-prompts/batch"
  ```

  ```python Python theme={null}
  import requests

  payload = {
      "topics": [
          {
              "name": "Pricing",
              "prompts": [
                  {"text": "How does the pricing compare to alternatives?", "customerJourney": "consideration"},
              ],
          },
          {
              "id": "existing-topic-uuid",
              "prompts": [{"text": "What do customers say about support?"}],
          },
      ]
  }

  r = requests.post(
      "https://app.get-spotlight.com/api/v1/brands/BRAND_ID/topics-prompts/batch",
      headers={"x-spotlight-api-key": "YOUR_API_KEY"},
      json=payload,
  )
  print(r.json())
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "topics": [
    { "id": "new-topic-uuid", "name": "Pricing", "prompts": [] }
  ],
  "remainingSlots": 87,
  "promptLimit": 100,
  "orgWideLimit": 500,
  "orgTotalPrompts": 413
}
```

### Errors

`409` — prompt limit exceeded:

```json theme={null}
{
  "message": "Prompt limit exceeded",
  "code": "prompt_limit_exceeded",
  "remainingSlots": 0,
  "promptLimit": 100,
  "orgWideLimit": 500,
  "orgTotalPrompts": 500
}
```
