Delete a repository
Delete a repository.
/repos/{owner}/{name}Owners only, and confirm must be its full name, owner/name. It disappears at once: git refuses it, agents and workflows stop, its deployments are taken down, and search drops it. For 30 days an owner can restore it with restore_repo, as it was; then it is purged, its git data with it. Its name stays taken until it is purged. list_deleted_repos shows what can be restored.
The deleted repository and when it will be purged, 30 days on. Owners of the workspace only (403), whatever their role on the repository. Refused with 422 when confirm is not its full name. Its name stays taken until it is purged. See Delete a repository.
- Authentication: Required. Send an access token as
Authorization: Bearer. - MCP tool:
delete_repo, with the same inputs
Path parameters
Section titled “Path parameters”| Name | Type | Required | Description |
|---|---|---|---|
owner |
string | Yes | The workspace that owns the repository. |
name |
string | Yes | The repository’s name. |
Body parameters
Section titled “Body parameters”Send a JSON object. Names are snake_case, as in responses; the camelCase spelling is accepted too.
| Name | Type | Required | Description |
|---|---|---|---|
confirm |
string | Yes | Its full name, owner/name, typed out, to confirm. |
Example request
Section titled “Example request”curl -X DELETE https://api.g1t.sh/repos/flagon-io/hello \ -H "Authorization: Bearer $G1T_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "confirm": "flagon-io/hello" }'Example response
Section titled “Example response”A successful request answers 200 with:
{ "id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "namespace": "flagon-io", "name": "hello", "description": "A tiny service that says hello.", "is_private": false, "deleted_at": "2026-10-05T09:30:00.000Z", "deleted_by": "syntaqx", "purge_after": "2026-11-04T09:30:00.000Z"}Errors
Section titled “Errors”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. |