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

# GET /partner/v1/me

> Read the connected Trench user, your client ID, and the scopes the presented access token carries.

Returns the user behind the access token, along with the scopes that token actually carries.

|                |                |
| -------------- | -------------- |
| **Scope**      | `profile:read` |
| **Rate limit** | 300 / minute   |

## Request

This endpoint takes no parameters.

<CodeGroup>
  ```bash cURL theme={null}
  curl 'https://api.tren.ch/partner/v1/me' \
    -H "Authorization: Bearer $ACCESS_TOKEN"
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://api.tren.ch/partner/v1/me", {
    headers: { Authorization: `Bearer ${accessToken}` },
  });

  const { user, client, scopes } = await res.json();
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
    "https://api.tren.ch/partner/v1/me",
    headers={"Authorization": f"Bearer {access_token}"},
  )

  data = res.json()
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "user": {
    "walletSolana": "7xKX…",
    "twitterHandle": "alice",
    "tradingEnabled": true
  },
  "client": "tclient_…",
  "scopes": ["profile:read", "trade:execute"]
}
```

| Field                 | Type           | Notes                                               |
| --------------------- | -------------- | --------------------------------------------------- |
| `user.walletSolana`   | string \| null | The user's embedded Solana wallet address           |
| `user.twitterHandle`  | string \| null | X handle without `@`, or null if never linked       |
| `user.tradingEnabled` | boolean        | Whether the wallet is delegated for 1-click trading |
| `client`              | string \| null | Your client ID                                      |
| `scopes`              | string\[]      | Scopes carried by this token                        |

<Note>
  We recommend treating `scopes` as the source of truth for what your token can do. It reflects the authorization code that issued the token, which can be narrower than the user's overall grant if they re-consented with a wider set while you are still holding an older token.
</Note>

## Using tradingEnabled

We recommend gating your trade UI on this field. A user can revoke wallet delegation at any time after connecting, and once they do, every trade and governance write will fail with `403 delegation_missing`.

```javascript theme={null}
const { user } = await trench.get("/partner/v1/me");

if (!user.tradingEnabled) {
  // Send them back through the authorize flow to re-enable 1-click trading.
  showReconnectPrompt();
}
```

## Errors

| Status | Error                | Cause                                         |
| ------ | -------------------- | --------------------------------------------- |
| `401`  | `invalid_token`      | Missing, malformed, expired, or revoked token |
| `403`  | `insufficient_scope` | Token lacks `profile:read`                    |
