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

# Create prompts in a workspace

> Creates one prompt (`prompt`) or several (`prompts`) in the workspace and starts monitoring them, exactly like creation in the UI (including search-volume computation). Up to 5 prompts are created synchronously (201 with the created items); larger batches are processed asynchronously (202 with a processing summary). The whole batch is validated against the workspace's remaining prompt allocation up front — nothing is created if it would exceed the limit.



## OpenAPI

````yaml https://data.otterly.ai/v1/openapi.json post /v1/workspaces/{id}/prompts
openapi: 3.0.0
info:
  title: Otterly Public API
  version: 1.0.0
servers:
  - url: https://data.otterly.ai
security: []
tags:
  - name: Engines
  - name: Workspaces
  - name: Tags
  - name: Prompts
  - name: Brand Reports
  - name: Audits
  - name: Accounts
paths:
  /v1/workspaces/{id}/prompts:
    post:
      tags:
        - Prompts
      summary: Create prompts in a workspace
      description: >-
        Creates one prompt (`prompt`) or several (`prompts`) in the workspace
        and starts monitoring them, exactly like creation in the UI (including
        search-volume computation). Up to 5 prompts are created synchronously
        (201 with the created items); larger batches are processed
        asynchronously (202 with a processing summary). The whole batch is
        validated against the workspace's remaining prompt allocation up front —
        nothing is created if it would exceed the limit.
      parameters:
        - schema:
            type: string
            minLength: 1
            example: 01HX7K2YV9D3M8N0G6Q5R4S3T2
            description: Workspace identifier.
          required: true
          description: Workspace identifier.
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicApiCreatePromptsRequest'
      responses:
        '201':
          description: The created prompts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiCreatedPrompts'
        '202':
          description: Batch accepted; prompts are created asynchronously.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiPromptsProcessing'
        '400':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiValidationErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponse'
        '409':
          description: One or more prompts already exist in the workspace for this country.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiDuplicatePrompts'
        '429':
          description: Quota exhausted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    PublicApiCreatePromptsRequest:
      type: object
      properties:
        prompts:
          type: array
          items:
            type: string
            minLength: 1
          minItems: 1
          description: >-
            Prompt texts to create (same country, tags and brand reports for
            all). Pass a single-item array to create one prompt.
        country:
          type: string
          pattern: ^[a-z]{2}$
          description: >-
            Country the prompts are monitored in. Lowercase ISO 3166-1 alpha-2;
            use `uk` for the United Kingdom. Immutable after creation.
        tagIds:
          type: array
          items:
            type: string
            minLength: 1
          description: Optional tag IDs to assign to every created prompt.
        brandReportIds:
          type: array
          items:
            type: string
            minLength: 1
          description: Optional brand report IDs to add every created prompt to.
      required:
        - prompts
        - country
      example:
        prompts:
          - best running shoes
          - best trail shoes
        country: us
        tagIds: []
    PublicApiCreatedPrompts:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PublicApiCreatedPrompt'
      required:
        - items
    PublicApiPromptsProcessing:
      type: object
      properties:
        promptsCount:
          type: integer
        message:
          type: string
      required:
        - promptsCount
        - message
      example:
        promptsCount: 50
        message: Prompts processing started
    PublicApiValidationErrorResponse:
      type: object
      properties:
        message:
          type: string
        target:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
              code:
                type: string
            required:
              - path
              - message
              - code
      required:
        - message
        - target
        - errors
      example:
        message: Validation failed
        target: query
        errors:
          - path: country
            message: Required
            code: invalid_type
    PublicApiErrorResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      example:
        message: Report not found
    PublicApiDuplicatePrompts:
      type: object
      properties:
        message:
          type: string
        duplicatedPrompts:
          type: array
          items:
            type: string
      required:
        - message
        - duplicatedPrompts
      example:
        message: Some of the prompts already exist in the workspace
        duplicatedPrompts:
          - best running shoes
    PublicApiCreatedPrompt:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          example: 01HX7K2YV9D3M8N0G6Q5R4S3T2
        prompt:
          type: string
        country:
          type: string
        tagIds:
          type: array
          items:
            type: string
        brandReportIds:
          type: array
          items:
            type: string
        createdDate:
          type: string
      required:
        - id
        - prompt
        - country
        - tagIds
        - brandReportIds
        - createdDate
      example:
        id: 01HX7K2YV9D3M8N0G6Q5R4S3T2
        prompt: best running shoes
        country: us
        tagIds: []
        brandReportIds: []
        createdDate: '2026-07-14T10:00:00.000Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Provide your API key as a Bearer token: `Authorization: Bearer
        YOUR_API_KEY`.

````