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

# Update a saved agent

> Changes the fields you send; the rest keep their values. Calls already placed are unchanged.

Key permission: **Read history and place calls**.



## OpenAPI

````yaml /api-reference/openapi.json patch /agents/{id}
openapi: 3.1.0
info:
  title: Lawtte API
  version: 1.0.0
  description: >-
    Read your receptionist's calls, place AI calls, manage saved outbound agents
    and the Do Not Call list. The same rules as the Lawtte connector apply to
    every call.
servers:
  - url: https://www.lawtte.ai/api/v1
security:
  - connectorKey: []
paths:
  /agents/{id}:
    patch:
      tags:
        - Agents
      summary: Update a saved agent
      description: >-
        Changes the fields you send; the rest keep their values. Calls already
        placed are unchanged.


        Key permission: **Read history and place calls**.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The agent's `agent_id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                objective:
                  type: string
                  minLength: 1
                  maxLength: 1000
                  description: >-
                    Use `{{placeholders}}` for per-call details. `{{name}}` and
                    `{{firm}}` are filled in automatically.
                recipient_type:
                  type: string
                  enum:
                    - client
                    - witness
                    - adjuster
                    - business_office
                    - other
                collect:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                    minLength: 1
                    maxLength: 120
                  description: What the agent should find out on each call.
                voicemail:
                  type: string
                  enum:
                    - leave
                    - hang_up
                related_skill:
                  type:
                    - string
                    - 'null'
                  pattern: ^[a-z0-9-]{1,80}$
      responses:
        '200':
          description: The updated agent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: Invalid body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, wrong, revoked or expired key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key doesn't have the permission this endpoint needs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such agent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: More than 120 requests in a minute for this key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: A problem on Lawtte's side. Nothing was changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Agent:
      type: object
      properties:
        agent_id:
          type: string
          format: uuid
        name:
          type: string
        objective:
          type: string
        fields:
          type: array
          items:
            type: string
        recipient_type:
          type: string
        collect:
          type: array
          items:
            type: string
        voicemail:
          type: string
        related_skill:
          type:
            - string
            - 'null'
        last_90_days:
          type: object
          description: Calls, people reached and objectives met. List only.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - insufficient_scope
                - invalid_request
                - not_found
                - rejected
                - rate_limited
                - unavailable
                - internal_error
            message:
              type: string
  securitySchemes:
    connectorKey:
      type: http
      scheme: bearer
      description: >-
        A connector key from **Settings → AI connectors → Connector keys**:
        `Authorization: Bearer lawtte_sk_…`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.