# User

> The user an API key or access token acts as, and the workspaces they belong to.

Part of the [Prosaic API reference](https://developer.prosaic.works/docs/api.md). Base URL: `https://app.prosaic.works/api/public/v1`. Authenticate with `Authorization: Bearer <API key or access token>`.

## Get current user information

`GET /api/public/v1/me`

SDK: `prosaic.me.retrieve()`

Returns the authenticated user's information including their workspaces
and whether they have connected bank accounts.

This endpoint is intended for the Expenses app to determine:
- User type (accountant vs individual) based on workspace roles
- Whether to prompt for bank account connection
- Which workspaces/clients the user has access to

### Responses

- `200`: Successful response
  - `data` (object, required)
    - `id` (string, required)
    - `email` (string, required)
    - `name` (string, nullable, required)
    - `workspaces` (array of objects, required)
      - `id` (string, required)
      - `name` (string, required)
      - `role` (string, required): One of: `client`, `standard_user`, `admin`, `accountant`, `advisor`, `workspace_owner`.
      - `subscriptionState` (string, required)
    - `hasConnectedBankAccounts` (boolean, required)
  - `meta` (object)
    - `count` (number, required)
- `401`: Unauthorized - Invalid or missing API key/token
  - `error` (string)
- `404`: User not found
  - `error` (string)
  - `code` (string)
- `500`: Internal server error
  - `error` (string)
  - `code` (string)

### Example (Node SDK)

```ts
const { data } = await prosaic.me.retrieve();
```

### Example (curl)

```bash
curl https://app.prosaic.works/api/public/v1/me \
  -H "Authorization: Bearer $PROSAIC_API_KEY"
```