> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developers.alephant.io/sdk-reference/saa-s-sdk/saa-s-api/workspaces/create-workspace/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.alephant.io/_mcp/server. # Create workspace POST https://alephant.io/api/v1/workspaces Content-Type: application/json Create a new workspace. Multiple workspaces per user are allowed; each has its own subscription. Returns 201 with workspace detail. Reference: https://developers.alephant.io/api-reference/saa-s-api/workspaces/create-workspace ## Servers - `https://alephant.io` (Production, default) - `https://dev.alephant.io` (Development) ## Request ### Headers - `Authorization` (string, required) — Bearer \{access\_token} ### Body (application/json) This endpoint expects an internal_api_handlers_workspaces.CreateWorkspaceRequest. - `name` (string, required) — The server trims surrounding whitespace, then requires 1-100 UTF-8 bytes. - `billingEmail` (string, optional) — Empty is allowed; non-empty values are validated with Go's mail.ParseAddress. - `slug` (string, optional) — Empty is allowed and causes automatic slug generation. A non-empty value must contain URL-safe ASCII letters, numbers, and hyphens with no leading or trailing hyphen; validation is case-insensitive. - `tier` (string, optional, default: free) — Leading/trailing whitespace and letter case are ignored. "pro" or "team" starts a 7-day trial; empty/"free" means free/active. Enterprise is NOT allowed via tier (use type="enterprise" instead). - `type` (string, optional, default: personal) — Leading/trailing whitespace and letter case are ignored. Empty defaults to "personal"; the other accepted value is "enterprise". Use json:"type" (not omitempty) so request bodies always bind "type" reliably across JSON decoders. ## Response ### 201 data: created workspace (id, name, slug, type, ownerId, logoUrl, billingEmail, settings, createdAt, updatedAt) - `map from string to any` ## Errors ### 401 Unauthorized Error AUTH_TOKEN_EXPIRED - `map from string to any` ### 409 Conflict Error CONFLICT_SLUG_TAKEN when slug already in use - `map from string to any` ### 422 Unprocessable Entity Error VALIDATION_ERROR - `map from string to any` ## Examples **Request** ```json { "name": "string" } ``` **Response** ```json {} ``` **SDK Code** ```python import requests url = "https://alephant.io/api/v1/workspaces" payload = { "name": "string" } headers = { "Authorization": "Authorization", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://alephant.io/api/v1/workspaces'; const options = { method: 'POST', headers: {Authorization: 'Authorization', 'Content-Type': 'application/json'}, body: '{"name":"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/workspaces" payload := strings.NewReader("{\n \"name\": \"string\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Authorization") 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/workspaces") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Authorization' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"string\"\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/workspaces") .header("Authorization", "Authorization") .header("Content-Type", "application/json") .body("{\n \"name\": \"string\"\n}") .asString(); ``` ```php request('POST', 'https://alephant.io/api/v1/workspaces', [ 'body' => '{ "name": "string" }', 'headers' => [ 'Authorization' => 'Authorization', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://alephant.io/api/v1/workspaces"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Authorization"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"string\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Authorization", "Content-Type": "application/json" ] let parameters = ["name": "string"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://alephant.io/api/v1/workspaces")! 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() ```