Skip to content
POST/workspaces

A workspace owns repositories and is the first part of their address: g1t.sh/{workspace}/{repo}. The whoami tool lists the ones you already belong to.

base_permission is what every member gets on each of its repositories: write until an owner changes it with PATCH /workspaces/{workspace}. See Access and roles.

Send a JSON object. Names are snake_case, as in responses; the camelCase spelling is accepted too.

Name Type Required Description
slug string Yes Its name in URLs: lowercase letters, digits and single hyphens.
name string No A display name.
curl -X POST https://api.g1t.sh/workspaces \
-H "Authorization: Bearer $G1T_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "acme-labs",
"name": "Acme Labs"
}'

A successful request answers 200 with:

{
"id": "wsp_01m43teqa9em6bje0bhvdj4jkb",
"slug": "acme-labs",
"name": "Acme Labs",
"description": null,
"created_at": "2026-10-04T16:02:51.337Z",
"member_count": 1,
"base_permission": "write"
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository.
404 not_found It does not exist, or you cannot see it.
409 conflict The request conflicts with the current state.
422 invalid The input is not valid. message says which field and why.