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

# GET & PATCH /v1/accounts/me — Your Account Profile

> Retrieve or update your account profile. GET returns name, email, phone, dob, avatarUrl, and kycStatus. PATCH updates any writable field you include.

Use these two endpoints to read and update the authenticated user's account profile. The GET endpoint returns a focused set of fields suited to account dashboards. The PATCH endpoint accepts any combination of the writable fields — only fields you include are updated.

## GET /v1/accounts/me

Fetch the current account profile.

**GET** `/v1/accounts/me`

Requires a Bearer token in the `Authorization` header.

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://api.nyotaimara.com/v1/accounts/me" \
    --header "Authorization: Bearer <token>"
  ```
</CodeGroup>

### Response

<ResponseField name="success" type="boolean" required>
  `true` when the request succeeded.
</ResponseField>

<ResponseField name="data" type="object" required>
  The account profile.

  <Expandable title="properties">
    <ResponseField name="name" type="string">
      Full name derived by concatenating `firstName` and `lastName`.
    </ResponseField>

    <ResponseField name="email" type="string" required>
      The user's email address.
    </ResponseField>

    <ResponseField name="avatarUrl" type="string">
      Public URL of the profile photo.
    </ResponseField>

    <ResponseField name="phone" type="string">
      Phone number, if set.
    </ResponseField>

    <ResponseField name="dob" type="string">
      Date of birth in `YYYY-MM-DD` format.
    </ResponseField>

    <ResponseField name="kycStatus" type="string" required>
      Identity verification status. One of `unverified`, `pending`, `verified`, or `rejected`.
    </ResponseField>
  </Expandable>
</ResponseField>

```json theme={null}
{
  "success": true,
  "data": {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "avatarUrl": "https://cdn.nyotaimara.com/avatars/user-1714000000000-abc123.jpg",
    "phone": "+254700000000",
    "dob": "1990-05-14",
    "kycStatus": "verified"
  }
}
```

***

## PATCH /v1/accounts/me

Update one or more profile fields.

**PATCH** `/v1/accounts/me`

Requires a Bearer token in the `Authorization` header.

### Request

All fields are optional. At least one field must be provided.

<ParamField body="firstName" type="string">
  Updated given name.
</ParamField>

<ParamField body="lastName" type="string">
  Updated family name.
</ParamField>

<ParamField body="phone" type="string">
  Updated phone number.
</ParamField>

<ParamField body="dob" type="string">
  Updated date of birth. Accepts any value parseable by `new Date()`, e.g. `"1990-05-14"`.
</ParamField>

<ParamField body="avatarUrl" type="string">
  Public CDN URL of a newly uploaded avatar. Obtain this URL from `POST /v1/auth/avatar` first.
</ParamField>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url "https://api.nyotaimara.com/v1/accounts/me" \
    --header "Authorization: Bearer <token>" \
    --header "Content-Type: application/json" \
    --data '{"firstName": "Jane", "phone": "+254711111111"}'
  ```
</CodeGroup>

### Response

<ResponseField name="success" type="boolean" required>
  `true` when the update was applied.
</ResponseField>

<ResponseField name="message" type="string" required>
  Human-readable confirmation message.
</ResponseField>

```json theme={null}
{
  "success": true,
  "message": "Profile updated successfully"
}
```

<Note>
  **Error cases**

  | Status | Error                                 | Description                                                  |
  | ------ | ------------------------------------- | ------------------------------------------------------------ |
  | 400    | `No valid fields provided for update` | The request body contained no recognised fields.             |
  | 401    | —                                     | Missing or invalid Bearer token.                             |
  | 404    | `Profile not found`                   | No user record exists for the authenticated user (GET only). |
  | 500    | `Failed to fetch/update profile`      | An unexpected server-side error occurred.                    |
</Note>
