---
title: "添加"
method: POST
path: "/api/v1/users/git-identities"
tags: ["【用户】git 身份管理"]
---

# 添加

`POST /api/v1/users/git-identities`

添加 Git 身份认证

## Request body

- DomainAddGitIdentityReq
  - `access_token` string, required
  - `base_url` string, required
  - `email` string, required
  - `organization_id` string — 云效 Codeup 组织 ID，绑定后自动解析填充
  - `platform` 'github' | 'gitlab' | 'gitea' | 'gitee' | 'codeup' | 'cnb' | 'atomgit', required
  - `remark` string
  - `username` string, required

## Response `200`

成功

- object
  - `code` integer
  - `data` DomainGitIdentity
    - `access_token` string
    - `authorized_repositories` DomainAuthRepository[]
      - `description` string
      - `full_name` string
      - `url` string
    - `base_url` string
    - `created_at` string
    - `email` string
    - `id` string
    - `is_installation_app` boolean
    - `organization_id` string — 云效 Codeup 组织 ID
    - `platform` 'github' | 'gitlab' | 'gitea' | 'gitee' | 'codeup' | 'cnb' | 'atomgit'
    - `remark` string
    - `repo_page_info` WebPageInfo
      - `has_next_page` boolean
      - `next_token` string
      - `total_count` integer
    - `username` string
  - `message` string

## Other responses

- `400` — 请求参数错误
- `500` — 服务器内部错误

---

[API](https://skmtc.net/chaitin/apis/untitled-api.md) · [All operations](https://skmtc.net/chaitin/apis/untitled-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/chaitin/untitled-api/revisions/5a5929cb17f2/schema)
