# Delete a repository

> Delete a repository.

<div class="g1t-endpoint"><span class="g1t-method" data-method="delete">DELETE</span><code>/repos/{owner}/{name}</code></div>

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`](/reference/api/repositories/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`](/reference/api/repositories/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](/guides/managing-repositories/#delete-a-repository).

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`repository`](/reference/mcp/#repository) with `action` `delete`, and the same inputs
- **Scope:** An access token needs [`repo:admin`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner` | string | Yes | The workspace that owns the repository. |
| `name` | string | Yes | The repository's name. |

## 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

```sh
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

A successful request answers `200` with:

```json
{
  "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

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#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. |
