Create a workspace
Returns at once; the workspace moves creating → cloning → running as the Operation proceeds. A Git source needs a connection to its provider (problem `git-connection-required`) and read access to the repository. The origin repository is added to the workspace's git access list with write access.
openapi/harthelm.yaml at v1.5.0__Host-harthelm_session<token>Browser session of the UI (12 h idle, 7 days absolute). State-changing requests also need the header
Harthelm-CSRF: 1 and a matching Origin.
Idempotency-Key?stringClient-chosen key (at most 255 characters); a repeated key returns the first result for 24 h.
1 <= length <= 255application/json- body
team_id*IDNumeric resource id.
int641 <= valuename*string^[A-Za-z0-9]([-A-Za-z0-9 _.]{0,62}[A-Za-z0-9])?$plan*stringbase_image*stringgit?Clone this repository through the git proxy; an empty workspace when absent.
availability?Availability"always""on-demand"restricted?booleantrueAccepted; the workspace exists in state creating.
application/json- response
workspace*operation*A long-running action. It ends in succeeded or failed and stays readable for 7 days.
curl -X POST 'https://console.example.com/api/v1/workspaces' \ -H 'Content-Type: application/json' \ -d '{ "team_id": 1, "name": "string", "plan": "string", "base_image": "string"}'{ "workspace": { "id": 1, "team_id": 1, "name": "string", "plan": "string", "base_image": "string", "git": { "provider": "string", "repo": "string", "ref": "string" }, "storage_gib": 1, "availability": "always", "restricted": true, "state": "creating", "status_detail": "string", "urls": { "ide": "string", "dev": "string" }, "dev_service": { "name": "string", "state": "running", "wake_seconds": 0, "needs": [ "string" ], "failing_needs": [ "string" ] }, "vault_id": 1, "single_node": true, "idle_timeout_minutes": 1, "last_archived_at": "2019-08-24T14:15:22Z", "restored_from": 1, "upgrade_pending": true, "created_by": 1, "owner_id": 1, "needs_owner": true, "permissions": [ "string" ], "created_at": "2019-08-24T14:15:22Z", "deleted_at": "2019-08-24T14:15:22Z", "purge_after": "2019-08-24T14:15:22Z" }, "operation": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "kind": "string", "state": "pending", "target": "string", "detail": "string", "error": { "type": "about:blank", "title": "string", "status": 100, "detail": "string", "instance": "string", "errors": [ { "pointer": "string", "line": 1, "column": 1, "message": "string", "code": "string", "subject": "string" } ], "held_by_deleted": { "workspaces": 0, "storage_gib": 0 }, "failed_team": { "id": 1, "name": "string", "reason": "string" } }, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "finished_at": "2019-08-24T14:15:22Z" }}Mint a preview URL for the Preview tab
The URL the Preview tab sets as its iframe `src`: a dev host of the workspace (`port`, default the entry host 3000) at `path` (default `/`). For a private host (the workspace is restricted) it is the host's `/__harthelm/enter?t=<token>` with a single-use token (60 s, audience = that host) that carries `path`: the router sets the workspace cookie, posts `harthelm:cookie-ok` or `harthelm:cookie-blocked` to the console and continues to `path`. For a public host it is the plain URL. The Preview tab falls back to a new tab when the cookie is blocked or the app refuses to be framed. A port without a dev host is 409 (nothing is served there). Needs `workspace.view`.
Delete a workspace
Soft-deletes the workspace: it stops, leaves the git proxy and its routes, and keeps its volume and rows until `purge_after` (7 days). `POST /workspaces/{ws}/restore` brings it back until then; its volume keeps counting against the team's storage quota unless a team admin purges it now (`POST /workspaces/{ws}/purge`).