Moonborn — API · workspaces
Create a new workspace under an existing org
POST/v1/workspacesscope · Bearer (API key or session JWT)
Request body
| Field | Type | Description |
|---|---|---|
| orgIdreq | string | |
| slugreq | string | |
| namereq | string |
Responses
201Created
Body
| Field | Type | Description |
|---|---|---|
| idreq | string | |
| orgIdreq | string | |
| slugreq | string | |
| namereq | string | |
| createdAtreq | string |
409Slug taken in org
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
422Validation error
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X POST https://api.moonborn.co/v1/workspaces \
-H "Authorization: Bearer $MOONBORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"orgId": "<string>",
"slug": "<string>",
"name": "<string>"
}'TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.workspaces.createWorkspace({
orgId: "<string>",
slug: "<string>",
name: "<string>",
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.workspaces.create_workspace(
org_id="<string>",
slug="<string>",
name="<string>",
)