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

# Patch Agent



## OpenAPI

````yaml https://api.julep.ai/api/openapi.json patch /agents/{agent_id}
openapi: 3.1.0
info:
  title: Julep Agents API
  description: API for Julep Agents
  termsOfService: https://www.julep.ai/terms
  contact:
    name: Julep
    url: https://www.julep.ai/
    email: developers@julep.ai
  version: 0.4.0
servers:
  - url: /api
security: []
paths:
  /agents/{agent_id}:
    patch:
      tags:
        - agents
      summary: Patch Agent
      operationId: patch_agent_agents__agent_id__patch
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchAgentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PatchAgentRequest:
      properties:
        metadata:
          anyOf:
            - type: object
            - type: 'null'
          title: Metadata
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        project:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
              pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
            - type: 'null'
          title: Project
        canonical_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
              pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
            - type: 'null'
          title: Canonical Name
        about:
          type: string
          title: About
          default: ''
        model:
          type: string
          title: Model
          default: ''
        instructions:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
          title: Instructions
          default: []
        default_settings:
          anyOf:
            - type: object
            - type: 'null'
          title: Default Settings
        default_system_template:
          type: string
          title: Default System Template
          default: |-
            {%- if agent.name -%}
            You are {{agent.name}}.{{" "}}
            {%- endif -%}

            {%- if agent.about -%}
            About you: {{agent.about}}.{{" "}}
            {%- endif -%}

            {%- if user -%}
            You are talking to a user
              {%- if user.name -%}{{" "}} and their name is {{user.name}}
                {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}
              {%- endif -%}
            {%- endif -%}

            {{NEWLINE}}

            {%- if session.situation -%}
            Situation: {{session.situation}}
            {%- endif -%}

            {{NEWLINE+NEWLINE}}

            {%- if agent.instructions -%}
            Instructions:{{NEWLINE}}
              {%- if agent.instructions is string -%}
                {{agent.instructions}}{{NEWLINE}}
              {%- else -%}
                {%- for instruction in agent.instructions -%}
                  - {{instruction}}{{NEWLINE}}
                {%- endfor -%}
              {%- endif -%}
              {{NEWLINE}}
            {%- endif -%}

            {%- if docs -%}
            Relevant documents:{{NEWLINE}}
              {%- for doc in docs -%}
                {{doc.title}}{{NEWLINE}}
                {%- if doc.content is string -%}
                  {{doc.content}}{{NEWLINE}}
                {%- else -%}
                  {%- for snippet in doc.content -%}
                    {{snippet}}{{NEWLINE}}
                  {%- endfor -%}
                {%- endif -%}
                {{"---"}}
              {%- endfor -%}
            {%- endif -%}
      type: object
      title: PatchAgentRequest
      description: Payload for patching a agent
    Agent:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          readOnly: true
        metadata:
          anyOf:
            - type: object
            - type: 'null'
          title: Metadata
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated At
          readOnly: true
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        project:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
              pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
            - type: 'null'
          title: Project
        canonical_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
              pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
            - type: 'null'
          title: Canonical Name
        about:
          type: string
          title: About
          default: ''
        model:
          type: string
          title: Model
          default: ''
        instructions:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
          title: Instructions
          default: []
        default_settings:
          anyOf:
            - type: object
            - type: 'null'
          title: Default Settings
        default_system_template:
          type: string
          title: Default System Template
          default: |-
            {%- if agent.name -%}
            You are {{agent.name}}.{{" "}}
            {%- endif -%}

            {%- if agent.about -%}
            About you: {{agent.about}}.{{" "}}
            {%- endif -%}

            {%- if user -%}
            You are talking to a user
              {%- if user.name -%}{{" "}} and their name is {{user.name}}
                {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}
              {%- endif -%}
            {%- endif -%}

            {{NEWLINE}}

            {%- if session.situation -%}
            Situation: {{session.situation}}
            {%- endif -%}

            {{NEWLINE+NEWLINE}}

            {%- if agent.instructions -%}
            Instructions:{{NEWLINE}}
              {%- if agent.instructions is string -%}
                {{agent.instructions}}{{NEWLINE}}
              {%- else -%}
                {%- for instruction in agent.instructions -%}
                  - {{instruction}}{{NEWLINE}}
                {%- endfor -%}
              {%- endif -%}
              {{NEWLINE}}
            {%- endif -%}

            {%- if docs -%}
            Relevant documents:{{NEWLINE}}
              {%- for doc in docs -%}
                {{doc.title}}{{NEWLINE}}
                {%- if doc.content is string -%}
                  {{doc.content}}{{NEWLINE}}
                {%- else -%}
                  {%- for snippet in doc.content -%}
                    {{snippet}}{{NEWLINE}}
                  {%- endfor -%}
                {%- endif -%}
                {{"---"}}
              {%- endfor -%}
            {%- endif -%}
      type: object
      required:
        - id
        - created_at
        - updated_at
        - name
      title: Agent
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization

````