# Get Current User

`GET /gate/whoami` · Identity & Access · Sign-in & Sessions

Returns the identity record of the currently authenticated end-user, including their `eu_`-prefixed ID, email, assigned roles (such as `PROJECT_END_USER`), and group memberships. Requires a valid Gate-issued end-user JWT.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes | The end user. |
| `data.id` | string | yes | The end user's id (`eu_...`). |
| `data.email` | string | yes | The end user's email address. An address given at sign-up is stored in lower case. |
| `data.status` | enum ("active", "locked", "deleted") | yes | The account's status. A successful response always carries `active`: a locked or deleted account cannot sign in. |
| `data.createdAt` | string (date-time) | yes | When the end user signed up. |
| `data.updatedAt` | object | yes | When the account record last changed, or null if it never has. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.lastSigninAt` | object | yes | When the end user last signed in with a password, or null if they never have (for example straight after sign-up). |
| _one of_ | | |  |
| _or_ | | |  |
| `data.roles` | array of string | yes | The end user's platform role. Always `["PROJECT_END_USER"]`. Roles you grant through end-user role grants are not listed here. |
| `data.groups` | array of string | yes | Always an empty array in this response. The end user's group names are carried in the access token's `groups` claim. |
| `meta` | object | yes | Request metadata: cost, timing and the request and trace ids. |


## Errors

| HTTP | Code | When |
|---|---|---|
| 401 | `K9O_SESSION_EXPIRED` | The session token is expired or has been revoked; sign in again to obtain a valid session. |
| 404 | `K9O_END_USER_NOT_FOUND` | The authenticated end-user record could not be found in this project. |

## Code samples

### cURL

```bash
curl -X GET 'https://<org>.api-<region>.k9o.io/@storefront/gate/whoami' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/gate/whoami', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.gate.whoami()
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.gate.whoami()
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.Gate.Whoami(ctx)
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.gate.whoami().await?
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.gate().whoami()
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.Gate.WhoamiAsync()
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.gate.whoami()
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->gate->whoami()
```

### K9o

```swift
// let k9o = try K9o.createClient(orgSlug: "playground", projectSlug: "storefront", apiKey: "k9o_…")
let result = try await k9o.gate.whoami()
```

### core-kotlin

```kotlin
// val k9o = createClient { orgSlug = "playground"; projectSlug = "storefront"; apiKey = "k9o_…" }
val result = k9o.gate.whoami()
```

### k9o (Flutter)

```dart
// final k9o = K9o.createClient(orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…');
final result = await k9o.gate.whoami()
```

### @k9o/react-native

```javascript
// const k9o = createClient({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })  // RN, secure storage
const { data } = await k9o.gate.whoami()
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/identity-access/get-current-user
