---
title: "🔒 Создание новой интеграции с Git-сервисом (GitLab, GitHub). Для GitHub App требуется installationId и подписанный state из github/install; компания берётся из сессии."
method: POST
path: "/integration/git/create"
tags: ["Integrations: Git"]
---

# 🔒 Создание новой интеграции с Git-сервисом (GitLab, GitHub). Для GitHub App требуется installationId и подписанный state из github/install; компания берётся из сессии.

`POST /integration/git/create`

## Request

- Base URL: `http://localhost`
- URL: `http://localhost/integration/git/create`
- Auth: one of:
  - API key in header `sid` and API key in header `rts` and API key in header `sig`
  - HTTP bearer

Создание новой интеграции с Git-сервисом (GitLab, GitHub). Для GitHub App требуется installationId и подписанный state из github/install; компания берётся из сессии.

**Access:** `authorized` (10 ) · **Scope:** `write`

**Allows:** `integration:git` (все обязательны; без ресурса)

### TypeScript (copy-paste)

**`POST /integration/git/create`**

<details open><summary><b>Body</b></summary>

```typescript
export interface IntegrationGitCreateBody {
  ID?: string | null
  type: GitIntegration_Type
  title?: string | null
  params?: {
  host?: string | null
  port?: number | null
  requestTimeout?: number | null
  token?: string | null
} | null
  installationId?: number | null
  state?: string | null
  autoProvisionUsers?: boolean | null
  adminActions?: {
  blockUsers?: boolean | null
  systemHook?: boolean | null
} | null
}
```

</details>

<details open><summary><b>Response</b></summary>

```typescript
export type IntegrationGitCreateResponse = IServerResponse<Resp_integration_git_create>

export interface IServerResponse<T = any> {
  code: number
  data: T
  srvTS: number
  rkey: string
}
```

</details>

> Полный файл типов: [`/docs/types`](/docs/types) · raw: [`/docs/api-types.ts`](/docs/api-types.ts)

## Headers

- `devID` string, uuid, required
- `tz` string, required
- `app` string, required
- `appVer` string, required
- `rKey` string

## Request body

- IntegrationGitCreateBody: JSON body for `integration/git/create`
  - `ID` string, uuid, nullable
  - `type` 'GitLab' | 'GitHub', required: `gitlab` = "GitLab", `github` = "GitHub"
  - `title` string, nullable
  - `params` object, nullable
    - `host` string, nullable
    - `port` integer, nullable
    - `requestTimeout` integer, nullable
    - `token` string, nullable
  - `installationId` integer, nullable
  - `state` string, nullable
  - `autoProvisionUsers` boolean, nullable
  - `adminActions` object, nullable
    - `blockUsers` boolean, nullable
    - `systemHook` boolean, nullable

## Response `200`

OK — `IServerResponse<Resp_integration_git_create>`

- object
  - `code` integer, required
  - `data` RespIntegrationGitCreate, required: ResponseData for integration/git/create
    - `ID` string, required
  - `srvTS` integer, required: Server timestamp (ms)
  - `rkey` string, required: Request key

## Other responses

- `400`: BadRequest: Required parameters missing (type, params.host, GitHub installationId) or invalid state
- `401`: Unauthorized: Active user session required
- `403`: AccessNotAllowed: Privilege integration:git required
- `406`: TimeResync — расхождение rts с сервером
- `422`: UnprocessableContent: Integration with specified ID already exists

---

[API](https://skmtc.dev/kosmodrom/apis/kosmodrom-backend-api.md) · [All operations](https://skmtc.dev/kosmodrom/apis/kosmodrom-backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kosmodrom/apis/kosmodrom-backend-api/revisions/a143b51ba29a?raw)
