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

# Bulk-add prompts to a brand

> Validates and creates prompts under their topics (one prompt variety per subscription provider). Invalid rows are flagged in errors_and_warnings while the valid ones are written. Usage limits are enforced transactionally — a batch that would exceed them is rolled back entirely (422 USAGE_LIMIT_REACHED).



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/brands/{brand_id}/prompts
openapi: 3.0.1
info:
  title: Cognizo Public API
  version: v1
  description: >-
    Public REST API for Cognizo. Authenticate with an API key via the
    `X-API-KEY` header.
servers:
  - url: https://core.cognizo.ai
security:
  - apiKey: []
paths:
  /api/v2/brands/{brand_id}/prompts:
    parameters:
      - name: brand_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Prompts
      summary: Bulk-add prompts to a brand
      description: >-
        Validates and creates prompts under their topics (one prompt variety per
        subscription provider). Invalid rows are flagged in errors_and_warnings
        while the valid ones are written. Usage limits are enforced
        transactionally — a batch that would exceed them is rolled back entirely
        (422 USAGE_LIMIT_REACHED).
      operationId: create_brand_prompts
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompts:
                  type: array
                  items:
                    type: object
                    properties:
                      prompt:
                        type: string
                      topic_name:
                        type: string
                      country_code:
                        type: string
                        description: ISO country code, e.g. US
                    required:
                      - prompt
                      - topic_name
                      - country_code
              required:
                - prompts
      responses:
        '201':
          description: prompts created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/prompt_bulk_create_result'
                required:
                  - data
        '403':
          description: subscription missing or inactive
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: usage limit exceeded (rolled back)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '500':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    prompt_bulk_create_result:
      type: object
      properties:
        pilot_mode:
          type: boolean
          description: >-
            true when the addition was validated only, nothing written (internal
            onboarding paths only; the public endpoint always commits)
        total_prompts:
          type: integer
        total_topics:
          type: integer
        total_regions:
          type: integer
        new_topics:
          type: array
          items:
            type: string
        duplicates:
          type: array
          items:
            type: string
          description: Prompts already tracked under a different topic
        invalid_regions:
          type: array
          items:
            type: string
        prompts_added:
          type: integer
        prompts_failed:
          type: integer
        errors_and_warnings:
          type: array
          items:
            type: object
            properties:
              prompt:
                type: string
              topic_name:
                type: string
              country_code:
                type: string
              error:
                type: string
            required:
              - prompt
              - topic_name
              - country_code
              - error
        approaching_prompt_limit:
          type: boolean
          description: prompts_used ≥ 75% of the limit after this batch
      required:
        - pilot_mode
        - total_prompts
        - total_topics
        - total_regions
        - new_topics
        - duplicates
        - invalid_regions
        - prompts_added
        - prompts_failed
        - errors_and_warnings
        - approaching_prompt_limit
    error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/error_detail'
          required:
            - code
            - message
      required:
        - error
    error_detail:
      type: object
      properties:
        field:
          type: string
          nullable: true
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
        - field
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````