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

# Re-word a prompt

> Prompt text never changes, so a re-wording is a new prompt that replaces the old one, which is retired. Wording the project already has (archived and replaced prompts included) is 409 with detail.existing_prompt_id.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{projectId}/prompts/{promptId}/replace
openapi: 3.1.0
info:
  title: Citino API
  version: v1
  description: >-
    Read how AI engines answer your market's questions, and keep your prompts,
    competitors, segments and engines in step from code. Every number carries
    its band and sample size.
servers:
  - url: https://api.citino.ai/v1
security:
  - bearerAuth: []
tags:
  - name: Brand and competitors
  - name: Definitions
  - name: Engines
  - name: Projects
  - name: Alerts
  - name: Attribution
  - name: Claims
  - name: Crawlability
  - name: Crawler activity
  - name: Metrics
  - name: Experiments
  - name: Prompts
  - name: Objections
  - name: Monthly reports
  - name: Reports
  - name: Runs
  - name: Searches
  - name: Sources
  - name: Work items
  - name: Settings
paths:
  /projects/{projectId}/prompts/{promptId}/replace:
    post:
      tags:
        - Prompts
      summary: Re-word a prompt
      description: >-
        Prompt text never changes, so a re-wording is a new prompt that replaces
        the old one, which is retired. Wording the project already has (archived
        and replaced prompts included) is 409 with detail.existing_prompt_id.
      operationId: postProjectsByProjectIdPromptsByPromptIdReplace
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
        - name: promptId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  minLength: 1
                  maxLength: 300
              required:
                - text
              additionalProperties: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  prompt_id:
                    type: string
                  replaces_id:
                    type: string
                  scope:
                    type: string
                required:
                  - prompt_id
                  - replaces_id
                  - scope
                additionalProperties: false
              example:
                prompt_id: '00000000000000000000000001'
                replaces_id: p_acme_001
                scope: category
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  prompt_id:
                    type: string
                  replaces_id:
                    type: string
                  scope:
                    type: string
                required:
                  - prompt_id
                  - replaces_id
                  - scope
                additionalProperties: false
        '400':
          description: The request is invalid; `error.field` names the parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 'No live API key in an `Authorization: Bearer` header.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key lacks the scope named in the message, or cannot write.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such resource in this key's projects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Over the key's or the workspace's rate limit; see `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Busy or timed out; retry after `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: bash
          label: curl
          source: >-
            curl -X POST
            "https://api.citino.ai/v1/projects/{projectId}/prompts/{promptId}/replace"
            \
              -H "Authorization: Bearer $CITINO_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{"text":"string"}'
        - lang: python
          label: Python
          source: |-
            import os
            import requests

            res = requests.post(
                "https://api.citino.ai/v1/projects/{projectId}/prompts/{promptId}/replace",
                headers={"Authorization": f"Bearer {os.environ['CITINO_API_KEY']}"},
                json={
                  "text": "string"
                },
            )
            print(res.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const res = await
            fetch("https://api.citino.ai/v1/projects/{projectId}/prompts/{promptId}/replace",
            {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.CITINO_API_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "text": "string"
              }),
            });

            console.log(await res.json());
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: >-
                validation, unauthorized, forbidden, not_found, conflict,
                plan_limit, rate_limited, busy, query_timeout
            message:
              type: string
            field:
              type: string
            detail:
              type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key from Workspace settings → API keys, sent as `Authorization:
        Bearer <key>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.