> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developers.alephant.io/api-reference/saa-s-api/members/batch-create-members/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.alephant.io/_mcp/server. # Batch create members POST https://alephant.io/api/v1/members/batch Content-Type: application/json Create up to 50 members. Each gets a VK. Returns succeeded/failed arrays. Reference: https://developers.alephant.io/api-reference/saa-s-api/members/batch-create-members ## Servers - `https://alephant.io` (Production, default) - `https://dev.alephant.io` (Development) ## Request ### Headers - `Authorization` (string, required) — Bearer \{access\_token} - `X-Workspace-Id` (string, required) — Workspace UUID ### Body (application/json) This endpoint expects an internal_api_handlers_members.BatchCreateMembersRequest. - `members` (list of internal_api_handlers_members.CreateMemberRequest, required) ## Response ### 200 OK - `data` (internal_api_handlers_members.BatchCreateMembersResponseData, optional) - `meta` (internal_api_handlers_members.BatchCreateMembersResponseMeta, optional) ## Errors ### 400 Bad Request Error BAD_REQUEST - `map from string to any` ### 401 Unauthorized Error AUTH_TOKEN_EXPIRED - `map from string to any` ### 403 Forbidden Error FORBIDDEN - `map from string to any` ### 422 Unprocessable Entity Error VALIDATION_ERROR (e.g. batch size > 50) - `map from string to any` ## Types ### internal_api_handlers_members.CreateMemberRequest - `displayName` (string, required) - `masterKeyId` (string, required) - `departmentId` (string, optional) - `email` (string, optional) - `expiresAt` (string, optional) - `modelsInfo` (map from string to github_com_alephant_backend-saas-service_internal_service.ModelPriceEntry, optional) — ModelsInfo 是 custom provider 时的模型价格,格式:\{"modelId": \{"prompt": 1.5, "completion": 2.0}} 单位:美元 / 1M tokens - `monthlyBudget` (double, optional) - `note` (string, optional) - `rateLimitRpm` (integer, optional) - `roleLabel` (string, optional) ### internal_api_handlers_members.BatchCreateMembersResponseData - `failed` (list of internal_api_handlers_members.BatchFailedItem, optional) - `succeeded` (list of internal_api_handlers_members.CreateMemberResponse, optional) ### internal_api_handlers_members.BatchCreateMembersResponseMeta - `failCount` (integer, optional) - `successCount` (integer, optional) - `total` (integer, optional) ### github_com_alephant_backend-saas-service_internal_service.ModelPriceEntry - `completion` (double, optional) - `prompt` (double, optional) ### internal_api_handlers_members.BatchFailedItem - `index` (integer, optional) - `reason` (string, optional) ### internal_api_handlers_members.CreateMemberResponse - `member` (internal_api_handlers_members.CreateMemberResponseMember, optional) - `virtualKey` (internal_api_handlers_members.CreateMemberResponseVirtualKey, optional) ### internal_api_handlers_members.CreateMemberResponseMember - `createdAt` (string, optional) - `email` (string, optional) - `id` (string, optional) - `name` (string, optional) - `status` (string, optional) ### internal_api_handlers_members.CreateMemberResponseVirtualKey - `fullToken` (string, optional) - `id` (string, optional) - `keyPrefix` (string, optional) - `modelsInfo` (map from string to github_com_alephant_backend-saas-service_internal_service.ModelPriceEntry, optional) — ModelsInfo is non-null only for custom provider keys. ## Examples **Request** ```json { "members": [ { "displayName": "string", "masterKeyId": "string" } ] } ``` **Response** ```json { "data": { "failed": [ { "index": 1, "reason": "string" } ], "succeeded": [ { "member": { "createdAt": "string", "email": "string", "id": "string", "name": "string", "status": "string" }, "virtualKey": { "fullToken": "string", "id": "string", "keyPrefix": "string", "modelsInfo": {} } } ] }, "meta": { "failCount": 1, "successCount": 1, "total": 1 } } ``` **SDK Code** ```python import requests url = "https://alephant.io/api/v1/members/batch" payload = { "members": [ { "displayName": "string", "masterKeyId": "string" } ] } headers = { "Authorization": "Authorization", "X-Workspace-Id": "X-Workspace-Id", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://alephant.io/api/v1/members/batch'; const options = { method: 'POST', headers: { Authorization: 'Authorization', 'X-Workspace-Id': 'X-Workspace-Id', 'Content-Type': 'application/json' }, body: '{"members":[{"displayName":"string","masterKeyId":"string"}]}' }; 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://alephant.io/api/v1/members/batch" payload := strings.NewReader("{\n \"members\": [\n {\n \"displayName\": \"string\",\n \"masterKeyId\": \"string\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Authorization") req.Header.Add("X-Workspace-Id", "X-Workspace-Id") 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://alephant.io/api/v1/members/batch") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Authorization' request["X-Workspace-Id"] = 'X-Workspace-Id' request["Content-Type"] = 'application/json' request.body = "{\n \"members\": [\n {\n \"displayName\": \"string\",\n \"masterKeyId\": \"string\"\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://alephant.io/api/v1/members/batch") .header("Authorization", "Authorization") .header("X-Workspace-Id", "X-Workspace-Id") .header("Content-Type", "application/json") .body("{\n \"members\": [\n {\n \"displayName\": \"string\",\n \"masterKeyId\": \"string\"\n }\n ]\n}") .asString(); ``` ```php request('POST', 'https://alephant.io/api/v1/members/batch', [ 'body' => '{ "members": [ { "displayName": "string", "masterKeyId": "string" } ] }', 'headers' => [ 'Authorization' => 'Authorization', 'Content-Type' => 'application/json', 'X-Workspace-Id' => 'X-Workspace-Id', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://alephant.io/api/v1/members/batch"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Authorization"); request.AddHeader("X-Workspace-Id", "X-Workspace-Id"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"members\": [\n {\n \"displayName\": \"string\",\n \"masterKeyId\": \"string\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Authorization", "X-Workspace-Id": "X-Workspace-Id", "Content-Type": "application/json" ] let parameters = ["members": [ [ "displayName": "string", "masterKeyId": "string" ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://alephant.io/api/v1/members/batch")! 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() ```