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

# Create prompts

> Create one or more prompts in a category. Topics and tags are auto-created if referenced by name and not yet existing. Use dry_run to preview without persisting.



## OpenAPI

````yaml https://registry.scalar.com/@profound/apis/external-api/latest/openapi.json?variant=processed post /v1/org/categories/{category_id}/prompts
openapi: 3.1.0
info:
  title: External API
  version: 0.60.2
  x-scalar-sdk-installation:
    - lang: Python
      description: |-
        ```sh
        pip install profound
        ```
    - lang: TypeScript
      description: |-
        ```sh
        npm install @profoundai/client
        ```
    - lang: Rust
      description: |-
        ```sh
        cargo add profound
        ```
servers:
  - url: https://api.tryprofound.com
    description: Production Server
security:
  - APIKeyHeader:
      - X-API-Key
  - BearerAuth: []
paths:
  /v1/org/categories/{category_id}/prompts:
    post:
      tags:
        - Organization
        - Categories
      summary: Create prompts
      description: >-
        Create one or more prompts in a category. Topics and tags are
        auto-created if referenced by name and not yet existing. Use dry_run to
        preview without persisting.
      operationId: create_category_prompts_v1_org_categories__category_id__prompts_post
      parameters:
        - name: category_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Category Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePromptsBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePromptsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - BearerAuth: []
      x-codeSamples:
        - label: Python
          lang: Python
          source: |-
            import os

            from profound import Profound

            client = Profound(
                api_key=os.environ.get("PROFOUND_API_KEY"),
            )

            category = client.organizations.categories.create_prompts(
                category_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
                prompts=[
                    {"prompt": "x", "topic": {}, "language": "", "tags": [], "regions": [{}], "platforms": [{}], "personas": []}
                ],
                dry_run=False,
            )

            print(category)
        - label: TypeScript
          lang: TypeScript
          source: >-
            import Profound from '@profoundai/client';


            const client = new Profound({
              apiKey: process.env['PROFOUND_API_KEY'], // defaults to the PROFOUND_API_KEY env var
              environment: 'production',
            });


            const category = await
            client.organizations.categories.createPrompts('7c9e6679-7425-40de-944b-e07fc1f90ae7',
            {
              prompts: [
                {
                  prompt: 'x',
                  topic: {},
                  language: '',
                  tags: [],
                  regions: [{}],
                  platforms: [{}],
                  personas: [],
                },
              ],
              dry_run: false,
            });


            console.log(category);
        - label: rust
          lang: rust
          source: |-
            use profound::*;

            #[tokio::main]
            async fn main() -> Result<(), Box<dyn std::error::Error>> {
                let client = ProfoundClient::builder()
                    .api_key(std::env::var("PROFOUND_API_KEY")?)
                    .build()?;

                let response = client
                    .organizations()
                    .categories()
                    .create_prompts(
                        "7c9e6679-7425-40de-944b-e07fc1f90ae7",
                        CreatePromptsBody {
                            prompts: vec![CreatePromptInput {
                                id: None,
                                prompt: "x".to_string(),
                                topic: IdOrName { id: None, name: None },
                                language: "".to_string(),
                                tags: None,
                                regions: vec![IdOrName { id: None, name: None }],
                                platforms: vec![IdOrName { id: None, name: None }],
                                personas: None,
                                analysis_types: None,
                                prompt_type: None,
                                asset: None,
                            }],
                            dry_run: None,
                        },
                    )
                    .send()
                    .await?;

                println!("{:?}", response);

                Ok(())
            }
components:
  schemas:
    CreatePromptsBody:
      properties:
        prompts:
          items:
            $ref: '#/components/schemas/CreatePromptInput'
          type: array
          title: Prompts
          description: List of prompts to create.
        dry_run:
          type: boolean
          title: Dry Run
          description: When true, validate and preview changes without persisting them.
          default: false
      type: object
      required:
        - prompts
      title: CreatePromptsBody
    CreatePromptsResponse:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
          description: Whether this was a dry run (no changes persisted).
        created:
          type: integer
          title: Created
          description: Number of prompts created.
          default: 0
        topics_created:
          type: integer
          title: Topics Created
          description: Number of new topics created.
          default: 0
        tags_created:
          type: integer
          title: Tags Created
          description: Number of new tags created.
          default: 0
        prompts:
          items:
            $ref: '#/components/schemas/PromptPreview'
          type: array
          title: Prompts
          description: List of created (or previewed) prompts with resolved references.
          default: []
      type: object
      required:
        - dry_run
      title: CreatePromptsResponse
      description: Response from creating prompts.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreatePromptInput:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: >-
            Optional client-generated UUID for the prompt. When provided,
            creation is idempotent: retrying a request with the same id will not
            create a duplicate prompt. Omit to have the server generate one
            (non-idempotent).
        prompt:
          type: string
          minLength: 1
          title: Prompt
          description: The prompt text to be sent to AI platforms.
        topic:
          $ref: '#/components/schemas/IdOrName'
          description: Topic to assign. A new topic is created if the name doesn't exist.
        language:
          type: string
          title: Language
          description: Language code (e.g. 'en-US')
        tags:
          items:
            $ref: '#/components/schemas/IdOrName'
          type: array
          title: Tags
          description: Tags to assign. New tags are created if names don't exist.
          default: []
        regions:
          items:
            $ref: '#/components/schemas/IdOrName'
          type: array
          minItems: 1
          title: Regions
          description: Regions where the prompt will be collected.
        platforms:
          items:
            $ref: '#/components/schemas/IdOrName'
          type: array
          minItems: 1
          title: Platforms
          description: AI platforms where the prompt will be collected.
        personas:
          items:
            $ref: '#/components/schemas/IdOrName'
          type: array
          title: Personas
          description: Personas to use when collecting. Omit for default (no persona).
          default: []
        analysis_types:
          anyOf:
            - items:
                type: string
                enum:
                  - visibility
                  - sentiment
                  - sentiment_v2
                  - accuracy
              type: array
            - type: 'null'
          title: Analysis Types
          description: >-
            Analysis types: 'visibility', 'sentiment', 'accuracy'. Defaults to
            ['visibility'].
        prompt_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt Type
          description: Deprecated. Use analysis_types instead. 'Visibility' or 'Sentiment'.
          deprecated: true
        asset:
          anyOf:
            - $ref: '#/components/schemas/IdOrName'
            - type: 'null'
          description: Required for Sentiment prompts. The brand asset to evaluate.
      type: object
      required:
        - prompt
        - topic
        - language
        - regions
        - platforms
      title: CreatePromptInput
      description: A single prompt to create within a category.
    PromptPreview:
      properties:
        id:
          type: string
          title: Id
          description: Generated prompt ID.
        prompt:
          type: string
          title: Prompt
          description: The prompt text.
        topic:
          $ref: '#/components/schemas/NamedResource'
          description: Resolved topic.
        language:
          type: string
          title: Language
          description: Language code.
        tags:
          items:
            $ref: '#/components/schemas/NamedResource'
          type: array
          title: Tags
          description: Resolved tags.
          default: []
        regions:
          items:
            $ref: '#/components/schemas/NamedResource'
          type: array
          title: Regions
          description: Resolved regions.
          default: []
        platforms:
          items:
            $ref: '#/components/schemas/NamedResource'
          type: array
          title: Platforms
          description: Resolved platforms.
          default: []
        personas:
          items:
            $ref: '#/components/schemas/NamedResource'
          type: array
          title: Personas
          description: Resolved personas.
          default: []
        analysis_types:
          items:
            type: string
            enum:
              - visibility
              - sentiment
              - sentiment_v2
              - accuracy
          type: array
          title: Analysis Types
          description: Analysis types assigned to this prompt.
          default: []
        asset:
          anyOf:
            - $ref: '#/components/schemas/NamedResource'
            - type: 'null'
          description: Resolved asset, if applicable.
      type: object
      required:
        - id
        - prompt
        - topic
        - language
      title: PromptPreview
      description: Preview of a prompt that was (or would be) created.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    IdOrName:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: UUID of the resource.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Display name of the resource.
      type: object
      title: IdOrName
      description: |-
        Reference by id, name, or both. Plain strings work too:
        UUIDs become id lookups, other strings become name lookups.
    NamedResource:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: NamedResource
      description: Generic id+name reference used across domain boundaries.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````