API Reference workspaces
Create a workspace
POST/projects/{project_id}/workspaces/
Create a workspace in the project sandbox, or a Git-bound workspace.
Parameters
| Body field | Required | Description |
|---|---|---|
| name | yes | Display name |
| type | yes | local (sandbox directory) or git (GitLab/GitHub bound) |
| slug | no | Directory name — generated when omitted, permanent once created |
| path_mode | with local | shared or tmp for local workspaces |
| provider / repo_url / token / default_branch | with git | Git repository binding |
| artifact_type | no | knowledge_base turns the workspace into an OKF knowledge base |
Request
curl -X POST "$ALLYBUILD_API_URL/projects/$PROJECT_ID/workspaces/" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
-d '{"name": "Docs", "type": "local", "path_mode": "shared"}'Response
{
"id": "2b1a9f8e-...",
"name": "Docs",
"slug": "docs",
"type": "local",
"path_mode": "shared"
}