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

# Webhook endpoint called by GitHub on events related to Cantina GitHub App.

> The endpoint is publicly accessible so that it is reachable by GitHub.

Payload verification (Webhook HMAC) is done to ensure we are only processing messages from GitHub.

# Access control rules

- Publicly accessible.



## OpenAPI

````yaml POST /api/v0/companies/github/webhook
openapi: 3.1.0
info:
  title: Cantina Client API
  description: >-
    Endpoints available to client organizations. For an overview and
    authentication, see
    https://docs.cantina.xyz/for-organizations/getting-started/api-access.
  license:
    name: Cantina
    identifier: Cantina
  version: 0.1.0
servers: []
security: []
paths:
  /api/v0/companies/github/webhook:
    post:
      tags:
        - companies
      summary: >-
        Webhook endpoint called by GitHub on events related to Cantina GitHub
        App.
      description: >-
        The endpoint is publicly accessible so that it is reachable by GitHub.


        Payload verification (Webhook HMAC) is done to ensure we are only
        processing messages from GitHub.


        # Access control rules


        - Publicly accessible.
      operationId: github_webhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GithubEventPayload'
        required: true
      responses:
        '202':
          description: GitHub event accepted but not processed
        '204':
          description: GitHub event processed successfully
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '404':
          description: Not found. This can also be due to requester not having permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '500':
          description: Error processing GitHub event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    GithubEventPayload:
      type: object
      required:
        - installation
      properties:
        installation:
          $ref: '#/components/schemas/GithubAppInstallation'
        account:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/GithubAccount'
        changes:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/GithubChanges'
    CantinaError:
      type: object
      description: Error returned by the Cantina API.
      required:
        - type
        - msg
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        msg:
          type: string
          description: Error message for the user.
    GithubAppInstallation:
      type: object
      required:
        - id
        - target_type
      properties:
        id:
          type: integer
          format: int64
          description: The installation id.
          minimum: 0
        target_type:
          type: string
          description: The type of target (Organization or User).
    GithubAccount:
      type: object
      required:
        - avatar_url
        - html_url
        - login
      properties:
        avatar_url:
          type: string
        html_url:
          type: string
        login:
          type: string
    GithubChanges:
      type: object
      properties:
        login:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/GithubChangesDiff'
    ErrorType:
      type: string
      description: Type of error.
      enum:
        - email_not_verified
        - auth_invalid
        - auth_expired
        - auth_token_missing
        - auth_id_missing
        - invalid_password
        - disabled_user
        - tc_not_accepted
        - evicted
        - unauthorized
        - bad_request
        - not_found
        - forbidden
        - gone
        - payload_too_large
        - service_unavailable
        - internal_error
    GithubChangesDiff:
      type: object

````