Xata GitHub App API

Operations for managing GitHub App installation mappings

OpenAPI Specification

xata-github-app-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Xata API Keys GitHub App API
  description: Xata API
  version: '1.0'
  contact:
    name: help@xata.io
servers:
- url: https://api.xata.tech
  description: Xata API
tags:
- name: GitHub App
  description: Operations for managing GitHub App installation mappings
  x-displayName: GitHub App
paths:
  /organizations/{organizationID}/githubapp/installations:
    summary: GitHub App Installation Operations (organization-scoped)
    description: Manage GitHub App installations for an organization.
    get:
      operationId: listGithubAppInstallations
      summary: List GitHub App installations for organization
      description: Returns all GitHub App installations associated with the specified organization.
      parameters:
      - name: organizationID
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
      responses:
        '200':
          description: List of GitHub App installations
          content:
            application/json:
              schema:
                type: object
                properties:
                  installations:
                    description: Array of GitHub App installations
                    type: array
                    items:
                      $ref: '#/components/schemas/GithubInstallation'
                required:
                - installations
        '400':
          $ref: '#/components/responses/GenericError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        5XX:
          description: Unexpected Error
        default:
          description: Unexpected Error
      security:
      - xata:
        - project:read
      tags:
      - GitHub App
      x-excluded: true
    post:
      operationId: createGithubAppInstallation
      summary: Create GitHub App installation
      description: Creates a new GitHub App installation mapping for the specified organization.
      parameters:
      - name: organizationID
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGithubAppInstallationRequest'
      responses:
        '201':
          description: Installation created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GithubInstallation'
        '400':
          $ref: '#/components/responses/GenericError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '409':
          $ref: '#/components/responses/GenericError'
        5XX:
          description: Unexpected Error
        default:
          description: Unexpected Error
      security:
      - xata:
        - org:write
      tags:
      - GitHub App
      x-excluded: true
  /organizations/{organizationID}/githubapp/installations/{githubInstallationID}:
    summary: GitHub App Installation Operations by ID
    description: Manage a specific GitHub App installation.
    put:
      operationId: updateGithubAppInstallation
      summary: Update GitHub App installation
      description: Updates an existing GitHub App installation mapping.
      parameters:
      - name: organizationID
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
      - name: githubInstallationID
        in: path
        description: Unique identifier of the GitHub installation record
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGithubAppInstallationRequest'
      responses:
        '200':
          description: Installation updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GithubInstallation'
        '400':
          $ref: '#/components/responses/GenericError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/GenericError'
        '409':
          $ref: '#/components/responses/GenericError'
        5XX:
          description: Unexpected Error
        default:
          description: Unexpected Error
      security:
      - xata:
        - org:write
      tags:
      - GitHub App
      x-excluded: true
  /organizations/{organizationID}/projects/{projectID}/branches/{branchID}/githubapp/repository:
    summary: GitHub App Repository Operations
    description: Manage GitHub repository to Xata branch mappings.
    get:
      operationId: getGithubRepository
      summary: Get GitHub repository for branch
      description: Returns the GitHub repository mapping for the specified branch.
      parameters:
      - name: organizationID
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
      - name: projectID
        in: path
        description: Unique identifier of the project
        required: true
        schema:
          type: string
      - name: branchID
        in: path
        description: Unique identifier of the branch
        required: true
        schema:
          type: string
      responses:
        '200':
          description: GitHub repository mapping details
          content:
            application/json:
              schema:
                type: object
                properties:
                  mapping:
                    description: Repository mapping details, null if no mapping exists
                    $ref: '#/components/schemas/GithubRepository'
                    nullable: true
                required:
                - mapping
        '400':
          $ref: '#/components/responses/GenericError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        5XX:
          description: Unexpected Error
        default:
          description: Unexpected Error
      security:
      - xata:
        - project:read
      tags:
      - GitHub App
      x-excluded: true
    post:
      operationId: createGithubRepository
      summary: Create GitHub repository mapping
      description: Creates a new GitHub repository to Xata branch mapping.
      parameters:
      - name: organizationID
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
      - name: projectID
        in: path
        description: Unique identifier of the project
        required: true
        schema:
          type: string
      - name: branchID
        in: path
        description: Unique identifier of the branch
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGithubRepositoryRequest'
      responses:
        '201':
          description: Repository mapping created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GithubRepository'
        '400':
          $ref: '#/components/responses/GenericError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '409':
          $ref: '#/components/responses/GenericError'
        5XX:
          description: Unexpected Error
        default:
          description: Unexpected Error
      security:
      - xata:
        - project:write
      tags:
      - GitHub App
      x-excluded: true
    put:
      operationId: updateGithubRepository
      summary: Update GitHub repository mapping
      description: Updates an existing GitHub repository to Xata branch mapping.
      parameters:
      - name: organizationID
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
      - name: projectID
        in: path
        description: Unique identifier of the project
        required: true
        schema:
          type: string
      - name: branchID
        in: path
        description: Unique identifier of the branch
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGithubRepositoryRequest'
      responses:
        '200':
          description: Repository mapping updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GithubRepository'
        '400':
          $ref: '#/components/responses/GenericError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/GenericError'
        5XX:
          description: Unexpected Error
        default:
          description: Unexpected Error
      security:
      - xata:
        - project:write
      tags:
      - GitHub App
      x-excluded: true
    delete:
      operationId: deleteGithubRepository
      summary: Delete GitHub repository mapping
      description: Deletes the GitHub repository mapping for the specified branch.
      parameters:
      - name: organizationID
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
      - name: projectID
        in: path
        description: Unique identifier of the project
        required: true
        schema:
          type: string
      - name: branchID
        in: path
        description: Unique identifier of the branch
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Repository mapping deleted successfully
        '400':
          $ref: '#/components/responses/GenericError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/GenericError'
        5XX:
          description: Unexpected Error
        default:
          description: Unexpected Error
      security:
      - xata:
        - project:write
      tags:
      - GitHub App
      x-excluded: true
components:
  schemas:
    UpdateGithubRepositoryRequest:
      type: object
      properties:
        githubRepositoryID:
          description: GitHub repository ID
          type: integer
          format: int64
      required:
      - githubRepositoryID
    OrganizationID:
      title: OrganizationID
      type: string
      pattern: '[a-zA-Z0-9_-~:]+'
      x-oapi-codegen-extra-tags:
        validate: identifier
    CreateGithubAppInstallationRequest:
      type: object
      properties:
        installationId:
          description: GitHub App installation ID
          type: integer
          format: int64
      required:
      - installationId
    UpdateGithubAppInstallationRequest:
      type: object
      properties:
        installationId:
          description: GitHub App installation ID
          type: integer
          format: int64
      required:
      - installationId
    GithubRepository:
      description: A mapping between a GitHub repository and a Xata project
      type: object
      properties:
        id:
          description: Unique identifier of the mapping record
          type: string
        githubRepositoryID:
          description: GitHub repository ID
          type: integer
          format: int64
        project:
          description: Project ID this mapping is associated with
          type: string
        rootBranchId:
          description: ID of the root Xata branch mapped to this repository
          type: string
        createdAt:
          description: Timestamp when the mapping was created
          type: string
          format: date-time
        updatedAt:
          description: Timestamp when the mapping was last updated
          type: string
          format: date-time
      required:
      - id
      - githubRepositoryID
      - project
      - rootBranchId
      - createdAt
      - updatedAt
    CreateGithubRepositoryRequest:
      type: object
      properties:
        githubRepositoryID:
          description: GitHub repository ID
          type: integer
          format: int64
      required:
      - githubRepositoryID
    GithubInstallation:
      description: A GitHub App installation associated with an organization
      type: object
      properties:
        id:
          description: Unique identifier of the installation record
          type: string
        installationId:
          description: GitHub App installation ID
          type: integer
          format: int64
        organization:
          description: Organization ID this installation belongs to
          type: string
        createdAt:
          description: Timestamp when the installation was created
          type: string
          format: date-time
        updatedAt:
          description: Timestamp when the installation was last updated
          type: string
          format: date-time
      required:
      - id
      - installationId
      - organization
      - createdAt
      - updatedAt
  responses:
    GenericError:
      description: Generic error response for most error conditions
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                description: Error identifier for tracking and debugging
                type: string
              message:
                description: Human-readable error message explaining the issue
                type: string
            required:
            - message
    AuthorizationError:
      description: Error response when authentication or authorization fails
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                description: Error identifier for tracking and debugging
                type: string
              message:
                description: Human-readable error message explaining the authentication or authorization issue
                type: string
            required:
            - message
  securitySchemes:
    oidc:
      type: openIdConnect
      openIdConnectUrl: https://auth.xata.io/realms/xata/.well-known/openid-configuration
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key authentication using Bearer token format: Bearer <api_key>'
    xata:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://auth.xata.io/realms/xata/protocol/openid-connect/auth
          scopes:
            org:read: Read organization information
            org:write: Create and modify organizations
            keys:read: Read API keys
            keys:write: Create and manage API keys
            project:read: Read project information
            project:write: Create and modify projects
            branch:read: Read branch information
            branch:write: Create and modify branches
            metrics:read: Read metrics data
            logs:read: Read logs data
            credentials:read: Read credentials
            credentials:write: Rotate credentials
            marketplace:write: Register with cloud marketplaces
    branchConnectionString:
      type: apiKey
      in: header
      name: Connection-String
      description: Branch PostgreSQL connection string (`postgres://user:pass@{branch}.{region}.xata.tech/db`), including the embedded password. The hostname selects the target branch, region, and endpoint type (the `-rw`/`-ro` suffix, see `EndpointType`), and must match the request host. Obtain it from the Xata dashboard or the control-plane API. This is the only credential the gateway accepts; the control-plane API key (Bearer token) is rejected here. For the WebSocket endpoint (`GET /v2`) the same connection string is conveyed via the PostgreSQL startup message instead of this header.
externalDocs:
  url: https://xata.io/docs/api
x-tagGroups:
- name: Authentication API
  tags:
  - Organizations
  - Users
  - API Keys
  - Marketplace
  - Billing
  - Webhooks
- name: Gateway API
  tags:
  - Gateway
- name: Projects API
  tags:
  - Projects Webhooks
  - Projects
  - Branches
  - GitHub App
  - Metrics
  - Logs