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

# Save the tenant code repository configuration

> Validates the connection when `enabled` (token can push, branch exists — verified via the repository `permissions` block, no probe commits) and persists the configuration.



## OpenAPI

````yaml /openapi.yaml put /api/v1/code-repo
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.11.3
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/code-repo:
    put:
      tags:
        - Code repository
      summary: Save the tenant code repository configuration
      description: >-
        Validates the connection when `enabled` (token can push, branch exists —
        verified via the repository `permissions` block, no probe commits) and
        persists the configuration.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CodeRepoConfig'
      responses:
        '200':
          description: The saved configuration
        '400':
          description: >-
            Validation failed (bad repo, token lacks push access, missing
            branch, or missing token secret)
        '500':
          description: Error
components:
  schemas:
    CodeRepoConfig:
      type: object
      properties:
        name:
          type: string
          description: Always `default` — one repository per tenant
        provider:
          type: string
          description: Repository provider (`github`)
        repo:
          type: string
          description: Repository in `owner/repo` form
        apiBaseUrl:
          type: string
          description: >-
            API endpoint; override for GitHub Enterprise Server (e.g.
            `https://ghes.example.com/api/v3`)
        branch:
          type: string
        pathPrefix:
          type: string
          description: Script path becomes `{pathPrefix}{tapName}.py`
        authSecretName:
          type: string
          description: >-
            Vault secret (tagged `_type=repo_token`) holding a `token` field.
            The token itself is never returned by the API.
        commitAuthor:
          type: string
          description: Commit author in `Name <email>` form
        commitMessageTemplate:
          type: string
          description: 'Commit message template. Tokens: {name}, {action}, {user}'
        enabled:
          type: boolean
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````