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

# Update a Prompt Payload

> Updates an existing sample payload's variables and/or optional name. Only editors can update.



## OpenAPI

````yaml /openapi.yaml put /v1/prompts/{id}/payloads/{payloadID}
openapi: 3.1.0
info:
  title: px0 API
  description: >
    px[0] is an open-source prompt infrastructure toolkit for managing prompts
    in production. It replaces hardcoded prompt strings with versioned
    templates, in-process caching, and OpenTelemetry observability, so teams can
    iterate on prompts without touching application code. This is the OpenAPI
    specification for all the public APIs of px0.
  version: 1.0.0
servers:
  - url: http://localhost:3000
    description: Local development server
security: []
paths:
  /v1/prompts/{id}/payloads/{payloadID}:
    put:
      tags:
        - Prompt Payloads
      summary: Update a Prompt Payload
      description: >-
        Updates an existing sample payload's variables and/or optional name.
        Only editors can update.
      operationId: updatePromptPayload
      parameters:
        - name: id
          in: path
          required: true
          description: Unique prompt UUID.
          schema:
            type: string
            format: uuid
        - name: payloadID
          in: path
          required: true
          description: Unique payload UUID.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePromptPayloadRequest'
      responses:
        '200':
          description: Prompt payload updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  payload:
                    $ref: '#/components/schemas/PromptPayload'
                required:
                  - payload
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '404':
          description: Prompt or payload not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdatePromptPayloadRequest:
      type: object
      properties:
        name:
          type: string
          description: Optional name for this sample payload.
          example: Admin Sample
        variables:
          type: object
          description: JSON object containing variable names and sample values.
          example:
            user: Alice
            role: Editor
    PromptPayload:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique payload identifier.
        prompt_id:
          type: string
          format: uuid
          description: Reference to parent Prompt ID.
        name:
          type: string
          nullable: true
          description: Optional name for this sample payload.
        variables:
          type: object
          description: Standard JSON object containing variable names and sample values.
          example:
            user: Arpit
            role: Admin
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - prompt_id
        - variables
        - created_at
        - updated_at
    APIError:
      type: object
      properties:
        error:
          type: string
          example: invalid credentials
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use an access token retrieved from login (Bearer sess_...) or a
        programmatic API key (Bearer ak_...).

````