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

# Get the linked repository

> The link and its last deploy. Never returns the webhook secret.



## OpenAPI

````yaml /openapi.json get /v1/functions/{functionId}/git-link
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    location requests, and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url,
    location_request, reaction, template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram/Messenger)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/functions/{functionId}/git-link:
    get:
      tags:
        - Functions
      summary: Get the linked repository
      description: The link and its last deploy. Never returns the webhook secret.
      operationId: getFunctionGitLink
      parameters:
        - $ref: '#/components/parameters/FunctionIdParam'
      responses:
        '200':
          description: The link.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GitRepoLinkResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No repository is linked to this function.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    FunctionIdParam:
      name: functionId
      in: path
      required: true
      description: Zavu Function ID.
      schema:
        type: string
  schemas:
    GitRepoLinkResponse:
      type: object
      required:
        - link
        - webhookUrl
      properties:
        link:
          $ref: '#/components/schemas/GitRepoLink'
        webhookUrl:
          type: string
          format: uri
          description: >-
            Endpoint that receives GitHub's push deliveries. Only needed on a
            `manual` link, where you add it to the repository yourself.
        webhookSecret:
          type: string
          description: >-
            Shared secret for the repository's webhook. **Returned only when
            creating a `manual` link, and only there** — every later read strips
            it, and re-linking mints a new one. Absent entirely on an `app`
            link, which needs no secret of its own.
          example: ghs_a1b2c3...
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    GitRepoLink:
      type: object
      description: >-
        A GitHub repository bound to a function. A push to `branch` deploys the
        function. A function holds at most one link.
      required:
        - id
        - functionId
        - provider
        - owner
        - repo
        - branch
        - autoDeploy
        - connection
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        functionId:
          type: string
        provider:
          type: string
          enum:
            - github
        owner:
          type: string
          example: acme
        repo:
          type: string
          example: order-bot
        branch:
          type: string
          description: Only pushes to this branch deploy.
          example: main
        rootDir:
          type: string
          nullable: true
          description: >-
            Subdirectory holding the project, for monorepos. Null when the
            project is at the repository root.
        autoDeploy:
          type: boolean
          description: When false the link is kept and pushes are ignored.
        connection:
          type: string
          description: >-
            How this link authenticates, decided by the server rather than by
            the caller.

            - `app`: the Zavu GitHub App is installed on the account. Pushes
            arrive on the app's webhook and private repositories work. Nothing
            to configure in the repository.

            - `manual`: no installation. The link carries its own secret and you
            add the webhook to the repository yourself.
          enum:
            - app
            - manual
        lastStatus:
          type: string
          nullable: true
          enum:
            - deploying
            - deployed
            - failed
            - null
        lastCommitSha:
          type: string
          nullable: true
        lastCommitMessage:
          type: string
          nullable: true
        lastError:
          type: string
          nullable: true
          description: Why the last deploy failed. Null otherwise.
        lastDeployAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````