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

# Get application repository

> Retrieve metadata about the Git repository connected to an application: the source type, Git provider, repository URL, default branch, and the commit currently running (from the latest successful deployment). Call this first to discover the deployed commit SHA, then pass it as the `ref` to the tree and contents endpoints to inspect exactly the code that is running. Only applications with a `privateGit` or `publicGit` source have a repository; `dockerImage` and internally created apps return 422.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json get /applications/{id}/repository
openapi: 3.1.0
info:
  title: Sevalla API docs
  version: 1.0.0
servers:
  - url: https://api.sevalla.com/v3
security:
  - bearerAuth: []
paths:
  /applications/{id}/repository:
    get:
      tags:
        - Applications
      summary: Get application repository
      description: >-
        Retrieve metadata about the Git repository connected to an application:
        the source type, Git provider, repository URL, default branch, and the
        commit currently running (from the latest successful deployment). Call
        this first to discover the deployed commit SHA, then pass it as the
        `ref` to the tree and contents endpoints to inspect exactly the code
        that is running. Only applications with a `privateGit` or `publicGit`
        source have a repository; `dockerImage` and internally created apps
        return 422.
      operationId: getApplicationRepositoryV3
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            example: fb5e5168-4281-4bec-94c5-0d1584e9e657
          in: path
          name: id
          required: true
          description: Application identifier
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  source:
                    type: string
                    enum:
                      - privateGit
                      - publicGit
                      - dockerImage
                      - app
                    description: >-
                      Where the application source code comes from. `privateGit`
                      - private Git repository connected via OAuth. `publicGit`
                      - public Git repository URL.
                    example: privateGit
                  git_type:
                    type: string
                    enum:
                      - github
                      - bitbucket
                      - gitlab
                    description: >-
                      Git hosting provider for the repository. `github` -
                      GitHub. `bitbucket` - Bitbucket. `gitlab` - GitLab.
                    example: github
                  repo_url:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Full URL of the Git repository
                    example: https://github.com/acme/my-app
                  default_branch:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Default branch configured for deployments
                    example: main
                  deployed_commit:
                    anyOf:
                      - type: object
                        properties:
                          sha:
                            type: string
                            description: >-
                              Commit SHA currently running, taken from the
                              latest successful deployment
                            example: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
                          message:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: Commit message
                            example: Fix login redirect
                          author_login:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: Commit author login
                            example: octocat
                        required:
                          - sha
                          - message
                          - author_login
                        additionalProperties: false
                      - type: 'null'
                    description: >-
                      The commit currently deployed from the app's current
                      repository. Null if the application has never deployed
                      successfully, or if its repository was changed after the
                      last successful deployment (the deployed commit belongs to
                      the old repo and no longer applies).
                required:
                  - source
                  - git_type
                  - repo_url
                  - default_branch
                  - deployed_commit
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unauthorized
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 401
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Forbidden
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 403
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Not found
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 404
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unprocessable entity
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 422
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Too many requests
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 429
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Internal Server Error
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 500
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Pass your API key as a Bearer token in the
        Authorization header.

````