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

# Get Account by API Key

> Check an API key and see which account and plan it belongs to

Returns the account that owns the API key you send, with its plan. It changes nothing and spends nothing, so it is a safe first call to test a key or confirm which workspace you are about to act on.

It looks the key up among main account API keys. A client API key is not found here and returns 404.

## Query Parameters

**api\_key** `string` *required*

Your SmartLead API key. The `X-API-Key` and `Authorization: Bearer` headers also work.

```bash cURL theme={null}
curl "https://server.smartlead.ai/api/v1/users/get-by-api-key" -H "X-API-Key: YOUR_KEY"
```

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

response = requests.get(
    "https://server.smartlead.ai/api/v1/users/get-by-api-key",
    headers={"X-API-Key": "YOUR_API_KEY"},
)
print(response.json()["data"]["email"])
```

```json 200 theme={null}
{
  "success": true,
  "message": "User data retrieved successfully",
  "data": {
    "id": 1001,
    "name": "Jane Doe",
    "email": "jane@example.com",
    "uuid": "0b3f6c1e-7a2d-4e8b-9c5f-1d2e3f4a5b6c",
    "provider": "app",
    "access_info": {},
    "plan_details": {
      "id": 2001,
      "plan_type": "TRIAL_PLAN",
      "trial_start_date": "2026-11-01T00:00:00.000Z",
      "trial_end_date": "2026-11-15T00:00:00.000Z",
      "new_feature_access": {}
    }
  }
}
```

```json 401 - Unknown key theme={null}
{
  "message": "Invalid API Key"
}
```

```json 401 - No key sent theme={null}
{
  "message": "API key is required."
}
```

```json 404 - Client API key theme={null}
{
  "success": false,
  "message": "User not found for the provided API key"
}
```

## Response Fields

**data.id** `number`

Account (user) id

**data.email** `string`

Account owner's email

**data.plan\_details** `object | null`

Plan type and trial dates


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