---
title: "🔒 Создание ветки задачи в репозитории проекта от ветки по умолчанию (#26575): вкладка «Git». Только исполнитель стадии «Исполнение» задачи разработки или ошибки (`task:work`)."
method: POST
path: "/integration/git/branch/create"
tags: ["Integrations: Git"]
---

# 🔒 Создание ветки задачи в репозитории проекта от ветки по умолчанию (#26575): вкладка «Git». Только исполнитель стадии «Исполнение» задачи разработки или ошибки (\`task:work\`).

`POST /integration/git/branch/create`

## Request

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

Создание ветки задачи в репозитории проекта от ветки по умолчанию (#26575): вкладка «Git». Только исполнитель стадии «Исполнение» задачи разработки или ошибки (`task:work`).

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

**Allows:** `task:work` (все обязательны; ресурс — `<тип>ID` / `ID` из запроса, `user:*` — `userID` или сам пользователь)

### TypeScript (copy-paste)

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

<details open><summary><b>Params</b></summary>

```typescript
export interface IntegrationGitBranchCreateParams {
  taskID: string
  repositoryID: string
}
```

</details>

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

```typescript
export type IntegrationGitBranchCreateResponse = IServerResponse<Resp_integration_git_branch_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)

## Query parameters

- `taskID` string, uuid, required
- `repositoryID` string, uuid, required

## Headers

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

## Response `200`

OK — `IServerResponse<Resp_integration_git_branch_create>`

- object
  - `code` integer, required
  - `data` RespIntegrationGitBranchCreate, required: ResponseData for integration/git/branch/create
    - `git` TaskGitType, required: Stub schema for unresolved $ref TaskGit_Type (from ResponseData AST)
    - `name` string, required: Имя ветки и ссылка на неё в этом репозитории
    - `url` string, required
    - `created` boolean, required: false - ветка с таким именем уже была у провайдера, записана ссылка на неё
  - `srvTS` integer, required: Server timestamp (ms)
  - `rkey` string, required: Request key

## Other responses

- `400`: BadRequest / Validation — неверные params/body/headers
- `401`: Unauthorized: Active user session required
- `403`: AccessNotAllowed: Not the current assignee of the work stage, repository is not linked to the project, integration is disabled or the provider refused
- `404`: NotFound: Task, repository or default branch at provider not found
- `406`: TimeResync — расхождение rts с сервером
- `422`: UnprocessableContent: Repository has no known default branch yet

---

[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)
