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

# Get Repo

> Fetch repository metadata for the repository identified by the JWT `repo` claim.
#### JWT claims
Required scopes: `git:read`  
Requires per repo scope: Yes



## OpenAPI

````yaml https://api.pierre.code.storage/api/openapi.json get /api/repos/{repo_name}
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}:
    get:
      tags:
        - Repositories
      summary: Get Repo
      description: >-
        Fetch repository metadata for the repository identified by the JWT
        `repo` claim.

        #### JWT claims

        Required scopes: `git:read`  

        Requires per repo scope: Yes
      operationId: get_repo
      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
      responses:
        '200':
          content:
            application/json:
              example:
                base_repo:
                  name: Hello-World
                  owner: octocat
                  provider: github
                created_at: '2024-01-15T10:30:00Z'
                default_branch: main
                repo_id: repo_7f2b3d9
                url: team/project-alpha
              schema:
                additionalProperties: false
                description: >-
                  Detailed view of a single repository, including any Git Sync
                  configuration.
                properties:
                  base_repo:
                    additionalProperties: false
                    description: Git Sync configuration (if configured).
                    properties:
                      name:
                        description: Upstream repository name.
                        examples:
                          - Hello-World
                        type: string
                      owner:
                        description: Upstream repository owner or namespace.
                        examples:
                          - octocat
                        type: string
                      provider:
                        description: Upstream provider name.
                        examples:
                          - github
                        type: string
                    required:
                      - provider
                    type: object
                  created_at:
                    description: ISO 8601 creation timestamp.
                    examples:
                      - '2024-01-15T10:30:00Z'
                    type: string
                  default_branch:
                    description: Default branch name.
                    examples:
                      - main
                    type: string
                  repo_id:
                    description: Internal repository ID.
                    examples:
                      - repo_7f2b3d9
                    type: string
                  url:
                    description: Repository URL path. Matches the JWT repo claim.
                    examples:
                      - team/project-alpha
                    type: string
                required:
                  - repo_id
                  - url
                  - default_branch
                  - created_at
                type: object
          description: Repository metadata resolved from the JWT `repo` claim.
        '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

````