---
title: "POST /api/v1/app-connections/github"
method: POST
path: "/api/v1/app-connections/github"
tags: ["App Connections"]
---

# POST /api/v1/app-connections/github

`POST /api/v1/app-connections/github`

Create a GitHub Connection.

## Request body

- union
  - object
    - `method` 'github-app', required — The method used to authenticate with GitHub.
    - `credentials` union, required — The credentials used to connect with GitHub.
      - object
        - `code` string, required
        - `installationId` string, required
        - `gitHubAppId` string, uuid, nullable
        - `instanceType` 'server', required
        - `host` string, required
      - object
        - `code` string, required
        - `installationId` string, required
        - `gitHubAppId` string, uuid, nullable
        - `instanceType` 'cloud'
        - `host` string
    - `name` string, required — The name of the GitHub Connection to create. Must be slug-friendly.
    - `description` string, nullable — An optional description for the GitHub Connection.
    - `projectId` string — The ID of the project to create the GitHub Connection in.
    - `isPlatformManagedCredentials` false — Not supported for GitHub Connections.
    - `gatewayId` string, uuid, nullable — The Gateway ID to use for this connection.
    - `gatewayPoolId` string, uuid, nullable — The Gateway Pool ID to use for this connection.
    - `isAutoRotationEnabled` false — Not supported for GitHub Connections.
    - `rotation` 'null', nullable — Not supported for GitHub Connections.
  - object
    - `method` 'oauth', required — The method used to authenticate with GitHub.
    - `credentials` union, required — The credentials used to connect with GitHub.
      - object
        - `code` string, required
        - `instanceType` 'server', required
        - `host` string, required
      - object
        - `code` string, required
        - `instanceType` 'cloud'
        - `host` string
    - `name` string, required — The name of the GitHub Connection to create. Must be slug-friendly.
    - `description` string, nullable — An optional description for the GitHub Connection.
    - `projectId` string — The ID of the project to create the GitHub Connection in.
    - `isPlatformManagedCredentials` false — Not supported for GitHub Connections.
    - `gatewayId` string, uuid, nullable — The Gateway ID to use for this connection.
    - `gatewayPoolId` string, uuid, nullable — The Gateway Pool ID to use for this connection.
    - `isAutoRotationEnabled` false — Not supported for GitHub Connections.
    - `rotation` 'null', nullable — Not supported for GitHub Connections.
  - object
    - `method` 'pat', required — The method used to authenticate with GitHub.
    - `credentials` union, required — The credentials used to connect with GitHub.
      - object
        - `personalAccessToken` string, required
        - `instanceType` 'server', required
        - `host` string, required
      - object
        - `personalAccessToken` string, required
        - `instanceType` 'cloud'
        - `host` string
    - `name` string, required — The name of the GitHub Connection to create. Must be slug-friendly.
    - `description` string, nullable — An optional description for the GitHub Connection.
    - `projectId` string — The ID of the project to create the GitHub Connection in.
    - `isPlatformManagedCredentials` false — Not supported for GitHub Connections.
    - `gatewayId` string, uuid, nullable — The Gateway ID to use for this connection.
    - `gatewayPoolId` string, uuid, nullable — The Gateway Pool ID to use for this connection.
    - `isAutoRotationEnabled` false — Not supported for GitHub Connections.
    - `rotation` 'null', nullable — Not supported for GitHub Connections.

## Response `200`

Default Response

- object
  - `appConnection` union, required
    - object
      - `id` string, uuid, required
      - `name` string, required
      - `description` string, nullable
      - `version` number
      - `orgId` string, uuid, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `isPlatformManagedCredentials` boolean, nullable
      - `gatewayId` string, uuid, nullable
      - `projectId` string, nullable
      - `isAutoRotationEnabled` boolean
      - `gatewayPoolId` string, uuid, nullable
      - `rotation` object — The credential rotation configuration, if configured.
        - `lastRotationMessage` string, nullable — The message from the last rotation attempt.
        - `rotationInterval` number, required — The interval in days between credential rotations.
        - `nextRotationAt` string, date-time, nullable — The next scheduled rotation time.
        - `rotationStatus` 'success' | 'failed', required — The status of the last rotation attempt.
        - `rotateAtUtc` object, required — The UTC time of day at which rotation should occur.
          - `hours` number, required — The hour (0-23) at which to rotate.
          - `minutes` number, required — The minute (0-59) at which to rotate.
      - `credentialsHash` string
      - `project` object, nullable
        - `name` string, required
        - `id` string, required
        - `type` string, required
        - `slug` string, required
      - `app` 'github', required
      - `method` 'github-app', required
      - `credentials` object, required
        - `instanceType` union
          - 'server'
          - 'cloud'
        - `host` string
        - `gitHubAppId` string, uuid, nullable
    - object
      - `id` string, uuid, required
      - `name` string, required
      - `description` string, nullable
      - `version` number
      - `orgId` string, uuid, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `isPlatformManagedCredentials` boolean, nullable
      - `gatewayId` string, uuid, nullable
      - `projectId` string, nullable
      - `isAutoRotationEnabled` boolean
      - `gatewayPoolId` string, uuid, nullable
      - `rotation` object — The credential rotation configuration, if configured.
        - `lastRotationMessage` string, nullable — The message from the last rotation attempt.
        - `rotationInterval` number, required — The interval in days between credential rotations.
        - `nextRotationAt` string, date-time, nullable — The next scheduled rotation time.
        - `rotationStatus` 'success' | 'failed', required — The status of the last rotation attempt.
        - `rotateAtUtc` object, required — The UTC time of day at which rotation should occur.
          - `hours` number, required — The hour (0-23) at which to rotate.
          - `minutes` number, required — The minute (0-59) at which to rotate.
      - `credentialsHash` string
      - `project` object, nullable
        - `name` string, required
        - `id` string, required
        - `type` string, required
        - `slug` string, required
      - `app` 'github', required
      - `method` 'oauth', required
      - `credentials` object, required
        - `instanceType` union
          - 'server'
          - 'cloud'
        - `host` string
    - object
      - `id` string, uuid, required
      - `name` string, required
      - `description` string, nullable
      - `version` number
      - `orgId` string, uuid, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `isPlatformManagedCredentials` boolean, nullable
      - `gatewayId` string, uuid, nullable
      - `projectId` string, nullable
      - `isAutoRotationEnabled` boolean
      - `gatewayPoolId` string, uuid, nullable
      - `rotation` object — The credential rotation configuration, if configured.
        - `lastRotationMessage` string, nullable — The message from the last rotation attempt.
        - `rotationInterval` number, required — The interval in days between credential rotations.
        - `nextRotationAt` string, date-time, nullable — The next scheduled rotation time.
        - `rotationStatus` 'success' | 'failed', required — The status of the last rotation attempt.
        - `rotateAtUtc` object, required — The UTC time of day at which rotation should occur.
          - `hours` number, required — The hour (0-23) at which to rotate.
          - `minutes` number, required — The minute (0-59) at which to rotate.
      - `credentialsHash` string
      - `project` object, nullable
        - `name` string, required
        - `id` string, required
        - `type` string, required
        - `slug` string, required
      - `app` 'github', required
      - `method` 'pat', required
      - `credentials` object, required
        - `instanceType` union
          - 'server'
          - 'cloud'
        - `host` string

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/infisical/apis/infisical-api.md) · [All operations](https://skmtc.net/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infisical/infisical-api/versions/885aef3e6c11/schema)
