Create Workspace
POST
/workspaces Creates a new workspace with auto-created production, staging, and development environments.
Body Parameters
name string required description string slug string Optional explicit slug. When omitted, the slug is auto-derived from `name`. Must match the same kebab-case format used elsewhere (2-64 chars, lowercase alphanumeric with `-` or `_`, must start and end with an alphanumeric).
curl -X POST \
-H "x-api-key: dsk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My Workspace",
"description": "Invoice processing workspace",
"slug": "my-workspace"
}' \
https://api.tracore.io/workspaces import { TracoreClient } from '@tracore/sdk';
const client = new TracoreClient({ apiKey: 'dsk_your_api_key' });
const workspace = await client.workspaces.create({
name: 'My Workspace',
description: 'Invoice processing',
});
console.log(workspace.slug); 201 Response
{
"id": "ws_abc123",
"slug": "my-workspace",
"name": "My Workspace",
"description": "Invoice processing workspace",
"createdBy": "usr_abc123",
"createdAt": "2024-03-15T10:30:00Z",
"updatedAt": "2024-03-15T10:30:00Z"
}