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

# Update a User — Shilo API Reference

> Update a user's name, timezone, picture, or external ID in Shilo. Use the Shilo UUID or external_user_id to identify the user. Requires a write key.

Use this endpoint to update an agent's profile fields in Shilo. All body fields are optional — you only need to include the fields you want to change. You can identify the user by their Shilo UUID or your external user ID. This endpoint requires a **write-enabled** API key — read-only keys will receive a `403` response.

## Endpoint

```
PUT https://api.shilo.ai/api/v1/users/{identifier}
```

## Authentication

Include your write-enabled API key in the request header:

```
x-api-key: YOUR_API_KEY
```

## Path Parameters

<ParamField path="identifier" type="string" required>
  The identifier used to look up the user. Three formats are supported:

  | Format              | Example                                   |
  | ------------------- | ----------------------------------------- |
  | Plain Shilo UUID    | `ee6f2136-b94a-4438-9335-3acf5b2a0d31`    |
  | Prefixed Shilo UUID | `id:ee6f2136-b94a-4438-9335-3acf5b2a0d31` |
  | External user ID    | `external_user_id:agent-1`                |
</ParamField>

## Request Body

All fields are optional. Submit only the fields you want to update.

<ParamField body="name" type="string">
  Updated full display name for the user.
</ParamField>

<ParamField body="external_user_id" type="string">
  Updated ID from your external system. Use this to re-map a Shilo user to a new external identifier.
</ParamField>

<ParamField body="timezone" type="string">
  Updated timezone for the user in IANA format (e.g. `America/Chicago`).
</ParamField>

<ParamField body="picture" type="string">
  Updated URL for the user's profile picture.
</ParamField>

## Response

A successful request returns HTTP `200` with the full updated User object.

### Response Fields

<ResponseField name="id" type="string">
  The Shilo-assigned UUID for this user.
</ResponseField>

<ResponseField name="external_user_id" type="string">
  The user's external system ID.
</ResponseField>

<ResponseField name="name" type="string">
  Full display name of the user.
</ResponseField>

<ResponseField name="email" type="string">
  Primary email address of the user.
</ResponseField>

<ResponseField name="timezone" type="string">
  The user's configured timezone.
</ResponseField>

<ResponseField name="picture" type="string">
  URL of the user's profile picture.
</ResponseField>

<ResponseField name="created_date" type="string">
  ISO-8601 timestamp indicating when this user was created in Shilo.
</ResponseField>

### Example Response

```json theme={null}
{
  "id": "ee6f2136-b94a-4438-9335-3acf5b2a0d31",
  "external_user_id": "agent-1",
  "name": "Alex User",
  "email": "alex@example.com",
  "timezone": "America/Chicago",
  "picture": "https://cdn.shilo.ai/avatars/ee6f2136.png",
  "created_date": "2024-01-15T09:00:00Z"
}
```

## Error Codes

| Status | Meaning                                                     |
| ------ | ----------------------------------------------------------- |
| `400`  | Invalid request body or malformed identifier.               |
| `403`  | Your API key is read-only. A write-enabled key is required. |

## Example Request

```bash theme={null}
curl -X PUT "https://api.shilo.ai/api/v1/users/external_user_id:agent-1" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alex User",
    "timezone": "America/Chicago",
    "picture": "https://cdn.shilo.ai/avatars/ee6f2136.png"
  }'
```
