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

# Update a user prompt

> Updates editable fields on a prompt the caller owns. Prompt text, name, description, temperature/responseTime, tools and toolConfigs are mutable here; versioning is handled separately via the /versions endpoints.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/prompts/{promptId}
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/prompts/{promptId}:
    put:
      tags:
        - Prompts
      summary: Update a user prompt
      description: >-
        Updates editable fields on a prompt the caller owns. Prompt text, name,
        description, temperature/responseTime, tools and toolConfigs are mutable
        here; versioning is handled separately via the /versions endpoints.
      operationId: put_prompts_by_id
      parameters:
        - in: path
          name: promptId
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptUpdateRequest'
      responses:
        '200':
          description: >-
            Prompt updated successfully (may include a versionSnapshot when a
            checkpoint was captured)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptUpdateResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptErrorResponse'
        '403':
          description: Prompt not found, not owned, hidden, or marketplace-reference
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptErrorResponse'
        '404':
          description: User or prompt not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptErrorResponse'
        '409':
          description: >-
            SMS-approval conflict — agent is currently assigned to SMS
            conversations and newly required tools change its approval surface
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptSmsApprovalConflictResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    PromptUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: Human-readable prompt name shown in pickers and lists.
        prompt:
          type: string
          description: XML prompt body driving the AI agent.
        responseTime:
          type: number
          description: >-
            Target reply latency in seconds; the engine throttles streaming to
            roughly this duration.
        description:
          type: string
          description: >-
            Short summary of the prompt's purpose; surfaced in summary lists and
            pickers.
        temperature:
          type: number
          description: Sampling temperature (0-1). Lower = more deterministic.
        tools:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Enabled tool keys (e.g. `getContact`, `sendSms`, `transfer`).
        toolConfigs:
          type: object
          additionalProperties: true
          description: Per-tool config overrides keyed by tool name.
      additionalProperties: true
      example:
        name: Leasing follow-up assistant (v2)
        prompt: >-
          <prompt><role>Leasing assistant</role><goal>Be friendly, concise, and
          confirm next steps.</goal></prompt>
        description: Refined tone; clearer next-step CTA.
        temperature: 0.6
        responseTime: 30
        tools:
          - name: book_tour
        toolConfigs:
          book_tour:
            requireApproval: true
    PromptUpdateResponse:
      type: object
      description: >-
        `versionSnapshot` is only present when the update created a version
        checkpoint as a side-effect (e.g. autosave thresholds).
      properties:
        message:
          type: string
        prompt:
          $ref: '#/components/schemas/PromptDocument'
        versionSnapshot:
          $ref: '#/components/schemas/PromptVersionSummary'
      required:
        - message
        - prompt
      additionalProperties: true
      example:
        message: Prompt updated successfully
        prompt:
          _id: 64d2f9c5e8a1d4e001a0b1c2
          name: Maple Court — Tour confirm
          prompt: <prompt>updated body</prompt>
          temperature: 0.4
          lastEditedAt: '2026-05-20T15:04:01.135Z'
        versionSnapshot:
          _id: 64d2f9c5e8a1d4e001a0b1d8
          version: 6
          displayVersion: v1.5
          createdAt: '2026-05-20T15:04:01.135Z'
    PromptErrorResponse:
      type: object
      description: Generic error envelope returned by Prompt endpoints.
      properties:
        error:
          type: string
        details:
          type: string
      required:
        - error
      additionalProperties: true
      example:
        error: Prompt not found
        details: No prompt with id 5f7b1c2e8a1d4e0012c3b4a5 belongs to this user.
    PromptSmsApprovalConflictResponse:
      type: object
      description: >-
        409 envelope returned when updating a prompt would change its set of
        approval-required tools while the prompt is bound to active SMS
        conversations. The client surfaces this to ask the user to reassign or
        pick an alternate.
      properties:
        error:
          type: string
        code:
          type: string
          enum:
            - SMS_APPROVAL_CONFLICT
        conflict:
          type: object
          properties:
            promptId:
              type: string
            promptName:
              type: string
            newlyApprovalRequiredTools:
              type: array
              items:
                type: string
            conversationsCount:
              type: integer
            contactsCount:
              type: integer
            hasAlternatives:
              type: boolean
            alternatives:
              type: array
              items:
                $ref: '#/components/schemas/PromptSmsApprovalConflictAlternative'
          required:
            - promptId
            - promptName
            - conversationsCount
            - contactsCount
          additionalProperties: true
      required:
        - error
        - code
        - conflict
      additionalProperties: true
      example:
        error: >-
          This agent is currently assigned to one or more SMS conversations and
          the newly required approval tools would change its surface.
        code: SMS_APPROVAL_CONFLICT
        conflict:
          promptId: 64d2f9c5e8a1d4e001a0b1c2
          promptName: Maple Court — Tour confirm
          newlyApprovalRequiredTools:
            - sendSms
            - transferCall
          conversationsCount: 12
          contactsCount: 9
          hasAlternatives: true
          alternatives:
            - id: 64d2f9c5e8a1d4e001a0b1c3
              name: Maple Court — Tour confirm (no approval)
              description: Variant without approval-required tools.
    PromptDocument:
      type: object
      description: >-
        Prompt document as stored in the Prompt collection. Returned shape
        varies slightly per endpoint (some list/summary endpoints project a
        subset of fields).
      properties:
        _id:
          type: string
        name:
          type: string
        prompt:
          type: string
          description: >-
            Prompt body. Omitted (i.e. stripped) for non-admin callers when
            `isHidden` is true.
        description:
          type: string
        temperature:
          type: number
        responseTime:
          type: number
        isHidden:
          type: boolean
        tools:
          type: array
          items:
            type: object
            additionalProperties: true
        toolConfigs:
          type: object
          additionalProperties: true
        organizationId:
          type: string
        userId:
          type: string
        copiedFrom:
          type: string
          nullable: true
        copiedFromName:
          type: string
          nullable: true
        copiedFromOrg:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 5f7b1c2e8a1d4e0012c3b4a5
        name: Leasing follow-up assistant
        prompt: >-
          <prompt><role>Leasing assistant</role><goal>Re-engage leads 24h after
          their last reply.</goal></prompt>
        description: Follow up with leads 24h after their last response.
        temperature: 0.7
        responseTime: 45
        isHidden: false
        tools:
          - name: book_tour
        toolConfigs:
          book_tour:
            requireApproval: true
        organizationId: 64a1b2c3d4e5f60012345678
        userId: 64a1b2c3d4e5f60012345679
        createdAt: '2026-03-12T14:22:10.000Z'
        updatedAt: '2026-04-22T10:14:00.000Z'
    PromptVersionSummary:
      type: object
      properties:
        _id:
          type: string
        version:
          type: integer
        label:
          type: string
          nullable: true
        displayVersion:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        source:
          type: string
          enum:
            - manual_save
            - ai_apply
            - checkpoint
        createdAt:
          type: string
          format: date-time
        matchesCurrentPrompt:
          type: boolean
        preview:
          type: string
      additionalProperties: true
      example:
        _id: 65f9b1c2e8a1d4e001a0b1c3
        version: 4
        label: Friendlier tone
        displayVersion: v1.3
        title: Tone update
        description: Softened the opening line.
        source: manual_save
        createdAt: '2026-04-22T10:14:00.000Z'
        matchesCurrentPrompt: true
        preview: <prompt><role>Leasing assistant</role>...
    PromptSmsApprovalConflictAlternative:
      type: object
      description: >-
        A suggested alternative prompt the caller can reassign to when an
        SMS-approval conflict blocks the update.
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
      required:
        - id
        - name
      additionalProperties: true
      example:
        id: 64d2f9c5e8a1d4e001a0b1c3
        name: Maple Court — Tour confirm (no approval)
        description: Variant without approval-required tools.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````