# Authentication

Authentication and profile endpoints

## Get current user

> Returns the currently authenticated user with basic information.

```json
{"openapi":"3.0.0","info":{"title":"PlainProxies User API","version":"1.0.0"},"tags":[{"name":"Authentication","description":"Authentication and profile endpoints"}],"servers":[{"url":"https://dashboard.plainproxies.com/api/user","description":"Production API Server"},{"url":"https://plainproxies-sandbox.com/api/user","description":"Sandbox API Server"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key authentication. Get your key from the Dashboard Settings page.","name":"X-API-KEY","in":"header"}},"schemas":{"User":{"properties":{"uuid":{"type":"string","format":"uuid"},"username":{"type":"string"},"email":{"type":"string","format":"email"},"is_reseller":{"type":"boolean"},"verification":{"properties":{"status":{"type":"string","enum":["pending","verified","denied","suspected","expired","canceled","unverified"]},"is_verified":{"type":"boolean"}},"type":"object"},"created_at":{"type":"string","format":"date-time"},"balance":{"properties":{"amount":{"type":"number","format":"float"},"currency":{"type":"string"}},"type":"object","nullable":true},"reseller":{"properties":{"id":{"type":"integer"},"discount_percentage":{"type":"number","format":"float"},"is_active":{"type":"boolean"}},"type":"object","nullable":true},"stats":{"properties":{"sub_users_count":{"type":"integer"},"active_subscriptions_count":{"type":"integer"},"total_invoices_count":{"type":"integer"}},"type":"object","nullable":true}},"type":"object"}}},"paths":{"/auth/me":{"get":{"tags":["Authentication"],"summary":"Get current user","description":"Returns the currently authenticated user with basic information.","operationId":"b3afaeec2605f15857410752fffcb54b","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/User"}},"type":"object"}}}},"401":{"description":"Unauthorized"}}}}}}
```

## Get API key information

> Returns details about the current API key including creation date and last usage.

```json
{"openapi":"3.0.0","info":{"title":"PlainProxies User API","version":"1.0.0"},"tags":[{"name":"Authentication","description":"Authentication and profile endpoints"}],"servers":[{"url":"https://dashboard.plainproxies.com/api/user","description":"Production API Server"},{"url":"https://plainproxies-sandbox.com/api/user","description":"Sandbox API Server"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key authentication. Get your key from the Dashboard Settings page.","name":"X-API-KEY","in":"header"}}},"paths":{"/auth/api-key":{"get":{"tags":["Authentication"],"summary":"Get API key information","description":"Returns details about the current API key including creation date and last usage.","operationId":"478eeb1a0963432d641070b58e038805","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"properties":{"api_key":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"last_used_at":{"type":"string","format":"date-time","nullable":true}},"type":"object"}},"type":"object"}}}},"401":{"description":"Unauthorized"}}}}}}
```

## Get user profile

> Returns the user profile with optional related data.

```json
{"openapi":"3.0.0","info":{"title":"PlainProxies User API","version":"1.0.0"},"tags":[{"name":"Authentication","description":"Authentication and profile endpoints"}],"servers":[{"url":"https://dashboard.plainproxies.com/api/user","description":"Production API Server"},{"url":"https://plainproxies-sandbox.com/api/user","description":"Sandbox API Server"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key authentication. Get your key from the Dashboard Settings page.","name":"X-API-KEY","in":"header"}},"schemas":{"User":{"properties":{"uuid":{"type":"string","format":"uuid"},"username":{"type":"string"},"email":{"type":"string","format":"email"},"is_reseller":{"type":"boolean"},"verification":{"properties":{"status":{"type":"string","enum":["pending","verified","denied","suspected","expired","canceled","unverified"]},"is_verified":{"type":"boolean"}},"type":"object"},"created_at":{"type":"string","format":"date-time"},"balance":{"properties":{"amount":{"type":"number","format":"float"},"currency":{"type":"string"}},"type":"object","nullable":true},"reseller":{"properties":{"id":{"type":"integer"},"discount_percentage":{"type":"number","format":"float"},"is_active":{"type":"boolean"}},"type":"object","nullable":true},"stats":{"properties":{"sub_users_count":{"type":"integer"},"active_subscriptions_count":{"type":"integer"},"total_invoices_count":{"type":"integer"}},"type":"object","nullable":true}},"type":"object"}}},"paths":{"/profile":{"get":{"tags":["Authentication"],"summary":"Get user profile","description":"Returns the user profile with optional related data.","operationId":"459d6bb7cc0d8c9fe7fe65f845a0ff74","parameters":[{"name":"include","in":"query","description":"Comma-separated list: balance, reseller, stats","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/User"}},"type":"object"}}}},"401":{"description":"Unauthorized"}}}}}}
```

## Get user statistics

> Returns usage statistics for the authenticated user.

```json
{"openapi":"3.0.0","info":{"title":"PlainProxies User API","version":"1.0.0"},"tags":[{"name":"Authentication","description":"Authentication and profile endpoints"}],"servers":[{"url":"https://dashboard.plainproxies.com/api/user","description":"Production API Server"},{"url":"https://plainproxies-sandbox.com/api/user","description":"Sandbox API Server"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key authentication. Get your key from the Dashboard Settings page.","name":"X-API-KEY","in":"header"}}},"paths":{"/profile/stats":{"get":{"tags":["Authentication"],"summary":"Get user statistics","description":"Returns usage statistics for the authenticated user.","operationId":"6e599f6ce3590fbed2a75ae2d9e163c8","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"properties":{"total_sub_users":{"type":"integer"},"active_sub_users":{"type":"integer"},"total_subscriptions":{"type":"integer"},"active_subscriptions":{"type":"integer"},"total_invoices":{"type":"integer"},"total_spent":{"type":"string"},"unlimited_accounts":{"type":"integer"}},"type":"object"}},"type":"object"}}}},"401":{"description":"Unauthorized"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plainproxies.com/api-documentation/overview/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
