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

# Link a project source

> Links a config project to a Tinfoil config file in a connected GitHub repository. A linked project publishes only from commits of that file.



## OpenAPI

````yaml https://api.tinfoil.sh/openapi.yaml put /api/config-registry/v2/sources
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:
    put:
      tags:
        - Config registry
      summary: Link a project source
      description: >-
        Links a config project to a Tinfoil config file in a connected GitHub
        repository. A linked project publishes only from commits of that file.
      operationId: setRegistrySource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - project
                - repo
                - path
              properties:
                project:
                  type: string
                  description: >-
                    Config project, as /org/project, in one of the
                    organization's namespaces.
                repo:
                  type: string
                  description: GitHub repository, as owner/name.
                path:
                  type: string
                  maxLength: 255
                  description: >-
                    Path of a .yml, .yaml or .json file in the repository. Path
                    segments are letters, digits, periods, underscores and
                    hyphens.
      responses:
        '200':
          description: >-
            The link, with the file as it stands at the head of the default
            branch
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/RegistryProjectSource'
                  - type: object
                    required:
                      - head
                    properties:
                      head:
                        type: object
                        required:
                          - commit
                          - digest
                        properties:
                          commit:
                            type: string
                            description: Full SHA of the head of the default branch.
                          digest:
                            type: string
                            description: >-
                              Digest of the config the registry would store, as
                              sha256:<hex>.
        '400':
          $ref: '#/components/responses/Error'
          description: >-
            Invalid request, no organization context, or the file cannot be read
            through the organization's GitHub connection
        '401':
          $ref: '#/components/responses/Error'
          description: Missing or invalid credentials
        '403':
          $ref: '#/components/responses/Error'
          description: >-
            Not permitted, or the project's namespace or link belongs to another
            organization
        '500':
          $ref: '#/components/responses/Error'
          description: Server error
        '503':
          $ref: '#/components/responses/Error'
          description: >-
            Publishing is temporarily disabled, or the GitHub integration is
            unavailable
      security:
        - apiKey:
            - config-registry.source
components:
  schemas:
    RegistryProjectSource:
      type: object
      required:
        - project
        - repo
        - path
        - updated_by
        - updated_at
      properties:
        project:
          type: string
          description: Config project, as /org/project.
        repo:
          type: string
          description: GitHub repository, as owner/name.
        path:
          type: string
          description: Path of the config file in the repository.
        updated_by:
          type: string
          description: ID of the user who last set the link.
        updated_at:
          type: string
          format: date-time
    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.