프로젝트 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

REST API를 활용하여 프로젝트와 상호 작용합니다.

프로젝트 가시성 수준

GitLab의 프로젝트는 개인적인, 내부적인, 혹은 공개적일 수 있습니다. 가시성 수준은 프로젝트의 visibility 필드에 의해 결정됩니다.

세부 정보는 프로젝트 가시성을 확인하세요.

인증된 사용자의 권한에 따라 응답에서 반환되는 필드가 다릅니다.

API v5에서 삭제될 사항

다음 속성들이 폐기되었으며 API v5에서 제거될 예정입니다:

프로젝트 병합 방법

merge_method는 다음 옵션을 사용할 수 있습니다:

  • merge: 모든 병합에 대해 병합 커밋이 생성되며, 충돌이 없는 경우에만 병합이 허용됩니다.
  • rebase_merge: 모든 병합에 대해 병합 커밋이 생성되지만, 퀵-포워드 병합이 가능한 경우에만 병합이 허용됩니다. 본 병합 요청의 빌드 및 병합 후 대상 브랜치가 빌드됨을 보장할 수 있습니다.
  • ff: 병합 커밋이 생성되지 않으며 모든 병합이 퀵-포워드 되며, 브랜치가 퀵-포워드될 수 있는 경우에만 병합이 허용됩니다.

모든 프로젝트 나열

인증된 사용자를 위한 GitLab 전체에서 보이는 모든 프로젝트의 목록을 가져옵니다. 인증 없이 액세스하는 경우, 간단한 필드로만 구성된 공개 프로젝트만 반환됩니다.

GET /projects
속성 유형 필수 설명
archived 부울 아니요 보관된 상태로 제한합니다.
id_after 정수 아니요 지정된 ID보다 큰 ID를 가진 프로젝트로 결과를 제한합니다.
id_before 정수 아니요 지정된 ID보다 작은 ID를 가진 프로젝트로 결과를 제한합니다.
imported 부울 아니요 현재 사용자가 외부 시스템에서 가져온 프로젝트로 결과를 제한합니다.
include_hidden 부울 아니요 숨겨진 프로젝트를 포함합니다. (관리자 전용) Premium 및 Ultimate 전용입니다.
include_pending_delete 부울 아니요 삭제 대기중인 프로젝트를 포함합니다. (관리자 전용)
last_activity_after 날짜/시간 아니요 지정된 시간 이후에 활동한 프로젝트로 결과를 제한합니다. 포맷: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
last_activity_before 날짜/시간 아니요 지정된 시간 이전에 활동한 프로젝트로 결과를 제한합니다. 포맷: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ)
membership 부울 아니요 현재 사용자가 멤버인 프로젝트로 제한합니다.
min_access_level 정수 아니요 현재 사용자의 최소 역할(access_level)로 제한합니다.
order_by 문자열 아니요 id, name, path, created_at, updated_at, last_activity_at, 또는 similarity 필드에 따라 프로젝트를 정렬해서 반환합니다. 관리자 전용 속성인 repository_size, storage_size, packages_size 또는 wiki_size 필드는 허용되지 않습니다.
(GitLab 14.1에 [도입되었음](https://gitlab.com/gitlab-org/gitlab/-/issues/332890)).      
owned 부울 아니요 현재 사용자가 명시적으로 소유한 프로젝트로 제한합니다.
repository_checksum_failed 부울 아니요 저장소 체크섬 계산에 실패한 프로젝트로 제한합니다. Premium 및 Ultimate 전용입니다.
repository_storage 문자열 아니요 repository_storage에 저장된 프로젝트로 결과를 제한합니다. (관리자 전용)
search_namespaces 부울 아니요 검색 기준과 일치하는 조상 네임스페이스를 포함합니다. 기본값은 false입니다.
search 문자열 아니요 검색 기준과 일치하는 프로젝트 목록을 반환합니다.
simple 부울 아니요 각 프로젝트의 한정된 필드만 반환합니다. 이 작업은 인증되지 않은 경우 간단한 필드만 반환하는 데 사용됩니다.
sort 문자열 아니요 asc 또는 desc 순서로 프로젝트를 반환합니다. 기본값은 desc입니다.
starred 부울 아니요 현재 사용자가 즐겨찾기 한 프로젝트로 제한합니다.
statistics 부울 아니요 프로젝트 통계를 포함합니다. 최소한 리포터 역할 이상의 사용자가 가능합니다.
topic_id 정수 아니요 주어진 주제 ID로 할당된 주제가 있는 프로젝트로 결과를 제한합니다.
topic 문자열 아니요 주어진 주제를 모두 일치하는 프로젝트로 결과를 제한합니다. topics 속성을 참조하세요.
updated_after 날짜/시간 아니요 지정된 시간 이후에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 포맷: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ).
(GitLab 15.10에서 도입되었음). 이 필터가 작동하려면 order_by 속성으로 updated_at을 제공해야 합니다.      
updated_before 날짜/시간 아니요 지정된 시간 이전에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 포맷: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ).
(GitLab 15.10에서 도입되었음). 이 필터가 작동하려면 order_by 속성으로 updated_at을 제공해야 합니다.      
visibility 문자열 아니요 public, internal, 또는 private 가시성으로 제한합니다.
wiki_checksum_failed 부울 아니요 위키 체크섬 계산에 실패한 프로젝트로 제한합니다. Premium 및 Ultimate 전용입니다.
with_custom_attributes 부울 아니요 응답에 사용자 정의 속성을 포함합니다. (관리자 전용)
with_issues_enabled 부울 아니요 활성화된 이슈 기능으로 제한합니다.
with_merge_requests_enabled 부울 아니요 활성화된 병합 요청 기능으로 제한합니다.
with_programming_language 문자열 아니요 주어진 프로그래밍 언어를 사용하는 프로젝트로 제한합니다.

이 엔드포인트는 키셋 페이지네이션을 지원합니다.

simple=true이거나 사용자가 인증된 경우, 다음과 같은 반환됩니다:

예시 요청:

curl --request GET "https://gitlab.example.com/api/v4/projects"

예시 응답:

[
  {
    "id": 4,
    "description": null,
    "name": "Diaspora Client",
    "name_with_namespace": "Diaspora / Diaspora Client",
    "path": "diaspora-client",
    "path_with_namespace": "diaspora/diaspora-client",
    "created_at": "2013-09-30T13:46:02Z",
    "default_branch": "main",
    "tag_list": [
      "example",
      "disapora client"
    ],
    "topics": [
      "example",
      "disapora client"
    ],
    "ssh_url_to_repo": "git@gitlab.example.com:diaspora/diaspora-client.git",
    "http_url_to_repo": "https://gitlab.example.com/diaspora/diaspora-client.git",
    "web_url": "https://gitlab.example.com/diaspora/diaspora-client",
    "avatar_url": "https://gitlab.example.com/uploads/project/avatar/4/uploads/avatar.png",
    "star_count": 0,
    "last_activity_at": "2013-09-30T13:46:02Z",
    "namespace": {
      "id": 2,
      "name": "Diaspora",
      "path": "diaspora",
      "kind": "group",
      "full_path": "diaspora",
      "parent_id": null,
      "avatar_url": null,
      "web_url": "https://gitlab.example.com/diaspora"
    }
  },
  {
    ...
  }
]

인증된 사용자이고 simple이 설정되지 않은 경우, 다음과 같은 반환됩니다:

[
  {
    "id": 4,
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "name": "Diaspora Client",
    "name_with_namespace": "Diaspora / Diaspora Client",
    "path": "diaspora-client",
    "path_with_namespace": "diaspora/diaspora-client",
    "created_at": "2013-09-30T13:46:02Z",
    "updated_at": "2013-09-30T13:46:02Z",
    "default_branch": "main",
    "tag_list": [ //deprecated, use `topics` instead
      "example",
      "disapora client"
    ],
    "topics": [
      "example",
      "disapora client"
    ],
    "ssh_url_to_repo": "git@gitlab.example.com:diaspora/diaspora-client.git",
    "http_url_to_repo": "https://gitlab.example.com/diaspora/diaspora-client.git",
    "web_url": "https://gitlab.example.com/diaspora/diaspora-client",
    "readme_url": "https://gitlab.example.com/diaspora/diaspora-client/blob/main/README.md",
    "avatar_url": "https://gitlab.example.com/uploads/project/avatar/4/uploads/avatar.png",
    ...
  },
  {
    ...
  }
]

참고: last_activity_at프로젝트 활동프로젝트 이벤트에 따라 업데이트됩니다. updated_at은 데이터베이스에서 프로젝트 레코드가 변경될 때마다 업데이트됩니다.

다음과 같이 사용자 정의 속성으로 필터링할 수 있습니다:

GET /projects?custom_attributes[key]=value&custom_attributes[other_key]=other_value

예시 요청:

curl --globoff --request GET "https://gitlab.example.com/api/v4/projects?custom_attributes[location]=Antarctica&custom_attributes[role]=Developer"

페이지네이션 제한

GitLab 13.0 이후로 offset-based pagination50,000개 레코드로 제한됩니다. 이 제한을 초과하는 프로젝트를 검색하려면 keyset pagination이 필요합니다.

Keyset pagination은 order_by=id만 지원합니다. 다른 정렬 옵션은 사용할 수 없습니다.

사용자 프로젝트 목록

  • 응답의 _links.cluster_agents 속성이 GitLab 14.10에서 도입되었습니다.

특정 사용자가 소유한 가시적인 프로젝트 목록을 가져옵니다. 인증 없이 액세스하면 공개 프로젝트만 반환됩니다.

필수 구성 요소:

  • 특정 속성을 보려면 프로젝트의 관리자이거나 프로젝트의 소유자 역할이어야 합니다.

참고: 특정 프로필이 비공개로 설정된 경우 사용자의(여기서 user_id로 지정함) 네임스페이스에 있는 프로젝트만 반환됩니다. 사용자가 소유한 프로젝트가 어떤 그룹이나 하위 그룹에 있더라도 반환되지 않습니다. 프로필이 비공개로 설정된 경우 빈 목록이 반환됩니다.

이 엔드포인트는 선택된 order_by 옵션에 대해 keyset pagination을 지원합니다.

GET /users/:user_id/projects
속성 타입 필수 설명
user_id 문자열 사용자의 ID 또는 사용자 이름.
archived 부울 아니오 보관된 상태로 제한합니다.
id_after 정수 아니오 지정된 ID보다 큰 ID를 갖는 프로젝트로 결과를 제한합니다.
id_before 정수 아니오 지정된 ID보다 작은 ID를 갖는 프로젝트로 결과를 제한합니다.
membership 부울 아니오 현재 사용자가 멤버인 프로젝트로 제한합니다.
min_access_level 정수 아니오 현재 사용자의 최소 역할(access_level)로 제한합니다.
order_by 문자열 아니오 프로젝트를 id, name, path, created_at, updated_at, last_activity_at 필드로 정렬하여 반환합니다. 기본값은 created_at입니다.
owned 부울 아니오 현재 사용자가 명시적으로 소유한 프로젝트로 제한합니다.
search 문자열 아니오 검색 기준과 일치하는 프로젝트 목록을 반환합니다.
simple 부울 아니오 각 프로젝트에 대해 제한된 필드만 반환합니다. 인증되지 않으면 이 작업은 무효화됩니다. 단순한 필드만 반환됩니다.
sort 문자열 아니오 프로젝트를 asc 또는 desc 순으로 반환합니다. 기본값은 desc입니다.
starred 부울 아니오 현재 사용자가 즐겨찾기한 프로젝트로 제한합니다.
statistics 부울 아니오 프로젝트 통계를 포함시킵니다. 적어도 Reporter 역할을 가진 사용자에게만 사용할 수 있습니다.
updated_after 날짜/시간 아니오 지정된 시간 이후에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ). GitLab 15.10에서 도입되었습니다.
updated_before 날짜/시간 아니오 지정된 시간 전에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ). GitLab 15.10에서 도입되었습니다.
visibility 문자열 아니오 public, internal, 또는 private으로 가시성에 따라 제한합니다.
with_custom_attributes 부울 아니오 응답에 사용자 정의 속성을 포함시킵니다. (관리자 전용)
with_issues_enabled 부울 아니오 활성화된 이슈 기능으로 제한합니다.
with_merge_requests_enabled 부울 아니오 활성화된 병합 요청 기능으로 제한합니다.
with_programming_language 문자열 아니오 지정된 프로그래밍 언어를 사용하는 프로젝트로 제한합니다.
[
  {
    "id": 4,
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "default_branch": "main",
    "visibility": "private",
    "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
    "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
    "web_url": "http://example.com/diaspora/diaspora-client",
    "readme_url": "http://example.com/diaspora/diaspora-client/blob/main/README.md",
    "topics": [
      "example",
      "disapora client"
    ],
    "owner": {
      "id": 3,
      "name": "Diaspora",
      "created_at": "2013-09-30T13:46:02Z"
    },
    // 이하 생략
  },
  {
    "id": 6,
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "default_branch": "main",
    "visibility": "private",
    "ssh_url_to_repo": "git@example.com:brightbox/puppet.git",
    "http_url_to_repo": "http://example.com/brightbox/puppet.git",
    "web_url": "http://example.com/brightbox/puppet",
    "readme_url": "http://example.com/brightbox/puppet/blob/main/README.md",
    "topics": [
      "example",
      "puppet"
    },
    "owner": {
      "id": 4,
      "name": "Brightbox",
      "created_at": "2013-09-30T13:46:02Z"
    },
    // 이하 생략
  }
]

사용자가 기여한 프로젝트 목록

특정 사용자가 기여한 가시적인 프로젝트 목록을 얻습니다.

GET /users/:user_id/contributed_projects
속성 유형 필수 설명
user_id string 사용자의 ID 또는 사용자 이름입니다.
order_by string 아니오 id, name, path, created_at, updated_at, 또는 last_activity_at 필드로 프로젝트를 정렬하여 반환합니다. 기본값은 created_at입니다.
simple boolean 아니오 각 프로젝트에 대해 제한된 필드만 반환합니다. 인증 없이 이 작업은 무시됩니다. 단순 필드만 반환됩니다.
sort string 아니오 프로젝트를 asc 또는 desc 순서로 정렬하여 반환합니다. 기본값은 desc입니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/users/5/contributed_projects"

예시 응답:

[
  {
    "id": 4,
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "default_branch": "main",
    "visibility": "private",
    "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
    "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
    "web_url": "http://example.com/diaspora/diaspora-client",
    "readme_url": "http://example.com/diaspora/diaspora-client/blob/main/README.md",
    "tag_list": [ //deprecated, use `topics` instead
      "example",
      "disapora client"
    ],
    "topics": [
      "example",
      "disapora client"
    ],
    "owner": {
      "id": 3,
      "name": "Diaspora",
      "created_at": "2013-09-30T13:46:02Z"
    },
    "name": "Diaspora Client",
    "name_with_namespace": "Diaspora / Diaspora Client",
    "path": "diaspora-client",
    "path_with_namespace": "diaspora/diaspora-client",
    "issues_enabled": true,
    "open_issues_count": 1,
    "merge_requests_enabled": true,
    "jobs_enabled": true,
    "wiki_enabled": true,
    "snippets_enabled": false,
    "can_create_merge_request_in": true,
    "resolve_outdated_diff_discussions": false,
    "container_registry_enabled": false, // deprecated, use container_registry_access_level instead
    "container_registry_access_level": "disabled",
    "security_and_compliance_access_level": "disabled",
    "created_at": "2013-09-30T13:46:02Z",
    "updated_at": "2013-09-30T13:46:02Z",
    "last_activity_at": "2013-09-30T13:46:02Z",
    "creator_id": 3,
    "namespace": {
      "id": 3,
      "name": "Diaspora",
      "path": "diaspora",
      "kind": "group",
      "full_path": "diaspora"
    },
    "import_status": "none",
    "archived": false,
    "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
    "shared_runners_enabled": true,
    "group_runners_enabled": true,
    "forks_count": 0,
    "star_count": 0,
    "runners_token": "b8547b1dc37721d05889db52fa2f02",
    "public_jobs": true,
    "shared_with_groups": [],
    "only_allow_merge_if_pipeline_succeeds": false,
    "allow_merge_on_skipped_pipeline": false,
    "restrict_user_defined_variables": false,
    "only_allow_merge_if_all_discussions_are_resolved": false,
    "remove_source_branch_after_merge": false,
    "request_access_enabled": false,
    "merge_method": "merge",
    "squash_option": "default_on",
    "autoclose_referenced_issues": true,
    "enforce_auth_checks_on_uploads": true,
    "suggestion_commit_message": null,
    "merge_commit_template": null,
    "squash_commit_template": null,
    "issue_branch_template": "gitlab/%{id}-%{title}",
    "statistics": {
      "commit_count": 37,
      "storage_size": 1038090,
      "repository_size": 1038090,
      "lfs_objects_size": 0,
      "job_artifacts_size": 0,
      "pipeline_artifacts_size": 0,
      "packages_size": 0,
      "snippets_size": 0,
      "uploads_size": 0
    },
    "container_registry_image_prefix": "registry.example.com/diaspora/diaspora-client",
    "_links": {
      "self": "http://example.com/api/v4/projects",
      "issues": "http://example.com/api/v4/projects/1/issues",
      "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
      "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
      "labels": "http://example.com/api/v4/projects/1/labels",
      "events": "http://example.com/api/v4/projects/1/events",
      "members": "http://example.com/api/v4/projects/1/members",
      "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
    }
  },
  {
    "id": 6,
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "default_branch": "main",
    "visibility": "private",
    "ssh_url_to_repo": "git@example.com:brightbox/puppet.git",
    "http_url_to_repo": "http://example.com/brightbox/puppet.git",
    "web_url": "http://example.com/brightbox/puppet",
    "readme_url": "http://example.com/brightbox/puppet/blob/main/README.md",
    "tag_list": [ //deprecated, use `topics` instead
      "example",
      "puppet"
    ],
    "topics": [
      "example",
      "puppet"
    ],
    "owner": {
      "id": 4,
      "name": "Brightbox",
      "created_at": "2013-09-30T13:46:02Z"
    },
    "name": "Puppet",
    "name_with_namespace": "Brightbox / Puppet",
    "path": "puppet",
    "path_with_namespace": "brightbox/puppet",
    "issues_enabled": true,
    "open_issues_count": 1,
    "merge_requests_enabled": true,
    "jobs_enabled": true,
    "wiki_enabled": true,
    "snippets_enabled": false,
    "can_create_merge_request_in": true,
    "resolve_outdated_diff_discussions": false,
    "container_registry_enabled": false, // deprecated, use container_registry_access_level instead
    "container_registry_access_level": "disabled",
    "security_and_compliance_access_level": "disabled",
    "created_at": "2013-09-30T13:46:02Z",
    "updated_at": "2013-09-30T13:46:02Z",
    "last_activity_at": "2013-09-30T13:46:02Z",
    "creator_id": 3,
    "namespace": {
      "id": 4,
      "name": "Brightbox",
      "path": "brightbox",
      "kind": "group",
      "full_path": "brightbox"
    },
    "import_status": "none",
    "import_error": null,
    "permissions": {
      "project_access": {
        "access_level": 10,
        "notification_level": 3
      },
      "group_access": {
        "access_level": 50,
        "notification_level": 3
      }
    },
    "archived": false,
    "avatar_url": null,
    "shared_runners_enabled": true,
    "group_runners_enabled": true,
    "forks_count": 0,
    "star_count": 0,
    "runners_token": "b8547b1dc37721d05889db52fa2f02",
    "public_jobs": true,
    "shared_with_groups": [],
    "only_allow_merge_if_pipeline_succeeds": false,
    "allow_merge_on_skipped_pipeline": false,
    "restrict_user_defined_variables": false,
    "only_allow_merge_if_all_discussions_are_resolved": false,
    "remove_source_branch_after_merge": false,
    "request_access_enabled": false,
    "merge_method": "merge",
    "squash_option": "default_on",
    "auto_devops_enabled": true,
    "auto_devops_deploy_strategy": "continuous",
    "repository_storage": "default",
    "approvals_before_merge": 0, // Deprecated. Use merge request approvals API instead.
    "mirror": false,
    "mirror_user_id": 45,
    "mirror_trigger_builds": false,
    "only_mirror_protected_branches": false,
    "mirror_overwrites_diverged_branches": false,
    "external_authorization_classification_label": null,
    "packages_enabled": true,
    "service_desk_enabled": false,
    "service_desk_address": null,
    "autoclose_referenced_issues": true,
    "enforce_auth_checks_on_uploads": true,
    "suggestion_commit_message": null,
    "merge_commit_template": null,
    "squash_commit_template": null,
    "issue_branch_template": "gitlab/%{id}-%{title}",
    "statistics": {
      "commit_count": 12,
      "storage_size": 2066080,
      "repository_size": 2066080,
      "lfs_objects_size": 0,
      "job_artifacts_size": 0,
      "pipeline_artifacts_size": 0,
      "packages_size": 0,
      "snippets_size": 0,
      "uploads_size": 0
    },
    "container_registry_image_prefix": "registry.example.com/brightbox/puppet",
    "_links": {
      "self": "http://example.com/api/v4/projects",
      "issues": "http://example.com/api/v4/projects/1/issues",
      "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
      "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
      "labels": "http://example.com/api/v4/projects/1/labels",
      "events": "http://example.com/api/v4/projects/1/events",
      "members": "http://example.com/api/v4/projects/1/members",
      "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
    }
  }
]

사용자가 스타를 표시한 프로젝트 목록

지정된 사용자가 스타를 표시한 가시적인 프로젝트 목록을 가져옵니다. 인증 없이 액세스하는 경우 공개 프로젝트만 반환됩니다.

GET /users/:user_id/starred_projects
속성 유형 필수 여부 설명
user_id string Yes 사용자의 ID 또는 사용자 이름.
archived boolean No 보관된 상태로 제한합니다.
membership boolean No 현재 사용자가 멤버인 프로젝트로 제한합니다.
min_access_level integer No 현재 사용자의 최소한의 역할 (access_level)로 제한합니다.
order_by string No 프로젝트를 id, name, path, created_at, updated_at, 또는 last_activity_at 필드로 정렬하여 반환합니다. 기본값은 created_at입니다.
owned boolean No 현재 사용자가 명시적으로 소유한 프로젝트로 제한합니다.
search string No 검색 기준과 일치하는 프로젝트 목록을 반환합니다.
simple boolean No 각 프로젝트에 대해 제한된 필드만 반환합니다. 인증 없이는 이 작업이 무효화되며 제한된 필드만 반환됩니다.
sort string No asc 또는 desc 순서로 정렬된 프로젝트를 반환합니다. 기본값은 desc입니다.
starred boolean No 현재 사용자가 스타를 표시한 프로젝트로 제한합니다.
statistics boolean No 프로젝트 통계를 포함합니다. 최소한 기자 역할을 가진 사용자에게만 사용할 수 있습니다.
updated_after datetime No 지정된 시간 이후에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ). GitLab 15.10에서 도입되었습니다.
updated_before datetime No 지정된 시간 이전에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ). GitLab 15.10에서 도입되었습니다.
visibility string No public, internal, 또는 private 가시성으로 제한합니다.
with_custom_attributes boolean No 응답에 사용자 지정 속성을 포함합니다. (관리자 전용)
with_issues_enabled boolean No 활성화된 이슈 기능으로 제한합니다.
with_merge_requests_enabled boolean No 활성화된 병합 요청 기능으로 제한합니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/users/5/starred_projects"

예시 응답:

[
  {
    "id": 4,
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "default_branch": "main",
    "visibility": "private",
    "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
    "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
    "web_url": "http://example.com/diaspora/diaspora-client",
    "readme_url": "http://example.com/diaspora/diaspora-client/blob/main/README.md",
    "tag_list": [ //deprecated, use `topics` instead
      "example",
      "disapora client"
    ],
    "topics": [
      "example",
      "disapora client"
    ],
    "owner": {
      "id": 3,
      "name": "Diaspora",
      "created_at": "2013-09-30T13:46:02Z"
    },
    // ...<중략>...
    "_links": {
      "self": "http://example.com/api/v4/projects",
      "issues": "http://example.com/api/v4/projects/1/issues",
      "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
      "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
      "labels": "http://example.com/api/v4/projects/1/labels",
      "events": "http://example.com/api/v4/projects/1/events",
      "members": "http://example.com/api/v4/projects/1/members",
      "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
    }
  },
  {
    "id": 6,
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    // ...<중략>...
    "_links": {
      "self": "http://example.com/api/v4/projects",
      "issues": "http://example.com/api/v4/projects/1/issues",
      "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
      "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
      "labels": "http://example.com/api/v4/projects/1/labels",
      "events": "http://example.com/api/v4/projects/1/events",
      "members": "http://example.com/api/v4/projects/1/members",
      "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
    }
  }
]

단일 프로젝트 가져오기

특정 프로젝트를 가져옵니다. 이 엔드포인트는 프로젝트가 공개적으로 접근 가능한 경우에는 인증 없이 접근할 수 있습니다.

GET /projects/:id
속성 타입 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL-encoded path.
license 부울 아니오 프로젝트 라이센스 데이터 포함.
statistics 부울 아니오 프로젝트 통계를 포함합니다. 적어도 Reporter 역할을 가진 사용자에게만 사용 가능합니다.
with_custom_attributes 부울 아니오 응답에 사용자 지정 속성 포함. (관리자 전용)
{
  "id": 3,
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "default_branch": "main",
  "visibility": "private",
  "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
  "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
  "web_url": "http://example.com/diaspora/diaspora-project-site",
  "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
  "tag_list": [ //deprecated, use `topics` instead
    "example",
    "disapora project"
  ],
  "topics": [
    "example",
    "disapora project"
  ],
  "owner": {
    "id": 3,
    "name": "Diaspora",
    "created_at": "2013-09-30T13:46:02Z"
  },
  "name": "Diaspora Project Site",
  "name_with_namespace": "Diaspora / Diaspora Project Site",
  "path": "diaspora-project-site",
  "path_with_namespace": "diaspora/diaspora-project-site",
  "issues_enabled": true,
  "open_issues_count": 1,
  "merge_requests_enabled": true,
  "jobs_enabled": true,
  "wiki_enabled": true,
  "snippets_enabled": false,
  "can_create_merge_request_in": true,
  "resolve_outdated_diff_discussions": false,
  "container_registry_enabled": false, // deprecated, use container_registry_access_level instead
  "container_registry_access_level": "disabled",
  "security_and_compliance_access_level": "disabled",
  "container_expiration_policy": {
    "cadence": "7d",
    "enabled": false,
    "keep_n": null,
    "older_than": null,
    "name_regex": null, // to be deprecated in GitLab 13.0 in favor of `name_regex_delete`
    "name_regex_delete": null,
    "name_regex_keep": null,
    "next_run_at": "2020-01-07T21:42:58.658Z"
  },
  "created_at": "2013-09-30T13:46:02Z",
  "updated_at": "2013-09-30T13:46:02Z",
  "last_activity_at": "2013-09-30T13:46:02Z",
  "creator_id": 3,
  "namespace": {
    "id": 3,
    "name": "Diaspora",
    "path": "diaspora",
    "kind": "group",
    "full_path": "diaspora",
    "avatar_url": "http://localhost:3000/uploads/group/avatar/3/foo.jpg",
    "web_url": "http://localhost:3000/groups/diaspora"
  },
  "import_url": null,
  "import_type": null,
  "import_status": "none",
  "import_error": null,
  "permissions": {
    "project_access": {
      "access_level": 10,
      "notification_level": 3
    },
    "group_access": {
      "access_level": 50,
      "notification_level": 3
    }
  },
  "archived": false,
  "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
  "license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
  "license": {
    "key": "lgpl-3.0",
    "name": "GNU Lesser General Public License v3.0",
    "nickname": "GNU LGPLv3",
    "html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
    "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
  },
  "shared_runners_enabled": true,
  "group_runners_enabled": true,
  "forks_count": 0,
  "star_count": 0,
  "runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
  "ci_default_git_depth": 50,
  "ci_forward_deployment_enabled": true,
  "ci_forward_deployment_rollback_allowed": true,
  "ci_allow_fork_pipelines_to_run_in_parent_project": true,
  "ci_separated_caches": true,
  "ci_restrict_pipeline_cancellation_role": "developer",
  "public_jobs": true,
  "shared_with_groups": [
    {
      "group_id": 4,
      "group_name": "Twitter",
      "group_full_path": "twitter",
      "group_access_level": 30
    },
    {
      "group_id": 3,
      "group_name": "Gitlab Org",
      "group_full_path": "gitlab-org",
      "group_access_level": 10
    }
  ],
  "repository_storage": "default",
  "only_allow_merge_if_pipeline_succeeds": false,
  "allow_merge_on_skipped_pipeline": false,
  "restrict_user_defined_variables": false,
  "only_allow_merge_if_all_discussions_are_resolved": false,
  "remove_source_branch_after_merge": false,
  "printing_merge_requests_link_enabled": true,
  "request_access_enabled": false,
  "merge_method": "merge",
  "squash_option": "default_on",
  "auto_devops_enabled": true,
  "auto_devops_deploy_strategy": "continuous",
  "approvals_before_merge": 0, // Deprecated. Use merge request approvals API instead.
  "mirror": false,
  "mirror_user_id": 45,
  "mirror_trigger_builds": false,
  "external_authorization_classification_label": null,
  "packages_enabled": true,
  "service_desk_enabled": false,
  "service_desk_address": null,
  "autoclose_referenced_issues": true,
  "suggestion_commit_message": null,
  "enforce_auth_checks_on_uploads": true,
  "merge_commit_template": null,
  "squash_commit_template": null,
  "issue_branch_template": "gitlab/%{id}-%{title}",
  "marked_for_deletion_at": "2020-04-03", // Deprecated and will be removed in API v5 in favor of marked_for_deletion_on
  "marked_for_deletion_on": "2020-04-03",
  "compliance_frameworks": [ "sox" ],
  "warn_about_potentially_unwanted_characters": true,
  "statistics": {
    "commit_count": 37,
    "storage_size": 1038090,
    "repository_size": 1038090,
    "wiki_size" : 0,
    "lfs_objects_size": 0,
    "job_artifacts_size": 0,
    "pipeline_artifacts_size": 0,
    "packages_size": 0,
    "snippets_size": 0,
    "uploads_size": 0
  },
  "container_registry_image_prefix": "registry.example.com/diaspora/diaspora-client",
  "_links": {
    "self": "http://example.com/api/v4/projects",
    "issues": "http://example.com/api/v4/projects/1/issues",
    "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
    "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
    "labels": "http://example.com/api/v4/projects/1/labels",
    "events": "http://example.com/api/v4/projects/1/events",
    "members": "http://example.com/api/v4/projects/1/members",
    "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
  }
}

GitLab Ultimate 사용자는 GitLab 15.5 이상에서 only_allow_merge_if_all_status_checks_passed 매개변수를 확인할 수 있습니다.

{
  "id": 1,
  "project_id": 3,
  "only_allow_merge_if_all_status_checks_passed": false,
  ...
}

프로젝트가 fork된 경우, 응답에 forked_from_project 필드가 표시됩니다. 이 필드의 경우, 상위 프로젝트가 비공개인 경우 인증을 위한 유효한 토큰을 제공해야 합니다. mr_default_target_self 필드도 나타납니다. 이 값이 false인 경우 모든 병합 요청이 기본적으로 상위 프로젝트를 대상으로 합니다.

{
   "id":3,

   ...

   "mr_default_target_self": false,
   "forked_from_project":{
      "id":13083,
      "description":"GitLab Community Edition",
      "name":"GitLab Community Edition",
      "name_with_namespace":"GitLab.org / GitLab Community Edition",
      "path":"gitlab-foss",
      "path_with_namespace":"gitlab-org/gitlab-foss",
      "created_at":"2013-09-26T06:02:36.000Z",
      "default_branch":"main",
      "tag_list":[], //deprecated, use `topics` instead
      "topics":[],
      "ssh_url_to_repo":"git@gitlab.com:gitlab-org/gitlab-foss.git",
      "http_url_to_repo":"https://gitlab.com/gitlab-org/gitlab-foss.git",
      "web_url":"https://gitlab.com/gitlab-org/gitlab-foss",
      "avatar_url":"https://gitlab.com/uploads/-/system/project/avatar/13083/logo-extra-whitespace.png",
      "license_url": "https://gitlab.com/gitlab-org/gitlab/-/blob/main/LICENSE",
      "license": {
        "key": "mit",
        "name": "MIT License",
        "nickname": null,
        "html_url": "http://choosealicense.com/licenses/mit/",
        "source_url": "https://opensource.org/licenses/MIT"
      },
      "star_count":3812,
      "forks_count":3561,
      "last_activity_at":"2018-01-02T11:40:26.570Z",
      "namespace": {
          "id": 72,
          "name": "GitLab.org",
          "path": "gitlab-org",
          "kind": "group",
          "full_path": "gitlab-org",
          "parent_id": null
      },
      "repository_storage": "default"
   }

   ...

}

이슈 및 병합 요청을 위한 템플릿

Tier: Premium, Ultimate Offering: GitLab.com, Self-Managed, GitLab Dedicated

GitLab Premium 또는 Ultimate 사용자는 이슈 및 병합 요청 설명 템플릿을 관리하기 위한 issues_templatemerge_requests_template 매개변수도 볼 수 있습니다.

{
  "id": 3,
  "issues_template": null,
  "merge_requests_template": null,
  ...
}

프로젝트 사용자 가져오기

프로젝트 사용자 목록을 가져옵니다.

GET /projects/:id/users
속성 유형 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
search 문자열 아니요 특정 사용자 검색.
skip_users 정수 배열 아니요 지정된 ID를 가진 사용자 제외.
[
  {
    "id": 1,
    "username": "john_smith",
    "name": "John Smith",
    "state": "active",
    "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
    "web_url": "http://localhost:3000/john_smith"
  },
  {
    "id": 2,
    "username": "jack_smith",
    "name": "Jack Smith",
    "state": "blocked",
    "avatar_url": "http://gravatar.com/../e32131cd8.jpeg",
    "web_url": "http://localhost:3000/jack_smith"
  }
]

프로젝트의 그룹 목록

이 프로젝트의 상위 그룹 목록을 가져옵니다.

GET /projects/:id/groups
속성 유형 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
search 문자열 아니요 특정 그룹 검색.
shared_min_access_level 정수 아니요 최소한 이 역할(access_level)을 가진 공유 그룹으로 제한합니다.
shared_visible_only 부울 아니요 사용자가 접근할 수 있는 공유 그룹으로 제한합니다.
skip_groups 정수 배열 아니요 전달된 그룹 ID를 건너뜁니다.
with_shared 부울 아니요 이 그룹과 공유된 프로젝트를 포함합니다. 기본값은 false입니다.
[
  {
    "id": 1,
    "name": "Foobar 그룹",
    "avatar_url": "http://localhost:3000/uploads/group/avatar/1/foo.jpg",
    "web_url": "http://localhost:3000/groups/foo-bar",
    "full_name": "Foobar 그룹",
    "full_path": "foo-bar"
  },
  {
    "id": 2,
    "name": "공유된 그룹",
    "avatar_url": "http://gitlab.example.com/uploads/group/avatar/1/bar.jpg",
    "web_url": "http://gitlab.example.com/groups/foo/bar",
    "full_name": "공유된 그룹",
    "full_path": "foo/shared"
  }
]

프로젝트의 공유 가능한 그룹 목록

프로젝트와 공유할 수 있는 그룹 목록을 가져옵니다.

GET /projects/:id/share_locations
속성 유형 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
search 문자열 아니요 특정 그룹 검색.
[
  {
    "id": 22,
    "web_url": "http://127.0.0.1:3000/groups/gitlab-org",
    "name": "Gitlab Org",
    "avatar_url": null,
    "full_name": "Gitlab Org",
    "full_path": "gitlab-org"
  },
  {
    "id": 25,
    "web_url": "http://127.0.0.1:3000/groups/gnuwget",
    "name": "Gnuwget",
    "avatar_url": null,
    "full_name": "Gnuwget",
    "full_path": "gnuwget"
  }
]

프로젝트 이벤트 가져오기

이벤트 API 문서를 참조하세요.

프로젝트 생성

인증된 사용자가 소유한 새 프로젝트를 생성합니다.

만약 HTTP 저장소를 공개적으로 접근할 수 없다면, https://username:password@gitlab.company.com/group/project.git URL에 인증 정보를 추가하세요. 여기서 passwordapi 스코프가 활성화된 공개 액세스 키입니다.

POST /projects

예시 요청:

curl --request POST --header "PRIVATE-TOKEN: <your-token>" \
     --header "Content-Type: application/json" --data '{
        "name": "new_project", "description": "New Project", "path": "new_project",
        "namespace_id": "42", "initialize_with_readme": "true"}' \
     --url "https://gitlab.example.com/api/v4/projects/"
속성 유형 필수 여부 설명
name string 예 (만약 path가 제공되지 않았을 경우) 새 프로젝트의 이름. 제공되지 않으면 path와 동일
path string 예 (만약 name이 제공되지 않았을 경우) 새 프로젝트의 저장소 이름. 제공되지 않으면 이름을 기반으로 생성됨 (소문자와 대시로 생성). GitLab 14.9부터, path는 특수 문자로 시작하거나 끝나지 않아야 하며 연속된 특수 문자를 포함해서는 안 됩니다.
allow_merge_on_skipped_pipeline boolean 아니요 빌드가 스킵된 상태에서 병합 요청이 병합될 수 있는지 여부를 설정합니다.
analytics_access_level string 아니요 disabled, private, 또는 enabled 중 하나
approvals_before_merge integer 아니요 기본적으로 병합 요청을 몇 명의 승인자가 승인해야 하는지. 승인 규칙을 구성하려면 병합 요청 승인 API를 참조하세요. GitLab 16.0에서 폐기됨. 프리미엄 및 얼티밋 전용.
… (이하 생략) …
## 사용자용 프로젝트 생성

> - `operations_access_level`은 [GitLab 16.0](https://gitlab.com/gitlab-org/gitlab/-/issues/385798)에서 제거되었습니다.
> - `model_registry_access_level`은 [GitLab 16.7](https://gitlab.com/gitlab-org/gitlab/-/issues/412734)에서 도입되었습니다.

지정된 사용자가 소유한 새 프로젝트를 생성합니다. 관리자만 사용할 수 있습니다.

HTTP 저장소가 공개적으로 접근할 수 없는 경우, URL에 인증 정보를 추가하십시오.
`https://username:password@gitlab.company.com/group/project.git`,
여기서 `password`는 `api` 스코프가 활성화된 공개 액세스 키입니다.

```plaintext
POST /projects/user/:user_id

| 속성 | 유형 | 필수 여부 | 설명 | |————————————————————–|———–|————|——–| | name | string | 예 | 새 프로젝트의 이름입니다. | | user_id | integer | 예 | 프로젝트 소유자의 사용자 ID입니다. | | allow_merge_on_skipped_pipeline | boolean | 아니오 | 스킵된 작업으로 병합 요청을 병합할 수 있는지 여부를 설정합니다. | | analytics_access_level | string | 아니오 | disabled, private, 또는 enabled 중 하나입니다. | … | wiki_enabled | boolean | 아니오 | (폐기 예정) 이 프로젝트의 위키를 활성화합니다. 대신 wiki_access_level을 사용하십시오. | ```

프로젝트 편집

  • operations_access_level는 GitLab 16.0에서 삭제되었습니다.
  • model_registry_access_level는 GitLab 16.7에서 도입되었습니다.

기존 프로젝트를 업데이트합니다.

HTTP 저장소에 접근할 수 없는 경우, URL에 인증 정보를 추가하십시오. https://username:password@gitlab.company.com/group/project.git 여기서 passwordapi 스코프가 활성화된 공개 액세스 키입니다.

PUT /projects/:id

예를 들어, GitLab.com 프로젝트의 공유 러너 설정을 토글하려면:

curl --request PUT --header "PRIVATE-TOKEN: <your-token>" \
     --url "https://gitlab.com/api/v4/projects/<your-project-ID>" \
     --data "shared_runners_enabled=true" # 끄려면: "shared_runners_enabled=false"

지원되는 속성:

속성 유형 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
allow_merge_on_skipped_pipeline 부울 아니요 건너뛴 작업으로 병합 요청을 병합할 수 있는지 여부 설정.
allow_pipeline_trigger_approve_deployment 부울 아니요 파이프라인 트리거러가 배포를 승인할 수 있는지 여부 설정. 프리미엄 및 얼티밋 전용.
only_allow_merge_if_all_status_checks_passed 부울 아니요 모든 상태 확인이 통과할 때까지 병합 요청의 병합을 차단해야하는지 여부 나타냄. 기본값은 false.

[GitLab 15.5에서 feature flag only_allow_merge_if_all_status_checks_passed가 기본적으로 비활성화된 상태로 도입되었습니다. 이 기능은 GitLab 15.9에서 기본적으로 활성화되었습니다. 얼티밋 전용.
analytics_access_level 문자열 아니요 disabled, private, 또는 enabled 중 하나.
approvals_before_merge 정수 아니요 기본적으로 병합 요청 승인하기 위해 몇 명의 승인자가 필요한지를 나타냅니다. GitLab 16.0에서 Deprecated되었습니다. 승인 규칙을 구성하려면 병합 요청 승인 API을 참조하십시오. 프리미엄 및 얼티밋 전용.
… (이하 생략) …      

프로젝트 포크

인증된 사용자 또는 제공된 사용자의 네임스페이스에 프로젝트를 포크합니다.

프로젝트의 포킹 작업은 비동기적으로 이루어지며 백그라운드 작업으로 완료됩니다. 요청은 즉시 반환됩니다. 프로젝트의 포킹이 완료되었는지 확인하려면 새 프로젝트의 import_status를 조회하세요.

POST /projects/:id/fork
속성 타입 필수 설명
id 정수 또는 문자열 프로젝트 ID 또는 URL로 인코딩된 경로.
branches 문자열 아니요 포크할 브랜치(모든 브랜치의 경우 비움).
description 문자열 아니요 포킹 후 결과 프로젝트에 할당된 설명.
mr_default_target_self 부울 아니요 포크된 프로젝트의 경우 병합 요청을 이 프로젝트로 지정합니다. false인 경우 대상은 상위 프로젝트입니다.
name 문자열 아니요 포킹 후 결과 프로젝트에 할당된 이름.
namespace_id 정수 아니요 포크 대상이 되는 네임스페이스의 ID.
namespace_path 문자열 아니요 포크 대상이 되는 네임스페이스의 경로.
namespace 정수 또는 문자열 아니요 (사용 중단) 프로젝트가 포크되는 네임스페이스의 ID 또는 경로.
path 문자열 아니요 포킹 후 결과 프로젝트에 할당된 경로.
visibility 문자열 아니요 포킹 후 결과 프로젝트에 할당된 가시성 레벨.

프로젝트의 포크 목록

지정된 프로젝트와 확립된 포크 관계가 있는 호출자의 액세스 가능한 프로젝트 목록을 나열합니다.

GET /projects/:id/forks
속성 타입 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL로 인코딩된 경로.
archived 부울 아니요 보관된 상태로 제한합니다.
membership 부울 아니요 현재 사용자가 멤버인 프로젝트로 제한합니다.
min_access_level 정수 아니요 현재 사용자의 최소 역할(access_level)로 제한합니다.
order_by 문자열 아니요 id, name, path, created_at, updated_at, 또는 last_activity_at 필드로 프로젝트를 반환합니다. 기본값은 created_at입니다.
owned 부울 아니요 명시적으로 현재 사용자가 소유한 프로젝트로 제한합니다.
search 문자열 아니요 검색 기준과 일치하는 프로젝트 목록을 반환합니다.
simple 부울 아니요 각 프로젝트에 대해 제한된 필드만 반환합니다. 인증되지 않은 경우 이 작업은 무효입니다. 단순한 필드만 반환됩니다.
sort 문자열 아니요 프로젝트를 asc 또는 desc 순서로 반환합니다. 기본값은 desc입니다.
starred 부울 아니요 현재 사용자가 즐겨찾기 한 프로젝트로 제한합니다.
statistics 부울 아니요 프로젝트 통계를 포함합니다. 적어도 Reporter 역할을 가진 사용자만 사용할 수 있습니다.
updated_after 날짜 및 시간 아니요 지정된 시간 이후에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ). GitLab 15.10에서 도입되었습니다.
updated_before 날짜 및 시간 아니요 지정된 시간 이전에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ). GitLab 15.10에서 도입되었습니다.
visibility 문자열 아니요 public, internal, 또는 private로 가시성으로 제한합니다.
with_custom_attributes 부울 아니요 응답에 사용자 지정 속성을 포함합니다. (관리자 전용)
with_issues_enabled 부울 아니요 활성화된 이슈 기능으로 제한합니다.
with_merge_requests_enabled 부울 아니요 활성화된 병합 요청 기능으로 제한합니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/forks"

예시 응답:

[
  {
    "id": 3,
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "default_branch": "main",
    "visibility": "internal",
    "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
    "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
    "web_url": "http://example.com/diaspora/diaspora-project-site",
    "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
    "topics": [
      "example",
      "disapora project"
    ],
    "name": "Diaspora Project Site",
    "name_with_namespace": "Diaspora / Diaspora Project Site",
    "path": "diaspora-project-site",
    "path_with_namespace": "diaspora/diaspora-project-site",
    "repository_object_format": "sha1",
    "issues_enabled": true,
    "open_issues_count": 1,
    "merge_requests_enabled": true,
    "jobs_enabled": true,
    "wiki_enabled": true,
    "snippets_enabled": false,
    "can_create_merge_request_in": true,
    "resolve_outdated_diff_discussions": false,
    "container_registry_enabled": false, // 사용 중단, 대신 `container_registry_access_level` 사용
    "container_registry_access_level": "disabled",
    "security_and_compliance_access_level": "disabled",
    "created_at": "2013-09-30T13:46:02Z",
    "updated_at": "2013-09-30T13:46:02Z",
    "last_activity_at": "2013-09-30T13:46:02Z",
    "creator_id": 3,
    "namespace": {
      "id": 3,
      "name": "Diaspora",
      "path": "diaspora",
      "kind": "group",
      "full_path": "diaspora"
    },
    "import_status": "none",
    "archived": true,
    "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
    "shared_runners_enabled": true,
    "group_runners_enabled": true,
    "forks_count": 0,
    "star_count": 1,
    "public_jobs": true,
    "shared_with_groups": [],
    "only_allow_merge_if_pipeline_succeeds": false,
    "allow_merge_on_skipped_pipeline": false,
    "restrict_user_defined_variables": false,
    "only_allow_merge_if_all_discussions_are_resolved": false,
    "remove_source_branch_after_merge": false,
    "request_access_enabled": false,
    "merge_method": "merge",
    "squash_option": "default_on",
    "autoclose_referenced_issues": true,
    "enforce_auth_checks_on_uploads": true,
    "suggestion_commit_message": null,
    "merge_commit_template": null,
    "container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
    "_links": {
      "self": "http://example.com/api/v4/projects",
      "issues": "http://example.com/api/v4/projects/1/issues",
      "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
      "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
      "labels": "http://example.com/api/v4/projects/1/labels",
      "events": "http://example.com/api/v4/projects/1/events",
      "members": "http://example.com/api/v4/projects/1/members",
      "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
    }
  }
]

프로젝트에 별표 표시

주어진 프로젝트에 별을 표시합니다. 프로젝트가 이미 별표로 표시된 경우 상태 코드 304를 반환합니다.

POST /projects/:id/star
속성 유형 필수여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL로 인코딩된 경로
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/star"

예시 응답:

{
  "id": 3,
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "default_branch": "main",
  "visibility": "internal",
  "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
  "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
  "web_url": "http://example.com/diaspora/diaspora-project-site",
  "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
  "tag_list": [ //deprecated, use `topics` instead
    "example",
    "disapora project"
  ],
  "topics": [
    "example",
    "disapora project"
  ],
  "name": "Diaspora Project Site",
  "name_with_namespace": "Diaspora / Diaspora Project Site",
  "path": "diaspora-project-site",
  "path_with_namespace": "diaspora/diaspora-project-site",
  "repository_object_format": "sha1",
  "issues_enabled": true,
  "open_issues_count": 1,
  "merge_requests_enabled": true,
  "jobs_enabled": true,
  "wiki_enabled": true,
  "snippets_enabled": false,
  "can_create_merge_request_in": true,
  "resolve_outdated_diff_discussions": false,
  "container_registry_enabled": false, // deprecated, use container_registry_access_level instead
  "container_registry_access_level": "disabled",
  "security_and_compliance_access_level": "disabled",
  "created_at": "2013-09-30T13:46:02Z",
  "updated_at": "2013-09-30T13:46:02Z",
  "last_activity_at": "2013-09-30T13:46:02Z",
  "creator_id": 3,
  "namespace": {
    "id": 3,
    "name": "Diaspora",
    "path": "diaspora",
    "kind": "group",
    "full_path": "diaspora"
  },
  "import_status": "none",
  "archived": true,
  "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
  "license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
  "license": {
    "key": "lgpl-3.0",
    "name": "GNU Lesser General Public License v3.0",
    "nickname": "GNU LGPLv3",
    "html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
    "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
  },
  "shared_runners_enabled": true,
  "group_runners_enabled": true,
  "forks_count": 0,
  "star_count": 1,
  "public_jobs": true,
  "shared_with_groups": [],
  "only_allow_merge_if_pipeline_succeeds": false,
  "allow_merge_on_skipped_pipeline": false,
  "restrict_user_defined_variables": false,
  "only_allow_merge_if_all_discussions_are_resolved": false,
  "remove_source_branch_after_merge": false,
  "request_access_enabled": false,
  "merge_method": "merge",
  "squash_option": "default_on",
  "autoclose_referenced_issues": true,
  "enforce_auth_checks_on_uploads": true,
  "suggestion_commit_message": null,
  "merge_commit_template": null,
  "container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
  "_links": {
    "self": "http://example.com/api/v4/projects",
    "issues": "http://example.com/api/v4/projects/1/issues",
    "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
    "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
    "labels": "http://example.com/api/v4/projects/1/labels",
    "events": "http://example.com/api/v4/projects/1/events",
    "members": "http://example.com/api/v4/projects/1/members",
    "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
  }
}

프로젝트 취소 별표 표시

  • 응답에서 _links.cluster_agents 속성은 GitLab 14.10에 도입되었습니다.

특정 프로젝트의 별표를 취소합니다. 프로젝트가 별표가 되어 있지 않은 경우 상태 코드 304를 반환합니다.

POST /projects/:id/unstar
속성 유형 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/unstar"

예시 응답:

{
  "id": 3,
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "default_branch": "main",
  "visibility": "internal",
  "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
  "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
  "web_url": "http://example.com/diaspora/diaspora-project-site",
  "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
  "tag_list": [ //deprecated, use `topics` instead
    "example",
    "disapora project"
  ],
  "topics": [
    "example",
    "disapora project"
  ],
  "name": "Diaspora Project Site",
  "name_with_namespace": "Diaspora / Diaspora Project Site",
  "path": "diaspora-project-site",
  "path_with_namespace": "diaspora/diaspora-project-site",
  "repository_object_format": "sha1",
  "issues_enabled": true,
  "open_issues_count": 1,
  "merge_requests_enabled": true,
  "jobs_enabled": true,
  "wiki_enabled": true,
  "snippets_enabled": false,
  "can_create_merge_request_in": true,
  "resolve_outdated_diff_discussions": false,
  "container_registry_enabled": false, // deprecated, use container_registry_access_level instead
  "container_registry_access_level": "disabled",
  "security_and_compliance_access_level": "disabled",
  "created_at": "2013-09-30T13:46:02Z",
  "updated_at": "2013-09-30T13:46:02Z",
  "last_activity_at": "2013-09-30T13:46:02Z",
  "creator_id": 3,
  "namespace": {
    "id": 3,
    "name": "Diaspora",
    "path": "diaspora",
    "kind": "group",
    "full_path": "diaspora"
  },
  "import_status": "none",
  "archived": true,
  "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
  "license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
  "license": {
    "key": "lgpl-3.0",
    "name": "GNU Lesser General Public License v3.0",
    "nickname": "GNU LGPLv3",
    "html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
    "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
  },
  "shared_runners_enabled": true,
  "group_runners_enabled": true,
  "forks_count": 0,
  "star_count": 0,
  "public_jobs": true,
  "shared_with_groups": [],
  "only_allow_merge_if_pipeline_succeeds": false,
  "allow_merge_on_skipped_pipeline": false,
  "restrict_user_defined_variables": false,
  "only_allow_merge_if_all_discussions_are_resolved": false,
  "remove_source_branch_after_merge": false,
  "request_access_enabled": false,
  "merge_method": "merge",
  "squash_option": "default_on",
  "autoclose_referenced_issues": true,
  "enforce_auth_checks_on_uploads": true,
  "suggestion_commit_message": null,
  "merge_commit_template": null,
  "container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
  "_links": {
    "self": "http://example.com/api/v4/projects",
    "issues": "http://example.com/api/v4/projects/1/issues",
    "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
    "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
    "labels": "http://example.com/api/v4/projects/1/labels",
    "events": "http://example.com/api/v4/projects/1/events",
    "members": "http://example.com/api/v4/projects/1/members",
    "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
  }
}

프로젝트의 스타 수를 나열하기

지정된 프로젝트를 스타 처리한 사용자를 나열합니다.

GET /projects/:id/starrers
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
search 문자열 아니요 특정 사용자를 검색합니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/starrers"

예시 응답:

[
  {
    "starred_since": "2019-01-28T14:47:30.642Z",
    "user": {
        "id": 1,
        "username": "jane_smith",
        "name": "Jane Smith",
        "state": "active",
        "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
        "web_url": "http://localhost:3000/jane_smith"
    }
  },
  {
    "starred_since": "2018-01-02T11:40:26.570Z",
    "user": {
      "id": 2,
      "username": "janine_smith",
      "name": "Janine Smith",
      "state": "blocked",
      "avatar_url": "http://gravatar.com/../e32131cd8.jpeg",
      "web_url": "http://localhost:3000/janine_smith"
    }
  }
]

사용된 언어

프로젝트에서 사용된 언어와 백분율 값을 가져옵니다.

GET /projects/:id/languages
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/languages"

예시 응답:

{
  "Ruby": 66.69,
  "JavaScript": 22.98,
  "HTML": 7.91,
  "CoffeeScript": 2.42
}

프로젝트 아카이브

  • 응답에 있는 _links.cluster_agents 속성은 GitLab 14.10에서 도입되었습니다.

사용자가 관리자이거나 이 프로젝트의 소유자인 경우 프로젝트를 아카이브합니다. 이 작업은 항등성을 가지므로 이미 아카이브된 프로젝트를 아카이브해도 프로젝트가 변경되지 않습니다.

POST /projects/:id/archive
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/archive"

예시 응답:

{
  "id": 3,
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "default_branch": "main",
  "visibility": "private",
  "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
  "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
  "web_url": "http://example.com/diaspora/diaspora-project-site",
  "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
  "tag_list": [ //deprecated, use `topics` instead
    "example",
    "disapora project"
  ],
  "topics": [
    "example",
    "disapora project"
  ],
  "owner": {
    "id": 3,
    "name": "Diaspora",
    "created_at": "2013-09-30T13:46:02Z"
  },
  "name": "Diaspora Project Site",
  "name_with_namespace": "Diaspora / Diaspora Project Site",
  "path": "diaspora-project-site",
  "path_with_namespace": "diaspora/diaspora-project-site",
  "repository_object_format": "sha1",
  "issues_enabled": true,
  "open_issues_count": 1,
  "merge_requests_enabled": true,
  "jobs_enabled": true,
  "wiki_enabled": true,
  "snippets_enabled": false,
  "can_create_merge_request_in": true,
  "resolve_outdated_diff_discussions": false,
  "container_registry_enabled": false, // deprecated, use container_registry_access_level instead
  "container_registry_access_level": "disabled",
  "security_and_compliance_access_level": "disabled",
  "created_at": "2013-09-30T13:46:02Z",
  "updated_at": "2013-09-30T13:46:02Z",
  "last_activity_at": "2013-09-30T13:46:02Z",
  "creator_id": 3,
  "namespace": {
    "id": 3,
    "name": "Diaspora",
    "path": "diaspora",
    "kind": "group",
    "full_path": "diaspora"
  },
  "import_status": "none",
  "import_error": null,
  "permissions": {
    "project_access": {
      "access_level": 10,
      "notification_level": 3
    },
    "group_access": {
      "access_level": 50,
      "notification_level": 3
    }
  },
  "archived": true,
  "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
  "license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
  "license": {
    "key": "lgpl-3.0",
    "name": "GNU Lesser General Public License v3.0",
    "nickname": "GNU LGPLv3",
    "html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
    "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
  },
  "shared_runners_enabled": true,
  "group_runners_enabled": true,
  "forks_count": 0,
  "star_count": 0,
  "runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
  "ci_default_git_depth": 50,
  "ci_forward_deployment_enabled": true,
  "ci_forward_deployment_rollback_allowed": true,
  "ci_allow_fork_pipelines_to_run_in_parent_project": true,
  "ci_separated_caches": true,
  "ci_restrict_pipeline_cancellation_role": "developer",
  "public_jobs": true,
  "shared_with_groups": [],
  "only_allow_merge_if_pipeline_succeeds": false,
  "allow_merge_on_skipped_pipeline": false,
  "restrict_user_defined_variables": false,
  "only_allow_merge_if_all_discussions_are_resolved": false,
  "remove_source_branch_after_merge": false,
  "request_access_enabled": false,
  "merge_method": "merge",
  "squash_option": "default_on",
  "autoclose_referenced_issues": true,
  "enforce_auth_checks_on_uploads": true,
  "suggestion_commit_message": null,
  "merge_commit_template": null,
  "container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
  "_links": {
    "self": "http://example.com/api/v4/projects",
    "issues": "http://example.com/api/v4/projects/1/issues",
    "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
    "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
    "labels": "http://example.com/api/v4/projects/1/labels",
    "events": "http://example.com/api/v4/projects/1/events",
    "members": "http://example.com/api/v4/projects/1/members",
    "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
  }
}


## 프로젝트의 비아카이빙 해제

> - 응답에서 `_links.cluster_agents` 속성은 GitLab 14.10에서 [도입되었습니다](https://gitlab.com/gitlab-org/gitlab/-/issues/347047).

관리자이거나  프로젝트의 소유자인 경우 프로젝트의 비아카이빙을 해제합니다.  작업은 idempotent하므로 아카이빈되지 않은 프로젝트를 아카이빙 해제하더라도 프로젝트가 변경되지는 않습니다.

```plaintext
POST /projects/:id/unarchive
속성 유형 필수 여부 설명
id 정수 또는 문자열 Yes 프로젝트의 ID 또는 URL-인코딩된 경로.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/unarchive"

예시 응답:

{
  "id": 3,
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "default_branch": "main",
  "visibility": "private",
  "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
  "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
  "web_url": "http://example.com/diaspora/diaspora-project-site",
  "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
  "tag_list": [ //deprecated, use `topics` instead
    "example",
    "disapora project"
  ],
  "topics": [
    "example",
    "disapora project"
  ],
  "owner": {
    "id": 3,
    "name": "Diaspora",
    "created_at": "2013-09-30T13:46:02Z"
  },
  "name": "Diaspora Project Site",
  "name_with_namespace": "Diaspora / Diaspora Project Site",
  "path": "diaspora-project-site",
  "path_with_namespace": "diaspora/diaspora-project-site",
  "repository_object_format": "sha1",
  "issues_enabled": true,
  "open_issues_count": 1,
  "merge_requests_enabled": true,
  "jobs_enabled": true,
  "wiki_enabled": true,
  "snippets_enabled": false,
  "can_create_merge_request_in": true,
  "resolve_outdated_diff_discussions": false,
  "container_registry_enabled": false, // deprecated, use container_registry_access_level instead
  "container_registry_access_level": "disabled",
  "security_and_compliance_access_level": "disabled",
  "created_at": "2013-09-30T13:46:02Z",
  "updated_at": "2013-09-30T13:46:02Z",
  "last_activity_at": "2013-09-30T13:46:02Z",
  "creator_id": 3,
  "namespace": {
    "id": 3,
    "name": "Diaspora",
    "path": "diaspora",
    "kind": "group",
    "full_path": "diaspora"
  },
  "import_status": "none",
  "import_error": null,
  "permissions": {
    "project_access": {
      "access_level": 10,
      "notification_level": 3
    },
    "group_access": {
      "access_level": 50,
      "notification_level": 3
    }
  },
  "archived": false,
  "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
  "license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
  "license": {
    "key": "lgpl-3.0",
    "name": "GNU Lesser General Public License v3.0",
    "nickname": "GNU LGPLv3",
    "html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
    "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
  },
  "shared_runners_enabled": true,
  "group_runners_enabled": true,
  "forks_count": 0,
  "star_count": 0,
  "runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
  "ci_default_git_depth": 50,
  "ci_forward_deployment_enabled": true,
  "ci_forward_deployment_rollback_allowed": true,
  "ci_allow_fork_pipelines_to_run_in_parent_project": true,
  "ci_separated_caches": true,
  "ci_restrict_pipeline_cancellation_role": "developer",
  "public_jobs": true,
  "shared_with_groups": [],
  "only_allow_merge_if_pipeline_succeeds": false,
  "allow_merge_on_skipped_pipeline": false,
  "restrict_user_defined_variables": false,
  "only_allow_merge_if_all_discussions_are_resolved": false,
  "remove_source_branch_after_merge": false,
  "request_access_enabled": false,
  "merge_method": "merge",
  "squash_option": "default_on",
  "autoclose_referenced_issues": true,
  "enforce_auth_checks_on_uploads": true,
  "suggestion_commit_message": null,
  "merge_commit_template": null,
  "container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
  "_links": {
    "self": "http://example.com/api/v4/projects",
    "issues": "http://example.com/api/v4/projects/1/issues",
    "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
    "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
    "labels": "http://example.com/api/v4/projects/1/labels",
    "events": "http://example.com/api/v4/projects/1/events",
    "members": "http://example.com/api/v4/projects/1/members",
    "cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
  }
}

프로젝트 삭제

이 엔드포인트:

경고: 관리 영역의 삭제 보호 설정에서 즉시 프로젝트 삭제 옵션이 GitLab 15.9에서 사용 중지되었으며 GitLab 16.0에서 제거되었습니다.

DELETE /projects/:id
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
full_path 문자열 아니오 permanently_remove와 함께 사용할 프로젝트의 전체 경로. GitLab 15.11에서 도입. 프로젝트 경로를 찾으려면 단일 프로젝트 가져오기에서 path_with_namespace를 사용하십시오. Premium 및 Ultimate 전용.
permanently_remove 부울/문자열 아니오 삭제로 표시된 프로젝트를 즉시 삭제합니다. GitLab 15.11에서 도입. 프리미엄 및 얼티메이트 전용.

삭제된 프로젝트 복원

상세 정보: 티어: 프리미엄, 얼티메이트 제공: GitLab.com, Self-managed, GitLab Dedicated

삭제로 표시된 프로젝트를 복원합니다.

POST /projects/:id/restore
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.

파일 업로드

  • 최대 첨부 파일 크기 강제 적용은 GitLab 13.11에서 플래그enforce_max_attachment_size_upload_api가 있는 상태로 도입되었습니다. 기본적으로 비활성화되어 있습니다.
  • 최대 첨부 파일 크기는 GitLab 13.11에서 활성화되었습니다.
  • GitLab 15.10에서 일반 사용 가능되었습니다. 기능 플래그 enforce_max_attachment_size_upload_api가 제거되었습니다.

지정된 프로젝트에 파일을 업로드하여 이슈 또는 병합 요청 설명 또는 코멘트에서 사용합니다.

POST /projects/:id/uploads
속성 유형 필수 여부 설명
file 문자열 업로드할 파일.
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.

파일을 파일 시스템에서 업로드하려면 --form 인수를 사용합니다. 이렇게 하면 cURL이 Content-Type: multipart/form-data 헤더를 사용하여 데이터를 게시합니다. file= 매개 변수는 파일 시스템의 파일을 가리키고 앞에 @가 있어야 합니다. 예:

curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
     --form "file=@dk.png" "https://gitlab.example.com/api/v4/projects/5/uploads"

반환된 객체:

{
  "alt": "dk",
  "url": "/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png",
  "full_path": "/namespace1/project1/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png",
  "markdown": "![dk](/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png)"
}

반환된 url은 프로젝트 경로를 기준으로 상대적입니다. 반환된 full_path는 파일의 절대 경로입니다. 마크다운 컨텍스트에서는 markdown 형식을 사용할 때 링크가 확장됩니다.

프로젝트 아바타 업로드

지정된 프로젝트에 아바타를 업로드합니다.

PUT /projects/:id
속성 유형 필수 설명
avatar string Yes 업로드할 파일입니다.
id integer 또는 string Yes 프로젝트의 ID 또는 URL-encoded path.

파일 시스템에서 아바타를 업로드하려면 --form 인수를 사용하십시오. 이렇게 하면 cURL이 Content-Type: multipart/form-data 헤더를 사용하여 데이터를 게시합니다. file= 매개변수는 파일 시스템에서 이미지 파일을 가리키고 @로 시작해야 합니다. 예:

예시 요청:

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
     --form "avatar=@dk.png" "https://gitlab.example.com/api/v4/projects/5"

반환된 객체:

{
  "avatar_url": "https://gitlab.example.com/uploads/-/system/project/avatar/2/dk.png"
}

프로젝트 아바타 다운로드

프로젝트 아바타를 가져옵니다. 프로젝트에 대한 공개적인 액세스가 가능한 경우 인증 없이 이 엔드포인트에 액세스할 수 있습니다.

GET /projects/:id/avatar
속성 유형 필수 설명
id integer 또는 string yes 프로젝트의 ID 또는 URL-encoded path.

예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/avatar"

프로젝트 아바타 삭제

프로젝트 아바타를 제거하려면 avatar 속성에 빈 값을 사용하십시오.

예시 요청:

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
     --data "avatar=" "https://gitlab.example.com/api/v4/projects/5"

그룹과 프로젝트 공유

그룹과 프로젝트를 공유할 수 있습니다.

POST /projects/:id/share
속성 유형 필수 설명
group_access integer Yes 그룹에 부여할 역할(access_level).
group_id integer Yes 공유할 그룹의 ID.
id integer 또는 string Yes 프로젝트의 ID 또는 URL-encoded path.
expires_at string No ISO 8601 형식으로 공유 만료 날짜. 예: 2016-09-26.

그룹 내에서 공유된 프로젝트 링크 삭제

그룹에서 프로젝트를 공유 해제합니다. 성공 시 204와 내용이 없이 반환됩니다.

DELETE /projects/:id/share/:group_id
속성 유형 필수 설명
group_id integer Yes 그룹의 ID.
id integer 또는 string Yes 프로젝트의 ID 또는 URL-encoded path.
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/share/17"

프로젝트 멤버 가져오기

다른 프로젝트에서 멤버를 가져옵니다.

대상 프로젝트에서 가져오는 멤버의 역할이:

  • 관리자인 경우, 소스 프로젝트의 소유자 역할을 가진 멤버가 관리자 역할로 가져옵니다.
  • 소유자인 경우, 소스 프로젝트의 소유자 역할을 가진 멤버가 소유자 역할로 가져옵니다.
POST /projects/:id/import_project_members/:project_id
속성 유형 필수 설명
id integer 또는 string Yes 멤버를 받을 대상 프로젝트의 ID 또는 URL-encoded path.
project_id integer 또는 string Yes 멤버를 가져올 소스 프로젝트의 ID 또는 URL-encoded path.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/import_project_members/32"

반환:

  • 성공한 경우 200 OK.
  • 대상 또는 소스 프로젝트가 요청자에 의해 존재하지 않거나 액세스할 수 없는 경우 404 Project Not Found.
  • 프로젝트 멤버 가져오기가 성공적으로 완료되지 않은 경우 422 Unprocessable Entity.

예시 응답:

모든 이메일이 성공적으로 전송된 경우 (200 HTTP 상태 코드):

{  "status":  "success"  }

1명 이상의 멤버를 가져오는 중에 오류가 발생한 경우 (200 HTTP 상태 코드):

{
  "status": "error",
  "message": {
               "john_smith": "일부 개별 오류 메시지",
               "jane_smith": "일부 개별 오류 메시지"
             },
  "total_members_count": 3
}

시스템 오류가 발생한 경우 (404422 HTTP 상태 코드):

{  "message":  "가져오기 실패"  }

후크

프로젝트 후크 또는 Webhook으로도 불립니다. 시스템 후크와는 달리 시스템 전반에 걸쳐 사용됩니다.

프로젝트 후크 목록

프로젝트 후크 목록을 가져옵니다.

GET /projects/:id/hooks
속성 유형 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.

프로젝트 후크 가져오기

특정 프로젝트의 후크를 가져옵니다.

GET /projects/:id/hooks/:hook_id
속성 유형 필수 설명
hook_id 정수 프로젝트 후크의 ID.
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
{
  "id": 1,
  "url": "http://example.com/hook",
  "project_id": 3,
  "push_events": true,
  "push_events_branch_filter": "",
  "issues_events": true,
  "confidential_issues_events": true,
  "merge_requests_events": true,
  "tag_push_events": true,
  "note_events": true,
  "confidential_note_events": true,
  "job_events": true,
  "pipeline_events": true,
  "wiki_page_events": true,
  "deployment_events": true,
  "releases_events": true,
  "enable_ssl_verification": true,
  "repository_update_events": false,
  "alert_status": "executable",
  "disabled_until": null,
  "url_variables": [ ],
  "created_at": "2012-10-12T17:04:47Z",
  "resource_access_token_events": true,
  "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}"
}

프로젝트 후크 추가

지정된 프로젝트에 후크를 추가합니다.

POST /projects/:id/hooks
속성 유형 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
url 문자열 후크 URL.
confidential_issues_events 부울 아니요 기밀 문제 이벤트에서 후크 트리거.
confidential_note_events 부울 아니요 기밀 메모 이벤트에서 후크 트리거.
deployment_events 부울 아니요 배포 이벤트에서 후크 트리거.
enable_ssl_verification 부울 아니요 후크 트리거 시 SSL 검증 수행.
issues_events 부울 아니요 문제 이벤트에서 후크 트리거.
job_events 부울 아니요 작업 이벤트에서 후크 트리거.
merge_requests_events 부울 아니요 병합 요청 이벤트에서 후크 트리거.
note_events 부울 아니요 노트 이벤트에서 후크 트리거.
pipeline_events 부울 아니요 파이프라인 이벤트에서 후크 트리거.
push_events_branch_filter 문자열 아니요 일치하는 브랜치에 대한 푸시 이벤트에서 후크 트리거.
push_events 부울 아니요 푸시 이벤트에서 후크 트리거.
releases_events 부울 아니요 릴리스 이벤트에서 후크 트리거.
tag_push_events 부울 아니요 태그 푸시 이벤트에서 후크 트리거.
token 문자열 아니요 수신된 페이로드를 유효성 검사하기 위한 비밀 토큰. 응답에 토큰이 반환되지 않습니다.
wiki_page_events 부울 아니요 위키 페이지 이벤트에서 후크 트리거.
resource_access_token_events 부울 아니요 프로젝트 액세스 토큰 만료 이벤트에서 후크 트리거.
custom_webhook_template 문자열 아니요 후크에 대한 사용자 정의 웹훅 템플릿.

프로젝트 후크 수정

지정된 프로젝트의 후크를 수정합니다.

PUT /projects/:id/hooks/:hook_id
속성 유형 필수 설명
hook_id 정수 프로젝트 후크의 ID.
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
url 문자열 후크 URL.
confidential_issues_events 부울 아니요 기밀 문제 이벤트에서 후크 트리거.
confidential_note_events 부울 아니요 기밀 노트 이벤트에서 후크 트리거.
deployment_events 부울 아니요 배포 이벤트에서 후크 트리거.
enable_ssl_verification 부울 아니요 후크 트리거 시 SSL 검증 수행.
issues_events 부울 아니요 문제 이벤트에서 후크 트리거.
job_events 부울 아니요 작업 이벤트에서 후크 트리거.
merge_requests_events 부울 아니요 병합 요청 이벤트에서 후크 트리거.
note_events 부울 아니요 노트 이벤트에서 후크 트리거.
pipeline_events 부울 아니요 파이프라인 이벤트에서 후크 트리거.
push_events_branch_filter 문자열 아니요 일치하는 브랜치에 대한 푸시 이벤트에서 후크 트리거.
push_events 부울 아니요 푸시 이벤트에서 후크 트리거.
releases_events 부울 아니요 릴리스 이벤트에서 후크 트리거.
tag_push_events 부울 아니요 태그 푸시 이벤트에서 후크 트리거.
token 문자열 아니요 수신된 페이로드를 유효성 검사하기 위한 비밀 토큰. 응답에 토큰이 반환되지 않습니다. 웹훅 URL을 변경할 경우, 비밀 토큰이 재설정되어 보존되지 않습니다.
wiki_page_events 부울 아니요 위키 페이지 이벤트에서 후크 트리거.
resource_access_token_events 부울 아니요 프로젝트 액세스 토큰 만료 이벤트에서 후크 트리거.
custom_webhook_template 문자열 아니요 후크에 대한 사용자 정의 웹훅 템플릿.

프로젝트 후크 삭제

프로젝트에서 후크를 제거합니다. 이 방법은 동형성을 가지며 여러 번 호출할 수 있습니다. 후크가 사용 가능하거나 아닌 경우 모두 해당됩니다.

DELETE /projects/:id/hooks/:hook_id
속성 유형 필수 설명
hook_id integer Yes 프로젝트 후크의 ID입니다.
id integer 또는 string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로입니다.

후크가 사용 가능하거나 아닌 경우 JSON 응답이 다릅니다. 프로젝트 후크가 사용 가능한 경우 JSON 응답에 포함되고 비어있는 응답이 반환됩니다.

포크 관계

기존 프로젝트 간의 포크된 관계를 수정하는 것을 허용합니다. 프로젝트 소유자 및 관리자만 사용할 수 있습니다.

기존 프로젝트 간에 포크된 관계 생성

POST /projects/:id/fork/:forked_from_id
속성 유형 필수 설명
forked_from_id ID Yes 포크된 원본 프로젝트의 ID입니다.
id integer 또는 string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로입니다.

기존 포크된 관계 삭제

DELETE /projects/:id/fork
속성 유형 필수 설명
id integer 또는 string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로입니다.

이름별 프로젝트 검색

인증된 사용자에게 접근 가능한 프로젝트 중 이름별로 검색합니다. 이 엔드포인트는 프로젝트가 공개적으로 접근 가능한 경우 인증 없이 액세스할 수 있습니다.

GET /projects
속성 유형 필수 설명
search string Yes 프로젝트 이름에 포함된 문자열입니다.
order_by string 아니요 id, name, created_at, last_activity_at 필드로 정렬된 요청을 반환합니다.
sort string 아니요 asc 또는 desc 순서대로 정렬된 요청을 반환합니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects?search=test"

프로젝트를 위한 하우스키퍼 작업 시작

POST /projects/:id/housekeeping
속성 유형 필수 설명
id integer 또는 string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로입니다.
task string 아니요 수동으로 도달할 수 없는 객체의 가지치기를 트리거하기 위해 prune을 또는 즉시 하우스키퍼를 트리거하기 위해 eager를 지정합니다.

푸시 규칙

Tier: Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

프로젝트 푸시 규칙 가져오기

프로젝트의 푸시 규칙을 가져옵니다.

GET /projects/:id/push_rule
속성 유형 필수 설명
id integer 또는 string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로
{
  "id": 1,
  "project_id": 3,
  "commit_message_regex": "Fixes \\d+\\..*",
  "commit_message_negative_regex": "ssh\\:\\/\\/",
  "branch_name_regex": "",
  "deny_delete_tag": false,
  "created_at": "2012-10-12T17:04:47Z",
  "member_check": false,
  "prevent_secrets": false,
  "author_email_regex": "",
  "file_name_regex": "",
  "max_file_size": 5,
  "commit_committer_check": false,
  "commit_committer_name_check": false,
  "reject_unsigned_commits": false
}

프로젝트 푸시 규칙 추가

지정된 프로젝트에 푸시 규칙을 추가합니다.

POST /projects/:id/push_rule
속성 유형 필수 설명
id integer 또는 string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로입니다.
author_email_regex string No 모든 커밋 작성자 이메일이 이에 일치해야 합니다. 예: @my-company.com$.
branch_name_regex string No 모든 브랜치 이름이 이에 일치해야 합니다. 예: (feature|hotfix)\/*.
commit_committer_check boolean No 사용자는 자신의 확인된 이메일 중 하나인 경우에만 이 리포지토리에 커밋을 푸시할 수 있습니다.
commit_committer_name_check boolean No 사용자는 커밋 작성자 이름이 자신의 GitLab 계정 이름과 일치하는 경우에만 이 리포지토리에 커밋을 푸시할 수 있습니다.
commit_message_negative_regex string No 어떤 커밋 메시지도 이에 일치하지 않아야 합니다. 예: ssh\:\/\/.
commit_message_regex string No 모든 커밋 메시지가 이에 일치해야 합니다. 예: Fixed \d+\..*.
deny_delete_tag boolean No 태그를 삭제하는 것을 거부합니다.
file_name_regex string No 커밋된 파일명이 이에 일치하지 않아야 합니다. 예: (jar|exe)$.
max_file_size integer No 최대 파일 크기 (MB).
member_check boolean No 커밋을 기존 GitLab 사용자의 작성자 (이메일)에 의해 제한합니다.
prevent_secrets boolean No GitLab은 비밀 정보를 포함할 가능성이 있는 파일을 거부합니다.
reject_unsigned_commits boolean No 커밋이 GPG를 통해 서명되지 않았을 때 거부합니다.

프로젝트 푸시 규칙 편집

지정된 프로젝트의 푸시 규칙을 편집합니다.

PUT /projects/:id/push_rule
속성 유형 필수 여부 설명
id 정수 또는 문자열 필수 프로젝트의 ID 또는 URL-인코딩된 경로.
author_email_regex 문자열 아니오 모든 커밋 작성자 이메일은 이것과 일치해야 합니다. 예: @my-company.com$.
branch_name_regex 문자열 아니오 모든 브랜치 이름은 이것과 일치해야 합니다. 예: (feature|hotfix)\/*.
commit_committer_check 부울 아니오 사용자는 커미터 이메일이 자신의 확인된 이메일 중 하나인 경우에만 이 리포지토리로 커밋을 푸시할 수 있습니다.
commit_committer_name_check 부울 아니오 사용자는 커밋 작성자 이름이 자신의 GitLab 계정 이름과 일치할 때에만 이 리포지토리로 커밋을 푸시할 수 있습니다.
commit_message_negative_regex 문자열 아니오 어떤 커밋 메시지도 이것과 일치하지 않아야 합니다. 예: ssh\:\/\/.
commit_message_regex 문자열 아니오 모든 커밋 메시지는 이것과 일치해야 합니다. 예: Fixed \d+\..*.
deny_delete_tag 부울 아니오 태그를 삭제하는 것을 거부합니다.
file_name_regex 문자열 아니오 모든 커밋된 파일 이름은 이것과 일치해서는 됩니다. 예: (jar|exe)$.
max_file_size 정수 아니오 최대 파일 크기 (MB).
member_check 부울 아니오 커밋을 쓴 사람(이메일)을 GitLab 사용자로 제한합니다.
prevent_secrets 부울 아니오 GitLab은 비밀 정보가 포함될 가능성이 있는 파일을 거부합니다.
reject_unsigned_commits 부울 아니오 커밋이 GPG로 서명되지 않았을 때 거부합니다.

프로젝트 푸시 규칙 삭제

  • 13.9에서 GitLab 프리미엄으로 이동되었습니다.

프로젝트에서 푸시 규칙을 제거합니다.

DELETE /projects/:id/push_rule
속성 유형 필수 여부 설명
id 정수 또는 문자열 필수 프로젝트의 ID 또는 URL-인코딩된 경로.

사용자가 프로젝트를 전송할 수 있는 그룹 가져오기

사용자가 프로젝트를 전송할 수 있는 그룹 목록을 가져옵니다.

GET /projects/:id/transfer_locations
속성 유형 필수 여부 설명
id 정수 또는 문자열 필수 프로젝트의 ID 또는 URL-인코딩된 경로.
search 문자열 아니오 검색할 그룹 이름입니다.

예시 요청:

curl --request GET "https://gitlab.example.com/api/v4/projects/1/transfer_locations"

예시 응답:

[
  {
    "id": 27,
    "web_url": "https://gitlab.example.com/groups/gitlab",
    "name": "GitLab",
    "avatar_url": null,
    "full_name": "GitLab",
    "full_path": "GitLab"
  },
  {
    "id": 31,
    "web_url": "https://gitlab.example.com/groups/foobar",
    "name": "FooBar",
    "avatar_url": null,
    "full_name": "FooBar",
    "full_path": "FooBar"
  }
]

프로젝트를 새로운 네임스페이스로 전송

프로젝트를 전송하기 전에 프로젝트를 전송하려는 네임스페이스로 전송하려면 프로젝트 문서를 참조하십시오.

PUT /projects/:id/transfer
속성 유형 필수 여부 설명
id 정수 또는 문자열 필수 프로젝트의 ID 또는 URL-인코딩된 경로.
namespace 정수 또는 문자열 필수 프로젝트를 전송할 네임스페이스의 ID 또는 경로입니다.

예시 요청:

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/transfer?namespace=14"

예시 응답:

  {
  "id": 7,
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "name": "hello-world",
  "name_with_namespace": "cute-cats / hello-world",
  "path": "hello-world",
  "path_with_namespace": "cute-cats/hello-world",
  "created_at": "2020-10-15T16:25:22.415Z",
  "updated_at": "2020-10-15T16:25:22.415Z",
  "default_branch": "main",
  "tag_list": [], //deprecated, use `topics` instead
  "topics": [],
  "ssh_url_to_repo": "git@gitlab.example.com:cute-cats/hello-world.git",
  "http_url_to_repo": "https://gitlab.example.com/cute-cats/hello-world.git",
  "web_url": "https://gitlab.example.com/cute-cats/hello-world",
  "readme_url": "https://gitlab.example.com/cute-cats/hello-world/-/blob/main/README.md",
  "avatar_url": null,
  "forks_count": 0,
  "star_count": 0,
  "last_activity_at": "2020-10-15T16:25:22.415Z",
  "namespace": {
    "id": 18,
    "name": "cute-cats",
    "path": "cute-cats",
    "kind": "group",
    "full_path": "cute-cats",
    "parent_id": null,
    "avatar_url": null,
    "web_url": "https://gitlab.example.com/groups/cute-cats"
  },
  "container_registry_image_prefix": "registry.example.com/cute-cats/hello-world",
  "_links": {
    "self": "https://gitlab.example.com/api/v4/projects/7",
    "issues": "https://gitlab.example.com/api/v4/projects/7/issues",
    "merge_requests": "https://gitlab.example.com/api/v4/projects/7/merge_requests",
    "repo_branches": "https://gitlab.example.com/api/v4/projects/7/repository/branches",
    "labels": "https://gitlab.example.com/api/v4/projects/7/labels",
    "events": "https://gitlab.example.com/api/v4/projects/7/events",
    "members": "https://gitlab.example.com/api/v4/projects/7/members"
  },
  "packages_enabled": true,
  "empty_repo": false,
  "archived": false,
  "visibility": "private",
  "resolve_outdated_diff_discussions": false,
  "container_registry_enabled": true, // deprecated, use container_registry_access_level instead
  "container_registry_access_level": "enabled",
  "container_expiration_policy": {
    "cadence": "7d",
    "enabled": false,
    "keep_n": null,
    "older_than": null,
    "name_regex": null,
    "name_regex_keep": null,
    "next_run_at": "2020-10-22T16:25:22.746Z"
  },
  ...
}

브랜치

Branches 문서에서 자세히 알아보기.

프로젝트 가져오기/내보내기

프로젝트 가져오기/내보내기 문서에서 자세히 알아보기.

프로젝트 구성원

프로젝트 구성원 문서에서 자세히 알아보기.

프로젝트 취약점

프로젝트 취약점 문서에서 자세히 알아보기.

프로젝트의 풀 미러 상세정보 가져오기

Tier: Premium, Ultimate Offering: GitLab.com, Self-Managed, GitLab Dedicated

프로젝트의 풀 미러의 세부 정보를 반환합니다.

GET /projects/:id/mirror/pull

지원되는 속성:

속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL-encoded path.

예시 요청:

curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/mirror/pull"

예시 응답:

{
  "id": 101486,
  "last_error": null,
  "last_successful_update_at": "2020-01-06T17:32:02.823Z",
  "last_update_at": "2020-01-06T17:32:02.823Z",
  "last_update_started_at": "2020-01-06T17:31:55.864Z",
  "update_status": "finished",
  "url": "https://*****:*****@gitlab.com/gitlab-org/security/gitlab.git"
}

프로젝트의 풀 미러 구성

Tier: Premium, Ultimate Offering: GitLab.com, Self-Managed, GitLab Dedicated
  • mirror_branch_regex 필드는 GitLab 15.8에서 mirror_only_branches_match_regex라는 플래그와 함께 도입되었으며 기본적으로 비활성화되어 있습니다.
  • GitLab 16.0에서 기본적으로 활성화됨.
  • GitLab 16.2에서 일반적으로 사용 가능함. mirror_only_branches_match_regex 기능 플래그가 제거됨.

원격 저장소가 공개적으로 접근 가능한 경우 또는 username:token 인증을 통해 API를 통해 새 프로젝트를 생성하거나기존 프로젝트를 업데이트할 때 풀 미러를 구성합니다. 당신의 HTTP 저장소가 공개적으로 접근이 불가능한 경우, URL에 인증 정보를 추가할 수 있습니다: https://username:token@gitlab.company.com/group/project.git, 여기서 token개인 액세스 토큰이며 API 스코프가 활성화되어 있어야 합니다.

속성 유형 필수 여부 설명
import_url 문자열 미러링되는 원격 저장소의 URL(user:token이 필요한 경우).
mirror 부울 true로 설정하면 프로젝트에서 풀 미러링을 활성화함.
mirror_trigger_builds 부울 아니요 true로 설정하면 미러 업데이트에 대해 파이프라인을 트리거함.
only_mirror_protected_branches 부울 아니요 true로 설정하면 미러링을 보호된 브랜치에만 제한함.
mirror_branch_regex 문자열 아니요 일반 표현식을 포함하고 있습니다. 일치하는 이름을 가진 브랜치만 미러링됩니다. only_mirror_protected_branches가 비활성화되어 있어야 합니다.

풀 미러가 있는 프로젝트 생성 예시:

curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
 --header "Content-Type: application/json" \
 --data '{
  "name": "new_project",
  "namespace_id": "1",
  "mirror": true,
  "import_url": "https://username:token@gitlab.example.com/group/project.git"
 }' \
 --url "https://gitlab.example.com/api/v4/projects/"

풀 미러 추가 예시:

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
 --url "https://gitlab.example.com/api/v4/projects/:id" \
 --data "mirror=true&import_url=https://username:token@gitlab.example.com/group/project.git"

풀 미러 제거 예시:

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
 --url "https://gitlab.example.com/api/v4/projects/:id"  \
 --data "mirror=false"

프로젝트의 Pull 미러링 프로세스 시작

Tier: Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated
  • 13.9에서 GitLab Premium으로 이전되었습니다.
POST /projects/:id/mirror/pull
속성 유형 필수 설명
id integer or string Yes 프로젝트의 ID 또는 URL-encoded path.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/mirror/pull"

프로젝트 뱃지

자세한 내용은 프로젝트 뱃지 설명서에서 확인하세요.

Git 저장소의 스냅샷 다운로드

이 엔드포인트는 관리자 권한을 가진 사용자만 액세스할 수 있습니다.

프로젝트(또는 요청된 경우 위키)의 Git 저장소의 스냅샷을 다운로드합니다. 이 스냅샷은 언제나 압축 해제된 tar 형식입니다.

만약 저장소가 git clone이 작동하지 않을 정도로 손상된 경우, 스냅샷을 사용하여 일부 데이터를 검색할 수 있을 수 있습니다.

GET /projects/:id/snapshot
속성 유형 필수 설명
id integer or string Yes 프로젝트의 ID 또는 URL-encoded path.
wiki boolean No 프로젝트 저장소 대신 위키를 다운로드할지 여부.

저장소 저장 경로 가져오기

Gitaly Cluster가 사용되지 않을 경우 특정 프로젝트에 대한 저장소 저장 경로를 가져옵니다. Gitaly Cluster가 사용되는 경우 Praefect-generated replica paths (GitLab 15.0 and later)을 참조하세요.

관리자만 사용 가능합니다.

GET /projects/:id/storage
속성 유형 필수 설명
id integer or string Yes 프로젝트의 ID 또는 URL-encoded path.
[
  {
    "project_id": 1,
    "disk_path": "@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b",
    "created_at": "2012-10-12T17:04:47Z",
    "repository_storage": "default"
  }
]