Source: https://datafa.st/docs/api/account/account/update
Markdown source: https://datafa.st/docs/api/account/account/update.md
Description: Update the authenticated account name.

# Update account

`PUT https://datafa.st/api/v1/admin/account`

Update the authenticated account display name. This is the only account-level field exposed by the API — email and billing are managed in the dashboard.

Requires `analytics:read` permission (as implemented).

## Request

#### Body parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | Account display name only — email and avatar are not updatable here. Example: `"Jane Doe"`. Required, non-empty, max 100 chars. |

#### Example request body

```json
{
  "name": "Jane Doe"
}
```

## Response

Returns a JSON object with `status: "success"` and endpoint-specific fields in `data`.

#### Response fields

| Field | Type | Description |
| --- | --- | --- |
| `data[]._id` | string | User ObjectId. |
| `data[].name` | string | Human-readable name for the resource or event. The exact meaning depends on the endpoint. |
| `data[].email` | string | Account email. |
| `data[].image` | string\|null | Profile image URL. |

### Authentication

Use a `dft_` account token with `analytics:read`.

### Errors

**400** — Missing `name`, empty name, or name longer than 100 characters.

See [API errors](/docs/api#errors) for the standard error envelope, auth failures, validation errors, permission errors, and rate limits.

## Code examples

### Example request

```bash
curl -X PUT "https://datafa.st/api/v1/admin/account" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"Jane Doe"}'
```

### Success response

```json
{
  "status": "success",
  "data": [{
    "_id": "665f0b3c4d2e1a0012345678",
    "name": "Jane Doe",
    "email": "jane@example.com",
    "image": "https://example.com/avatar.png"
  }]
}
```
