> This page is for Alfa (Preview).

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.alfa.boosted.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.alfa.boosted.ai/_mcp/server.

# Get Entities

POST https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get
Content-Type: application/json

This method allows customers to fetch the information Boosted has about entities, or their mapping.
`EntityType` and `ReturnType` must be specified. They indicate what entities one wants to get information for (e.g., `USER`, `WORKSPACE`, or `ORG`), and what information the user wants back (e.g., `ID_MAP`, or the full `ENTITY`).

Reference: https://docs.alfa.boosted.ai/alfa-preview/account-management-api/reference/post/entity-batch-get

## Authentication

- `Authorization` header (required) — Enter your JWT Token here in the format: Bearer \{token}

## Request

### Body (application/json)

This endpoint expects an user_service.EntityBatchGetRequest.

- `entity_type` (enum, required)
  - Allowed values: `user`, `workspace`, `org`
- `return_type` (enum, required)
  - Allowed values: `id_map`, `entity`
- `all_ids` (boolean, optional)
- `external_ids` (list of string, optional)
- `ids` (list of string, optional)

## Response

### 200

OK

- `entity_map` (map from string to user_service.BatchGetEntity, optional)
- `external_entity_map` (map from string to user_service.BatchGetExternalEntity, optional)
- `message` (string, optional)
- `success` (boolean, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `map from string to string`

### 403 Forbidden Error

Unauthorized

- `map from string to string`

### 422 Unprocessable Entity Error

Validation Error

- `map from string to string`

## Types

### user_service.BatchGetEntity

- `external_entity_id` (string, optional)
- `org` (user_service.ManagedOrgV2, optional)
- `user` (user_service.ManagedUserV2, optional)
- `workspace` (user_service.ManagedWorkspaceV2, optional)

### user_service.BatchGetExternalEntity

- `id` (string, optional)
- `org` (user_service.ManagedOrgV2, optional)
- `user` (user_service.ManagedUserV2, optional)
- `workspace` (user_service.ManagedWorkspaceV2, optional)

### user_service.ManagedOrgV2

- `email` (string, optional)
- `entitlements` (list of user_service.BillingFeatureQuantityV2, optional)
- `external_org_id` (string, optional)
- `name` (string, optional)
- `org_id` (string, optional)
- `org_type` (string, optional)
- `phone_number` (string, optional)
- `support_email` (string, optional)

### user_service.ManagedUserV2

- `email` (string, optional)
- `entitlements` (list of user_service.BillingFeatureQuantityV2, optional)
- `external_user_id` (string, optional)
- `name` (string, optional)
- `org_id` (string, optional)
- `user_id` (string, optional)
- `workspace_id` (string, optional)

### user_service.ManagedWorkspaceV2

- `entitlements` (list of user_service.BillingFeatureQuantityV2, optional)
- `external_workspace_id` (string, optional)
- `name` (string, optional)
- `org_id` (string, optional)
- `workspace_id` (string, optional)

### user_service.BillingFeatureQuantityV2

- `billing_feature_id` (string, optional)

## Examples

**Request**

```json
{
  "entity_type": "user",
  "return_type": "id_map"
}
```

**Response**

```json
{
  "entity_map": {},
  "external_entity_map": {},
  "message": "string",
  "success": true
}
```

**SDK Code**

```python
import requests

url = "https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get"

payload = {
    "entity_type": "user",
    "return_type": "id_map"
}
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"entity_type":"user","return_type":"id_map"}'
};

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

```go
package main

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

func main() {

	url := "https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get"

	payload := strings.NewReader("{\n  \"entity_type\": \"user\",\n  \"return_type\": \"id_map\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entity_type\": \"user\",\n  \"return_type\": \"id_map\"\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"entity_type\": \"user\",\n  \"return_type\": \"id_map\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get', [
  'body' => '{
  "entity_type": "user",
  "return_type": "id_map"
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"entity_type\": \"user\",\n  \"return_type\": \"id_map\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "entity_type": "user",
  "return_type": "id_map"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.api.boosted.ai/v2/account-management/entity/batch-get")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```