> ## 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.

# Update prompts

> Update one or more existing prompts. Only provided fields are changed. Dimension fields (regions, platforms, personas, tags) replace the full set when provided. Use dry_run to preview without persisting.



## OpenAPI

````yaml https://registry.scalar.com/@profound/apis/external-api/latest/openapi.json?variant=processed patch /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:
    patch:
      tags:
        - Organization
        - Categories
      summary: Update prompts
      description: >-
        Update one or more existing prompts. Only provided fields are changed.
        Dimension fields (regions, platforms, personas, tags) replace the full
        set when provided. Use dry_run to preview without persisting.
      operationId: update_category_prompts_v1_org_categories__category_id__prompts_patch
      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/UpdatePromptsBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePromptsResponse'
        '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.update_prompts(
                category_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
                prompts=[{"id": ""}],
                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.updatePrompts('7c9e6679-7425-40de-944b-e07fc1f90ae7',
            {
              prompts: [
                {
                  id: '',
                },
              ],
              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()
                    .update_prompts(
                        "7c9e6679-7425-40de-944b-e07fc1f90ae7",
                        UpdatePromptsBody {
                            prompts: vec![UpdatePromptInput {
                                id: "".to_string(),
                                prompt: None,
                                topic: None,
                                language: None,
                                tags: None,
                                regions: None,
                                platforms: None,
                                personas: None,
                                analysis_types: None,
                                prompt_type: None,
                                asset: None,
                            }],
                            dry_run: None,
                        },
                    )
                    .send()
                    .await?;

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

                Ok(())
            }
components:
  schemas:
    UpdatePromptsBody:
      properties:
        prompts:
          items:
            $ref: '#/components/schemas/UpdatePromptInput'
          type: array
          title: Prompts
          description: >-
            List of prompt updates. Each entry must include an `id` and at least
            one field to change.
        dry_run:
          type: boolean
          title: Dry Run
          description: When true, validate and preview changes without persisting them.
          default: false
      type: object
      required:
        - prompts
      title: UpdatePromptsBody
    UpdatePromptsResponse:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
          description: Whether this was a dry run (no changes persisted).
        updated:
          type: integer
          title: Updated
          description: Number of prompts that had changes.
          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/PromptUpdatePreview'
          type: array
          title: Prompts
          description: List of prompts with their change diffs.
          default: []
      type: object
      required:
        - dry_run
      title: UpdatePromptsResponse
      description: Response from updating prompts.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UpdatePromptInput:
      properties:
        id:
          type: string
          title: Id
          description: ID of the prompt to update.
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
          description: New prompt text.
        topic:
          anyOf:
            - $ref: '#/components/schemas/IdOrName'
            - type: 'null'
          description: New topic. A new topic is created if the name doesn't exist.
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
          description: New language code. Must be enabled for the organization.
        tags:
          anyOf:
            - items:
                $ref: '#/components/schemas/IdOrName'
              type: array
            - type: 'null'
          title: Tags
          description: New tag set. Replaces all existing tags on the prompt.
        regions:
          anyOf:
            - items:
                $ref: '#/components/schemas/IdOrName'
              type: array
            - type: 'null'
          title: Regions
          description: New region set. Replaces all existing regions.
        platforms:
          anyOf:
            - items:
                $ref: '#/components/schemas/IdOrName'
              type: array
            - type: 'null'
          title: Platforms
          description: New platform set. Replaces all existing platforms.
        personas:
          anyOf:
            - items:
                $ref: '#/components/schemas/IdOrName'
              type: array
            - type: 'null'
          title: Personas
          description: New persona set. Replaces all existing personas.
        analysis_types:
          anyOf:
            - items:
                type: string
                enum:
                  - visibility
                  - sentiment
                  - sentiment_v2
                  - accuracy
              type: array
            - type: 'null'
          title: Analysis Types
          description: >-
            New analysis types. Replaces all existing analysis types on the
            prompt.
        prompt_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt Type
          description: Deprecated. Use analysis_types instead.
          deprecated: true
        asset:
          anyOf:
            - $ref: '#/components/schemas/IdOrName'
            - type: 'null'
          description: Asset reference. Required when analysis_types includes 'sentiment'.
      type: object
      required:
        - id
      title: UpdatePromptInput
      description: >-
        Fields to update on an existing prompt. Only provided fields are
        changed; omitted fields are left unchanged.
    PromptUpdatePreview:
      properties:
        id:
          type: string
          title: Id
          description: ID of the updated prompt.
        prompt:
          anyOf:
            - $ref: '#/components/schemas/FieldDiff'
            - type: 'null'
          description: Prompt text diff.
        topic:
          anyOf:
            - $ref: '#/components/schemas/FieldDiff'
            - type: 'null'
          description: Topic diff.
        language:
          anyOf:
            - $ref: '#/components/schemas/FieldDiff'
            - type: 'null'
          description: Language diff.
        tags:
          anyOf:
            - $ref: '#/components/schemas/NamedResourceDiffList'
            - type: 'null'
          description: Tags added and removed.
        regions:
          anyOf:
            - $ref: '#/components/schemas/NamedResourceDiffList'
            - type: 'null'
          description: Regions added and removed.
        platforms:
          anyOf:
            - $ref: '#/components/schemas/NamedResourceDiffList'
            - type: 'null'
          description: Platforms added and removed.
        personas:
          anyOf:
            - $ref: '#/components/schemas/NamedResourceDiffList'
            - type: 'null'
          description: Personas added and removed.
        analysis_types:
          anyOf:
            - $ref: '#/components/schemas/FieldDiff'
            - type: 'null'
          description: Analysis types diff.
        asset:
          anyOf:
            - $ref: '#/components/schemas/FieldDiff'
            - type: 'null'
          description: Asset diff.
      type: object
      required:
        - id
      title: PromptUpdatePreview
      description: >-
        Preview of changes applied (or to be applied) to a single prompt. Only
        changed fields are included.
    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.
    FieldDiff:
      properties:
        old:
          title: Old
          description: Previous value.
        new:
          title: New
          description: New value.
      type: object
      title: FieldDiff
      description: Shows the old and new value for a changed field.
    NamedResourceDiffList:
      properties:
        added:
          items:
            $ref: '#/components/schemas/NamedResource'
          type: array
          title: Added
          description: Resources that were added.
          default: []
        removed:
          items:
            $ref: '#/components/schemas/NamedResource'
          type: array
          title: Removed
          description: Resources that were removed.
          default: []
      type: object
      title: NamedResourceDiffList
      description: Shows which resources were added or removed.
    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

````