# Accounts

Endpoints related to user accounts and social media accounts.

## Get current user information

> Fetches the current user's information, including subscription status and API key if available.

```json
{"openapi":"3.0.3","info":{"title":"Blotato API","version":"2.0.0"},"tags":[{"name":"accounts","description":"Endpoints related to user accounts and social media accounts."}],"servers":[{"url":"https://backend.blotato.com","description":"Blotato API Server"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"blotato-api-key","in":"header"}}},"paths":{"/v2/users/me":{"get":{"summary":"Get current user information","tags":["accounts"],"description":"Fetches the current user's information, including subscription status and API key if available.","responses":{"200":{"description":"Current user information","content":{"application/json":{"schema":{"description":"Current user information","type":"object","properties":{"id":{"type":"string"},"subscriptionStatus":{"type":"string","nullable":true},"apiKey":{"type":"string","nullable":true}},"required":["id","subscriptionStatus","apiKey"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"code":{"type":"number"},"reqId":{"description":"Request ID for tracking","type":"string"},"message":{"description":"Unauthorized access","type":"string"}},"required":["message"]}}}}}}}}}
```

## Get current user accounts

> Fetches the current user's social media accounts. Optionally filter by platform.

```json
{"openapi":"3.0.3","info":{"title":"Blotato API","version":"2.0.0"},"tags":[{"name":"accounts","description":"Endpoints related to user accounts and social media accounts."}],"servers":[{"url":"https://backend.blotato.com","description":"Blotato API Server"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"blotato-api-key","in":"header"}}},"paths":{"/v2/users/me/accounts":{"get":{"summary":"Get current user accounts","tags":["accounts"],"description":"Fetches the current user's social media accounts. Optionally filter by platform.","parameters":[{"schema":{"type":"string","enum":["twitter","instagram","linkedin","facebook","tiktok","pinterest","threads","bluesky","youtube","other"]},"in":"query","name":"platform","required":false,"description":"Social media platform"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"List of social media accounts","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"description":"Social media platform","type":"string","enum":["twitter","instagram","linkedin","facebook","tiktok","pinterest","threads","bluesky","youtube","other"]},"fullname":{"type":"string"},"username":{"type":"string"}},"required":["id","platform","fullname","username"]}}},"required":["items"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"code":{"type":"number"},"reqId":{"description":"Request ID for tracking","type":"string"},"message":{"description":"Unauthorized access","type":"string"}},"required":["message"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"description":"Server error","type":"object","properties":{"code":{"type":"number"},"reqId":{"description":"Request ID for tracking","type":"string"},"message":{"description":"An error occurred","type":"string"}},"required":["message"]}}}}}}}}}
```

## Get current user subaccounts

> Fetches the current user's subaccounts for a specific account. Subaccounts are typically used for platforms like Facebook where a user can have multiple pages.

```json
{"openapi":"3.0.3","info":{"title":"Blotato API","version":"2.0.0"},"tags":[{"name":"accounts","description":"Endpoints related to user accounts and social media accounts."}],"servers":[{"url":"https://backend.blotato.com","description":"Blotato API Server"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"blotato-api-key","in":"header"}}},"paths":{"/v2/users/me/accounts/{accountId}/subaccounts":{"get":{"summary":"Get current user subaccounts","tags":["accounts"],"description":"Fetches the current user's subaccounts for a specific account. Subaccounts are typically used for platforms like Facebook where a user can have multiple pages.","parameters":[{"schema":{"type":"string"},"in":"path","name":"accountId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"name":{"type":"string"}},"required":["id","accountId","name"]}}},"required":["items"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"code":{"type":"number"},"reqId":{"description":"Request ID for tracking","type":"string"},"message":{"description":"Unauthorized access","type":"string"}},"required":["message"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"description":"Server error","type":"object","properties":{"code":{"type":"number"},"reqId":{"description":"Request ID for tracking","type":"string"},"message":{"description":"An error occurred","type":"string"}},"required":["message"]}}}}}}}}}
```
