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

# Update Procedure Draft

> Create or update user's draft for a procedure



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/convai/agents/{agent_id}/branches/{branch_id}/procedures/{procedure_id}/draft
openapi: 3.1.0
info:
  title: Threetone API Documentation
  description: >-
    This is the documentation for the Threetone API. You can use this API to use
    our service programmatically with API keys sent in the x-api-key header. You
    can create and manage API keys in the dashboard at
    https://threetone.in/app/developers/api-keys.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/convai/agents/{agent_id}/branches/{branch_id}/procedures/{procedure_id}/draft:
    patch:
      tags:
        - Agents Platform
      summary: Update Procedure Draft
      description: Create or update user's draft for a procedure
      operationId: update_procedure_draft_route
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            description: Agent ID to get the procedure draft from
            examples:
              - agent_3701k3ttaq12ewp8b7qv5rfyszkz
            title: Agent Id
          description: Agent ID to get the procedure draft from
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            description: Branch ID to get the procedure draft from
            examples:
              - agtbranch_0901k4aafjxxfxt93gd841r7tv5t
            title: Branch Id
          description: Branch ID to get the procedure draft from
        - name: procedure_id
          in: path
          required: true
          schema:
            type: string
            description: The procedure ID
            examples:
              - agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3
            title: Procedure Id
          description: The procedure ID
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Your API key for programmatic access. Send it in the x-api-key
              header; you can create and manage keys from the Developers page.
            title: X-Api-Key
          description: >-
            Your API key for programmatic access. Send it in the x-api-key
            header; you can create and manage keys from the Developers page.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProcedureDraftRequestModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcedureDraftResponseModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateProcedureDraftRequestModel:
      properties:
        name:
          type: string
          maxLength: 200
          title: Name
          description: Procedure name
        content:
          type: string
          maxLength: 50000
          title: Content
          description: Procedure content
        type:
          $ref: '#/components/schemas/ProcedureType'
          description: Procedure type
        trigger:
          anyOf:
            - type: string
            - type: 'null'
          title: Trigger
          description: >-
            When the agent should use this procedure. Empty string means this is
            a sub-procedure that should only start when another procedure
            references it. If omitted or null, the trigger is derived from the
            content instead. Also accepts `description` as an alias.
      type: object
      required:
        - name
        - content
        - type
      title: UpdateProcedureDraftRequestModel
    ProcedureDraftResponseModel:
      properties:
        procedure_id:
          type: string
          title: Procedure Id
          description: Procedure ID
        name:
          type: string
          maxLength: 200
          title: Name
          description: Procedure name
        content:
          type: string
          maxLength: 50000
          title: Content
          description: Procedure content
        type:
          $ref: '#/components/schemas/ProcedureType'
          description: Procedure type
          default: free_form
        trigger:
          type: string
          title: Trigger
          description: >-
            When the agent should use this procedure. Empty string means this is
            a sub-procedure that should only start when another procedure
            references it.
          default: ''
      type: object
      required:
        - procedure_id
        - name
        - content
      title: ProcedureDraftResponseModel
      example:
        content: |-
          # Customer Support Procedure

          1. Greet the customer...
        name: Customer Support Procedure
        procedure_id: agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3
        trigger: When the customer asks for support
        type: free_form
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProcedureType:
      type: string
      enum:
        - free_form
        - deterministic
      title: ProcedureType
      default: free_form
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````