> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. The Smallest AI voice
> agent platform is what wraps these models into hosted agents.

# Get account details

GET https://api.smallest.ai/atoms/v1/account/get-account-details

Returns the calling user's profile (email, name, avatar) along with every organization
the user belongs to. Use this to resolve the user's active org list before switching
context, or to render user info in a management UI.


Reference: https://docs.smallest.ai/voice-agents/api-reference/account/get-account-details

## Authentication

- `Authorization` header (bearer token, required) — API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.

## Response

### 200

Account details retrieved successfully.

- `userId` (string, optional) — Unique user ID.
- `email` (string, optional)
- `firstName` (string, optional)
- `lastName` (string, optional)
- `phone` (string, optional, nullable)
- `picture` (string, optional) — URL of the user's avatar image.
- `hasOnboarded` (boolean, optional) — Whether the user has completed initial onboarding.
- `organizations` (list of object, optional) — Organizations the user is a member of. `roleId` is 0 for owner, 1 for member (and higher values for finer-grained roles).
  - `orgId` (string, optional)
  - `name` (string, optional)
  - `ownerEmail` (string, optional)
  - `roleId` (integer, optional)
  - `onPremEnabled` (boolean, optional)

## Examples

**Response**

```json
{
  "userId": "69561896a37fd214b9a8d33a",
  "email": "ada@example.com",
  "firstName": "Ada",
  "lastName": "Lovelace",
  "phone": null,
  "picture": "https://lh3.googleusercontent.com/a/avatar.jpg",
  "hasOnboarded": true,
  "organizations": [
    {
      "orgId": "69561896a37fd214b9a8d33c",
      "name": "Acme Inc.",
      "ownerEmail": "ada@example.com",
      "roleId": 0,
      "onPremEnabled": false
    },
    {
      "orgId": "698076af5c1b62205ff731b8",
      "name": "Contoso",
      "ownerEmail": "grace@example.com",
      "roleId": 1,
      "onPremEnabled": false
    }
  ]
}
```

**SDK Code**

```python User in two orgs
import requests

url = "https://api.smallest.ai/atoms/v1/account/get-account-details"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript User in two orgs
const url = 'https://api.smallest.ai/atoms/v1/account/get-account-details';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go User in two orgs
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.smallest.ai/atoms/v1/account/get-account-details"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby User in two orgs
require 'uri'
require 'net/http'

url = URI("https://api.smallest.ai/atoms/v1/account/get-account-details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java User in two orgs
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.smallest.ai/atoms/v1/account/get-account-details")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php User in two orgs
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.smallest.ai/atoms/v1/account/get-account-details', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp User in two orgs
using RestSharp;

var client = new RestClient("https://api.smallest.ai/atoms/v1/account/get-account-details");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift User in two orgs
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/account/get-account-details")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```