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

# Update versioned prompt

> Updates a versioned prompt for a given agent.



## OpenAPI

````yaml put /agents/{agentId}/versioned_prompts/{id}
openapi: 3.0.3
info:
  title: Vogent - OpenAPI 3.0
  description: Test Description
  version: 1.0.11
servers:
  - url: https://api.vogent.ai/api
security:
  - bearerAuth: []
paths:
  /agents/{agentId}/versioned_prompts/{id}:
    parameters:
      - in: path
        name: agentId
        schema:
          type: string
        required: true
        description: ID of the agent.
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: ID of the versioned prompt.
    put:
      summary: Update versioned prompt
      description: Updates a versioned prompt for a given agent.
      operationId: updateAgentVersionedPrompt
      requestBody:
        description: Updates a versioned prompt
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVersionedPromptInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionedPrompt'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
components:
  schemas:
    UpdateVersionedPromptInput:
      type: object
      properties:
        aiModelId:
          type: string
          description: The ID of the model to use.
          nullable: false
        agentType:
          $ref: '#/components/schemas/AgentType'
          description: The type of agent that this prompt represents.
          nullable: false
        prompt:
          type: string
          nullable: false
        flowDefinition:
          $ref: '#/components/schemas/FlowDefinitionInput'
          description: >-
            For agents with agentType CUSTOM_FLOW, the flow definition that you
            want to use.
          nullable: false
        name:
          type: string
          nullable: false
        modelOptionValues:
          x-go-type-skip-optional-pointer: true
          type: array
          items:
            $ref: '#/components/schemas/ModelOptionValue'
    VersionedPrompt:
      type: object
      properties:
        id:
          type: string
          nullable: false
          description: Unique identifier for the versioned prompt
        name:
          type: string
          nullable: false
          description: Human-readable name for the versioned prompt
        agentType:
          $ref: '#/components/schemas/AgentType'
          description: >-
            The type of agent this prompt is designed for (STANDARD or
            CUSTOM_FLOW)
        prompt:
          type: string
          nullable: true
          description: >-
            The actual prompt content that will be used by the agent. Can be
            null for CUSTOM_FLOW agent types
        flowDefinition:
          $ref: '#/components/schemas/FlowDefinition'
          nullable: true
          description: >-
            The flow definition for the agent. Only defined for CUSTOM_FLOW
            agent types.
        aiModelId:
          type: string
          description: The AI model ID to use for the agent.
        modelOptionValues:
          x-go-type-skip-optional-pointer: true
          type: array
          items:
            $ref: '#/components/schemas/ModelOptionValue'
      required:
        - id
        - name
        - agentType
        - prompt
    AgentType:
      type: string
      enum:
        - STANDARD
        - CUSTOM_FLOW
    FlowDefinitionInput:
      type: object
      properties:
        nodes:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ApiFlowNodeInput'
          nullable: false
        globalContext:
          type: string
          nullable: true
        aiOpen:
          type: boolean
          nullable: false
          description: Deprecated, use openingLineType instead.
        openingLineType:
          $ref: '#/components/schemas/OpeningLineType'
          nullable: false
    ModelOptionValue:
      type: object
      description: >-
        A configuration value for the model. You can get a list of available
        models and their configuration values from /models. All configuration
        values, with defaults will be returned when you retrieve a versioned
        prompt.
      properties:
        optionId:
          type: string
          description: The ID of option.
          nullable: false
        value:
          type: string
          nullable: false
      required:
        - optionId
        - value
    FlowDefinition:
      type: object
      properties:
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/ApiFlowNode'
          nullable: false
        globalContext:
          type: string
          nullable: true
        aiOpen:
          type: boolean
          nullable: false
          description: Deprecated, use openingLineType instead.
        openingLineType:
          $ref: '#/components/schemas/OpeningLineType'
          nullable: false
      required:
        - nodes
        - globalContext
        - aiOpen
        - openingLineType
    ApiFlowNodeInput:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
          description: >-
            One of the allowed flow node types. View the available types at
            https://docs.vogent.ai/flow.
        type:
          type: string
          nullable: false
        transitionRules:
          type: array
          items:
            $ref: '#/components/schemas/FlowTransitionRuleInput'
          nullable: false
        nodeData:
          type: object
          nullable: false
          description: >-
            The node-specific configuration. View the configurations by node
            type at https://docs.vogent.ai/flow.
      required:
        - id
        - name
        - type
        - transitionRules
        - nodeData
    OpeningLineType:
      type: string
      enum:
        - INBOUND_ONLY
        - INBOUND_OUTBOUND
        - NONE
    ApiFlowNode:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
        type:
          type: string
          nullable: false
          description: >-
            The node type. View the available types at
            https://docs.vogent.ai/flow.
        transitionRules:
          type: array
          items:
            $ref: '#/components/schemas/FlowTransitionRule'
          nullable: false
          x-go-type-skip-optional-pointer: true
        outputSchema:
          type: string
          nullable: true
          description: >-
            The JSON schema describing the output of this node. This is
            generated automatically from the node type and node data.
        nodeData:
          type: object
          nullable: false
          description: >-
            The node-specific configuration. View the schemas by type at
            https://docs.vogent.ai/flow.
      required:
        - id
        - name
        - type
        - transitionRules
        - nodeData
    FlowTransitionRuleInput:
      type: object
      properties:
        conditionType:
          $ref: '#/components/schemas/FlowTransitionRuleConditionType'
          nullable: false
        arrayConditionType:
          $ref: '#/components/schemas/ArrayConditionType'
        field:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
        values:
          type: array
          items:
            type: string
          nullable: true
          x-go-type-skip-optional-pointer: true
        transitionNodeId:
          type: string
          nullable: false
      required:
        - conditionType
        - transitionNodeId
    FlowTransitionRule:
      type: object
      properties:
        conditionType:
          $ref: '#/components/schemas/FlowTransitionRuleConditionType'
        arrayConditionType:
          $ref: '#/components/schemas/ArrayConditionType'
        field:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
        values:
          type: array
          items:
            type: string
          nullable: true
          x-go-type-skip-optional-pointer: true
        transitionNodeId:
          type: string
          nullable: false
      required:
        - conditionType
        - transitionNodeId
    FlowTransitionRuleConditionType:
      type: string
      enum:
        - always
        - equal
        - in
        - greater
        - less
        - language
      description: >-
        The condition used to evaluate the transition rule. If language, the
        value will be used as a natural language condition to describe when to
        execute a transition.
      nullable: false
    ArrayConditionType:
      type: string
      enum:
        - any
        - all
      description: >-
        The type of array condition to apply. 'any' means at least one element
        must match, 'all' means all elements must match.
      nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        In the form `Bearer <api_key_here>`. You can find your api key in your
        dashboard.

````