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

# Retrieve Your Authenticated User Context — Pay3 Auth

> Return the authenticated user's ID, wallet address, and session expiry. Use this to verify your session is active before making further API calls.

Use this endpoint to confirm that your session is active and to retrieve your Pay3 user context — including your internal user ID, wallet ID, Stellar wallet address, network, and session expiry. This is especially useful after page load or app initialization to check whether a stored session cookie is still valid before making further API calls.

## Endpoint

**`GET /api/auth/me`**

Authentication is **required**. Include either the `pay3_session` cookie or an `Authorization: Bearer <session-token>` header.

***

## Response

All Pay3 API responses are wrapped in a standard envelope:

```json theme={null}
{
  "data": { ... },
  "requestId": "req_01hx2q3r4s5t6u7v8w9x0y1z"
}
```

A successful `200 OK` response returns your authenticated user context inside `data`.

**data** `object`

The authenticated user context.

**data fields**

**data.userId** `string`

Your Pay3 internal user ID. Stable across sessions and wallet
re-connections.

**data.walletId** `string`

The Pay3 internal record ID for your currently authenticated Stellar
wallet.

**data.walletAddress** `string`

Your Stellar public key (`G...`) associated with the active session.

**data.network** `string`

The Stellar network for this session — `testnet` or `public`.

**data.sessionExpiresAt** `string`

ISO 8601 timestamp indicating when the current session expires. Use
this to proactively re-authenticate before the session ends.

**requestId** `string`

A unique identifier for this API request, useful for support and debugging.

***

## Example

### Request

```bash theme={null}
# Using a Bearer token
curl --request GET \
  --url https://api.pay3.dev/api/auth/me \
  --header 'Authorization: Bearer your-session-token-here'
```

```bash theme={null}
# Using the session cookie (browser)
curl --request GET \
  --url https://api.pay3.dev/api/auth/me \
  --cookie 'pay3_session=your-session-token-here'
```

### Response Body

```json theme={null}
{
  "data": {
    "userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "walletId": "f0e1d2c3-b4a5-6789-0123-456789abcdef",
    "walletAddress": "GAHJJJKMOKYE4RVPZEWZTKH5FVI4PA3VL7GK2LFNUBSGBV8XVMHXV6R",
    "network": "testnet",
    "sessionExpiresAt": "2024-11-08T12:00:00.000Z"
  },
  "requestId": "req_01hx2q3r4s5t6u7v8w9x0y1z"
}
```

***

## Error Responses

| HTTP Status | Description |
| - | - |
| `401 Unauthorized` | No session token was provided, or the token has expired or been revoked. Re-authenticate via [`POST /api/auth/challenge`](https://pay3.mintlify.site/api-reference/auth/challenge) and [`POST /api/auth/verify`](https://pay3.mintlify.site/api-reference/auth/verify). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.