> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mixlayer.com/api-reference/platform-api/organizations/list-organizations/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server. # List available organizations GET https://api.mixlayer.com/v1/organizations When authenticated with an API key, this operation requires `api-read`. Reference: https://docs.mixlayer.com/api-reference/platform-api/organizations/list-organizations ## Authentication - `Authorization` header (bearer token, required) — Console user session or Mixlayer API key supplied as a Bearer token. ## Response ### 200 Organizations available to the principal - `data` (list of ApiDataResponseVecUserOrganizationDataItems, required) — Response payload. ## Errors ### 401 Unauthorized Error Authentication is missing or invalid. - `error` (ApiErrorBody, required) — Structured error details. ### 403 Forbidden Error The authenticated principal cannot perform this operation. - `error` (ApiErrorBody, required) — Structured error details. ### 404 Not Found Error The API key organization no longer exists - `error` (ApiErrorBody, required) — Structured error details. ### 500 Internal Server Error An unexpected server or database error occurred. - `error` (ApiErrorBody, required) — Structured error details. ## Types ### ApiDataResponseVecUserOrganizationDataItems Organization available to the authenticated user. - `billing_account_id` (string, required) — Billing account attached to the organization. - `created_at` (datetime, required) — Time the organization was created. - `data_persistence` (DataPersistenceConfig, required) — Organization data-persistence settings exposed by the API. - `id` (string, required) — Stable organization identifier. - `is_personal` (boolean, required) — Whether this is a console user's personal organization. - `name` (string, required) — Organization name. - `updated_at` (datetime, required) — Time the organization was last updated. - `role` (enum, required) — User's role in the organization. - Allowed values: `primary_owner`, `owner`, `member` ### ApiErrorBody Structured error details returned by the platform API. - `message` (string, required) — Human-readable error message. - `code` (string, optional, nullable) — Stable machine-readable error code, when available. - `details` (any, optional) — Error-specific structured context, when available. ### DataPersistenceConfig Organization data-persistence settings accepted and exposed by the APIs. - `stored_responses_days` (integer, optional, nullable) — Stored-response retention in days for Responses API requests using `store: true`. Overrides the default 30-day retention; zero disables storage. ## Examples **Response** ```json { "data": [ { "billing_account_id": "string", "created_at": "2024-01-15T09:30:00Z", "data_persistence": { "stored_responses_days": 1 }, "id": "string", "is_personal": true, "name": "string", "updated_at": "2024-01-15T09:30:00Z", "role": "primary_owner" } ] } ``` **SDK Code** ```python import requests url = "https://api.mixlayer.com/v1/organizations" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.mixlayer.com/v1/organizations'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; 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" "net/http" "io" ) func main() { url := "https://api.mixlayer.com/v1/organizations" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") 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://api.mixlayer.com/v1/organizations") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.mixlayer.com/v1/organizations") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.mixlayer.com/v1/organizations', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ```