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

# Preview a project source

> Shows what publishing a linked project's file at a commit would publish, without publishing it.



## OpenAPI

````yaml https://api.tinfoil.sh/openapi.yaml get /api/config-registry/v2/sources/preview
openapi: 3.2.0
info:
  title: Tinfoil Controlplane API
  version: 0.1.0
  description: >-
    Manage inference API keys, read usage and invoices, and manage Tinfoil
    confidential containers, their configuration, and the organization resources
    they use. Authenticate with an admin API key sent as a bearer token.
servers:
  - url: https://api.tinfoil.sh
security:
  - apiKey: []
tags:
  - name: Account
    description: >-
      The identity and organization behind the API key, and the token usage and
      invoices of the personal account or organization.
  - name: API keys
    parent: Account
    description: Inference API keys of the personal account or organization.
  - name: Containers
    description: Create, deploy, and stop confidential containers.
  - name: Container updates
    description: >-
      Move a container to a new release, and promote or cancel an update that is
      held for review.
  - name: Projects
    description: Groups of containers deployed from the same config source.
  - name: Volumes
    description: Encrypted persistent volumes that attach to containers.
  - name: Secrets
    description: >-
      Organization secrets available to containers, and secrets scoped to a
      single GitHub repository.
  - name: Access
    description: >-
      SSH public keys for attested SSH access to containers, custom domains that
      route to containers, and credentials for pulling images from private
      registries. An organization can store one ecr and one custom registry
      connection, each identified by its hostname.
  - name: GitHub & models
    description: >-
      Repository config and image builds through the Tinfoil GitHub app, and
      packaging Hugging Face models for use in containers. Packaging models
      requires a GPU entitlement or model access for the organization.
  - name: Config registry
    description: >-
      Publish tinfoil-config.yml revisions, read published configs, and resolve
      the endorsements that let clients verify them.
  - name: Bunkers
    description: Bunker owner keys and owner attestation.
paths:
  /api/config-registry/v2/sources/preview:
    get:
      tags:
        - Config registry
      summary: Preview a project source
      description: >-
        Shows what publishing a linked project's file at a commit would publish,
        without publishing it.
      operationId: previewRegistrySource
      parameters:
        - name: project
          in: query
          required: true
          description: Linked config project, as /org/project.
          schema:
            type: string
        - name: commit
          in: query
          required: false
          description: >-
            Full SHA of a commit on the default branch. Defaults to the head of
            the default branch.
          schema:
            type: string
            pattern: ^[0-9a-f]{40}$
      responses:
        '200':
          description: Preview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistrySourcePreview'
        '400':
          $ref: '#/components/responses/Error'
          description: >-
            Invalid request, no organization context, the project is not linked,
            or the file cannot be read at the commit
        '401':
          $ref: '#/components/responses/Error'
          description: Missing or invalid credentials
        '403':
          $ref: '#/components/responses/Error'
          description: Not permitted
        '500':
          $ref: '#/components/responses/Error'
          description: Server error
        '503':
          $ref: '#/components/responses/Error'
          description: The GitHub integration is unavailable
      security:
        - apiKey:
            - config-registry.publish
components:
  schemas:
    RegistrySourcePreview:
      type: object
      required:
        - project
        - source
        - digest
        - config
        - suggested_revision
        - changed
        - current
      properties:
        project:
          type: string
          description: Config project, as /org/project.
        source:
          $ref: '#/components/schemas/RegistryRevisionSource'
        digest:
          type: string
          description: >-
            Digest of the config the registry would store, as sha256:<hex>. When
            problem is set, the digest of the file as read.
        config:
          type: string
          format: byte
          description: >-
            The config the registry would store, base64-encoded. When problem is
            set, the file as read.
        suggested_revision:
          type: string
          description: >-
            The patch release after the project's highest vX.Y.Z revision, or
            v0.0.1 when it has none.
        changed:
          type: boolean
          description: >-
            Whether the config differs from the project's current revision. True
            when the project has none.
        current:
          type:
            - object
            - 'null'
          description: The project's current revision, or null when it has none.
          required:
            - name
            - digest
          properties:
            name:
              type: string
            digest:
              type: string
              description: Digest of the revision's config, as sha256:<hex>.
            source:
              $ref: '#/components/schemas/RegistryRevisionSource'
            published_with_key:
              $ref: '#/components/schemas/RegistryPublishedWithKey'
        problem:
          type: string
          description: >-
            Why the file cannot be published, such as a validation error. Absent
            when it can be.
    RegistryRevisionSource:
      type: object
      description: >-
        The repository file and commit a revision was published from, with the
        state of the commit's checks when it was read. Present only on revisions
        published from a commit, and only to the revision's owner.
      required:
        - repo
        - path
        - commit
        - checks
      properties:
        repo:
          type: string
          description: GitHub repository, as owner/name.
        path:
          type: string
          description: Path of the config file in the repository.
        commit:
          type: string
          description: Full commit SHA.
        checks:
          type: string
          enum:
            - passing
            - failing
            - pending
            - none
            - unknown
          description: >-
            State of the commit's GitHub Actions runs when it was read. It is
            recorded for reference and does not decide whether the commit can be
            published.
    RegistryPublishedWithKey:
      type: object
      description: >-
        The admin key a revision was published with. Present only when an admin
        key published it, and only to the revision's owner.
      required:
        - name
        - fingerprint
      properties:
        name:
          type: string
          description: Name of the admin key.
        fingerprint:
          type: string
          description: Hex SHA-256 digest of the admin key, the same as its public_id.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Stable machine-readable error code.
      additionalProperties: true
  responses:
    Error:
      description: The request failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An admin API key. Personal admin keys reach the API key, billing and
        Account endpoints for the creator's personal account; the other
        endpoints need an organization admin key. Security requirement entries
        list the permission a scoped key needs for the operation.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.