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

# Archive

> Download a repository snapshot without cloning the repo. This is useful for packaging docs, examples, or release artefacts directly from a branch, tag, or commit.
#### JWT claims
Required scopes: `git:read`  
Requires per repo scope: Yes



## OpenAPI

````yaml https://api.pierre.code.storage/api/openapi.json post /api/repos/{repo_name}/archive
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/repos/{repo_name}/archive:
    post:
      tags:
        - Files
      summary: Archive
      description: >-
        Download a repository snapshot without cloning the repo. This is useful
        for packaging docs, examples, or release artefacts directly from a
        branch, tag, or commit.

        #### JWT claims

        Required scopes: `git:read`  

        Requires per repo scope: Yes
      operationId: archive
      parameters:
        - description: >-
            Repository name. Names that contain `/` 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` is sent
            as `pierre%2Fexample`. Plain names such as `example` can be sent
            as-is. The server URL-decodes the value before resolving the
            repository.
          example: my-demo-repository
          in: path
          name: repo_name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            examples:
              docs_snapshot:
                description: Download just the docs tree with a prefixed root folder.
                summary: Filtered documentation snapshot
                value:
                  archive:
                    prefix: sdk-docs/
                  exclude_globs:
                    - '**/drafts/**'
                  include_globs:
                    - docs/**
                    - README.md
                  ref: main
            schema:
              additionalProperties: false
              description: >-
                Archive options describing the ref to snapshot and the include
                or exclude filters applied to the resulting tarball.
              properties:
                archive:
                  additionalProperties: false
                  description: Optional archive output settings.
                  properties:
                    prefix:
                      description: Prefix to add to every file path inside the archive.
                      type: string
                  type: object
                exclude_globs:
                  description: >-
                    Exclude files matching these glob patterns after include
                    filtering.
                  items:
                    description: Glob pattern such as `node_modules/**`.
                    type: string
                  type: array
                include_globs:
                  description: Only include files matching these glob patterns.
                  items:
                    description: Glob pattern such as `src/**/*.go`.
                    type: string
                  type: array
                max_blob_size:
                  description: Maximum blob size to include in the archive, in bytes.
                  format: int64
                  type: integer
                ref:
                  description: >-
                    Branch, tag, or commit to archive. When omitted, the default
                    branch or HEAD is used.
                  type: string
              required:
                - ref
              type: object
        description: >-
          Request a `.tar.gz` snapshot of the repository at a branch, tag, or
          commit. Include and exclude globs let you shape the archive before it
          streams back.
      responses:
        '200':
          content:
            application/gzip:
              schema:
                contentMediaType: application/octet-stream
                description: Gzip-compressed tar archive stream.
                format: binary
                type: string
          description: A streamed `.tar.gz` archive of the resolved revision.
          headers:
            Cache-Control:
              description: Archive downloads are returned with `no-store`.
              schema:
                type: string
            Content-Disposition:
              description: >-
                Attachment filename generated from the repository URL and
                resolved revision.
              schema:
                type: string
        '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:
              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: Conflict
        '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
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````