> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://onepin.ai/docs/reference/api-reference/workspaces/update-workspace-api-v-1-workspaces-workspace-id-patch/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://onepin.ai/_mcp/server. # Update Workspace PATCH https://api.onepin.ai/api/v1/workspaces/{workspace_id} Content-Type: application/json Update a workspace's name, color palette index, and/or slug. Admin only. All fields are optional — supply only the fields you want to change. `slug` follows the same validation rules as on create (lowercase kebab-case, 1–50 characters, no reserved words). Returns 409 if the new slug is already claimed by another workspace, 422 if the slug format is invalid or reserved. Re-setting the workspace's current slug to itself never returns 409. Only workspace admins may call this endpoint; other members receive 404 (same as not-found, to avoid leaking membership details to non-members). Reference: https://onepin.ai/docs/reference/api-reference/workspaces/update-workspace-api-v-1-workspaces-workspace-id-patch ## Authentication - `Authorization` header (bearer token, required) — Clerk JWT token ## Servers - `https://api.onepin.ai` (prod, default) - `https://dev-api.onepin.ai` (dev) ## Request ### Path parameters - `workspace_id` (string, required) ### Body (application/json) This endpoint expects a WorkspaceUpdate. - `name` (string, optional, nullable) — New workspace name. Omit to leave unchanged. - `slug` (string, optional, nullable) — New slug (lowercase kebab-case, 1–50 characters). Omit to leave unchanged. Returns 409 if taken, 422 if invalid or reserved. - `color_idx` (integer, optional, nullable) — New color palette index (0–6). Omit to leave unchanged. - `routing_price_sensitivity` (double, optional, nullable) — New voice-selection price/quality balance (0.0 = pure quality, 1.0 = pure price, 0.5 = balanced). Omit to leave unchanged. - `routing_llm_fit` (boolean, optional, nullable) — New setting for whether automatic voice selection also weighs content fit. Omit to leave unchanged. ## Response ### 200 Successful Response - `data` (WorkspaceOut, required) - `meta` (Meta, required) ## Errors ### 409 Conflict Error Slug already taken (WORKSPACE_SLUG_TAKEN) - `error` (ApiErrorBody, required) - `meta` (Meta, required) ### 422 Unprocessable Entity Error Slug invalid or reserved (WORKSPACE_SLUG_INVALID / WORKSPACE_SLUG_RESERVED) - `error` (ApiErrorBody, required) - `meta` (Meta, required) ## Types ### WorkspaceOut - `id` (string, required) — Unique workspace identifier. Pass as `X-Workspace-Id` header to scope resource requests. - `name` (string, required) — Human-readable workspace name. - `slug` (string, required) — URL-safe workspace identifier (lowercase kebab-case). - `color_idx` (integer, required) — Index into the workspace color palette. - `created_at` (datetime, required) — When the workspace was created (UTC). - `updated_at` (datetime, required) — When the workspace was last modified (UTC). - `routing_price_sensitivity` (double, required) — Voice-selection price/quality balance (0.0 = pure quality, 1.0 = pure price, 0.5 = balanced). - `routing_llm_fit` (boolean, required) — Whether automatic voice selection also weighs content fit. - `created_by` (string, optional, nullable) — User ID of the workspace owner. Null for an enterprise org workspace, which is owned by its organization (see organization_id) rather than a user. - `organization_id` (string, optional, nullable) — Owning organization when this is an enterprise org workspace, else null. ### Meta - `request_id` (string, required) - `timestamp` (datetime, required) ### ApiErrorBody - `code` (string, required) - `message` (string, required) - `details` (list of ApiErrorDetail, optional, default: []) ### ApiErrorDetail - `field` (string, required) - `message` (string, required) - `line_numbers` (list of integer, optional, nullable) - `min_chars` (integer, optional, nullable) ## Examples **Request** ```json {} ``` **Response** ```json { "data": { "id": "string", "name": "string", "slug": "string", "color_idx": 1, "created_at": "2024-01-15T09:30:00Z", "updated_at": "2024-01-15T09:30:00Z", "routing_price_sensitivity": 1.1, "routing_llm_fit": true, "created_by": "string", "organization_id": "string" }, "meta": { "request_id": "string", "timestamp": "2024-01-15T09:30:00Z" } } ``` **SDK Code** ```python import requests url = "https://api.onepin.ai/api/v1/workspaces/workspace_id" payload = {} headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.onepin.ai/api/v1/workspaces/workspace_id'; const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{}' }; 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://api.onepin.ai/api/v1/workspaces/workspace_id" payload := strings.NewReader("{}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") 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://api.onepin.ai/api/v1/workspaces/workspace_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.onepin.ai/api/v1/workspaces/workspace_id") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.onepin.ai/api/v1/workspaces/workspace_id', [ 'body' => '{}', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.onepin.ai/api/v1/workspaces/workspace_id"); var request = new RestRequest(Method.PATCH); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.onepin.ai/api/v1/workspaces/workspace_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" 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() ``` > Onepin is a voice workflow platform that orchestrates, validates, and ships production-ready audio across 33 TTS models.