---
title: "Create a workspace in a company"
method: POST
path: "/companies/{id}/workspaces"
tags: ["Company"]
---

# Create a workspace in a company

`POST /companies/{id}/workspaces`

Creates a new workspace in one of the company's billing accounts. Endpoint authorized with a company-scoped API key, or by a company admin user.

## Path parameters

- `id` string, required

## Request body

- CreateCompanyWorkspaceRequest — Request to create a workspace in a company
  - `name` string, required — The display name for the new workspace
  - `account_id` string — The billing account that will own the new workspace. Required when the company owns more than one account. When omitted and the company owns exactly one account, that account is used.
  - `owner_user_ids` string[] — Users to grant the owner role in the new workspace. Each must already be a member of the company, holding either a role in one of its workspaces or a company role; naming a user outside the company, or one that does not exist, is rejected. If any grant fails the whole creation is rolled back, so keep the list to the users who genuinely need to own the workspace.
  - `credit_allocation` integer — Credits reserved for the new workspace in each billing period. When omitted the workspace draws on the account's unallocated credits alongside its siblings.
  - `enforce_credit_limit` boolean — When true, cloud runs in the new workspace are blocked once its credit allocation is exhausted for the billing period. Requires credit_allocation.

## Response `201`

The workspace that was created

- Workspace — A mabl workspace
  - `id` string — The id of the workspace
  - `name` string — The display name of the workspace
  - `account_id` string — The id of the billing account that owns the workspace
  - `created_time` integer — Time at which the workspace was created, in epoch milliseconds

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `404` — Company not found
- `default` — Unknown error

## Changes

- **2026-09-01** `2938d8f6f737` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/mabl/apis/mabl-api/changes/companies/:id/workspaces/post.md)

---

[API](https://skmtc.dev/mabl/apis/mabl-api.md) · [All operations](https://skmtc.dev/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/f230f5cc86cb/schema)
