> ## Documentation Index
> Fetch the complete documentation index at: https://code.storage/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Repo

> Permanently retire a repository. The API performs a soft delete first and then triggers asynchronous hot and cold storage cleanup.
#### JWT claims
Required scopes: `repo:write`  
Requires per repo scope: Yes

Deprecated: Use `/api/repos/{repo_name}` instead.



## OpenAPI

````yaml https://api.pierre.code.storage/api/openapi.json delete /api/v1/repos/delete
openapi: 3.1.0
info:
  description: >-
    The Code Storage HTTP API exposes repository management, Git reads, and
    write workflows over plain HTTPS.


    ## Authentication


    Send a signed JWT in the `Authorization: Bearer <token>` header on every
    request.


    - Organisation-scoped endpoints such as `GET /api/repos` require
    organisation scopes like `org:read`

    - Repository-scoped endpoints require a JWT whose `repo` claim names the
    target repository

    - Write operations require the relevant scope such as `git:write` or
    `repo:write`


    ## Pagination


    List endpoints use cursor-based pagination.


    - `cursor` is an opaque token returned by the previous response

    - `limit` defaults to `20` and is capped per endpoint

    - `has_more` tells you whether another request is available

    - `next_cursor` becomes the next `cursor` value


    ## Paths


    Preferred routes use the shorter `/api/...` form. Legacy `/api/v1/...`
    aliases remain documented where they are still supported and are marked as
    deprecated when a preferred route exists.


    ## Repository names in paths


    - Names containing `/` (or any other character that is not safe in a URL
    path segment) **must** be URL encoded so the value occupies a single path
    segment. For example, `pierre/example` becomes `pierre%2Fexample` and the
    request URL is `/api/repos/pierre%2Fexample/...`.

    - Plain names that contain only URL-safe characters can be sent as-is:
    `/api/repos/dotfiles/...`.

    - The server URL-decodes the value before resolving the repository, so
    double-encoding is not required.


    ## Errors


    Most endpoints return RFC 9457-compatible problem details under
    `application/problem+json`, with a legacy `error` field mirrored from
    `detail`.


    Streaming commit and note workflows may return operation-specific failure
    bodies so callers can inspect partial results, branch state, or workflow
    status without parsing generic error strings.
  title: code.storage
  version: 1.0.0
servers:
  - description: Code Storage tenant cluster
    url: https://api.{cluster}.code.storage
    variables:
      cluster:
        default: cluster
        description: >-
          Tenant cluster identifier (e.g. pierre-dev, pierre-staging,
          pierre-prod).
security: []
tags:
  - description: Create, inspect, update, delete, and synchronise repositories.
    name: Repositories
  - description: Create, delete, list, and compare branches.
    name: Branches
  - description: >-
      Read commit metadata and diffs, or create commits without a local Git
      client.
    name: Commits
  - description: >-
      Read repository trees, file contents, archives, and server-side search
      results.
    name: Files
  - description: List, create, and delete Git tags.
    name: Tags
  - description: Attach and retrieve Git notes for commits or other Git objects.
    name: Notes
  - description: >-
      Trigger upstream synchronisation for repositories backed by an external
      source.
    name: Sync
  - description: Manage generic HTTPS Git credentials for non-GitHub upstreams.
    name: Credentials
paths:
  /api/v1/repos/delete:
    delete:
      tags:
        - Repositories
      summary: Delete Repo
      description: >-
        Permanently retire a repository. The API performs a soft delete first
        and then triggers asynchronous hot and cold storage cleanup.

        #### JWT claims

        Required scopes: `repo:write`  

        Requires per repo scope: Yes


        Deprecated: Use `/api/repos/{repo_name}` instead.
      operationId: delete_repo_legacy
      responses:
        '200':
          content:
            application/json:
              example:
                message: >-
                  Repository repo_7f2b3d9 deletion initiated. Physical storage
                  cleanup will complete asynchronously.
                repo_id: repo_7f2b3d9
              schema:
                additionalProperties: false
                description: Confirmation that the repository deletion has been accepted.
                properties:
                  message:
                    description: Human-readable deletion status message.
                    examples:
                      - >-
                        Repository repo_7f2b3d9 deletion initiated. Physical
                        storage cleanup will complete asynchronously.
                    type: string
                  repo_id:
                    description: Internal repository ID.
                    examples:
                      - repo_7f2b3d9
                    type: string
                required:
                  - repo_id
                  - message
                type: object
          description: >-
            Deletion accepted. Physical storage cleanup continues
            asynchronously.
        '400':
          content:
            application/json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
            application/problem+json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
            application/problem+json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
            application/problem+json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
            application/problem+json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
          description: Not Found
        '409':
          content:
            application/json:
              example:
                detail: repository already deleted
                error: repository already deleted
                instance: /api/repos/dotfiles
                status: 409
                title: Conflict
                type: about:blank
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
            application/problem+json:
              example:
                detail: repository already deleted
                error: repository already deleted
                instance: /api/repos/dotfiles
                status: 409
                title: Conflict
                type: about:blank
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
          description: The repository was already deleted.
        '429':
          content:
            application/json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
            application/problem+json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
            application/problem+json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
            application/problem+json:
              schema:
                additionalProperties: false
                description: >-
                  RFC 9457-compatible problem details payload describing the
                  error response.
                properties:
                  detail:
                    description: >-
                      A human-readable explanation specific to this occurrence
                      of the problem.
                    type: string
                  error:
                    description: >-
                      Legacy compatibility field mirroring `detail` for older
                      clients.
                    type: string
                  instance:
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem.
                    type: string
                  status:
                    description: >-
                      The HTTP status code generated by the origin server for
                      this occurrence of the problem.
                    format: int64
                    type: integer
                  title:
                    description: A short, human-readable summary of the problem type.
                    type: string
                  type:
                    description: >-
                      A URI reference that identifies the problem type.
                      `about:blank` indicates the generic HTTP status semantics
                      apply.
                    type: string
                required:
                  - type
                  - title
                  - status
                type: object
          description: Service Unavailable
      deprecated: true
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````