---
title: "Update Agent"
method: PUT
path: "/api/v1/agents/{id}"
tags: ["Agents"]
---

# Update Agent

`PUT /api/v1/agents/{id}`

## Path parameters

- `id` string, required

## Request body

- AgentRequest
  - `first_name` string, required — Agent's first name
  - `last_name` string — Agent's last name
  - `email` string, email, required — Agent's email address
  - `roles` string[], required — Roles assigned to the agent
  - `send_welcome_email` boolean — Only used during agent creation to send welcome email
  - `teams` string[] — Team IDs to assign agent to
  - `enabled` boolean — Whether agent is enabled
  - `availability_status` 'online' | 'away' | 'away_manual' | 'offline' | 'away_and_reassigning' — Agent's availability status
  - `new_password` string — Agent's new password, Optional

## Response `200`

Agent updated successfully

- AgentResponse
  - `status` string
  - `data` Agent
    - `id` integer
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `first_name` string
    - `last_name` string
    - `email` string, email, nullable
    - `type` string
    - `availability_status` string
    - `phone_number_country_code` string, nullable
    - `phone_number` string, nullable
    - `avatar_url` string, nullable
    - `enabled` boolean
    - `last_active_at` string, date-time, nullable
    - `last_login_at` string, date-time, nullable
    - `roles` string[]
    - `permissions` string[]
    - `custom_attributes` object
    - `teams` TeamCompact[]
      - `id` integer
      - `name` string
      - `emoji` string, nullable
    - `api_key` string, nullable
    - `api_key_last_used_at` string, date-time, nullable

## Other responses

- `401` — Unauthorized
- `500` — Internal server error

---

[API](https://skmtc.dev/libredesk/apis/libredesk-api.md) · [All operations](https://skmtc.dev/libredesk/apis/libredesk-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/libredesk/libredesk-api/revisions/71ee25a0b5df/schema)
