GitLab API
  1. projects
GitLab API
  • 默认分类
  • groups
    • Gets a list of access requests for a group.
    • Requests access for the authenticated user to a group.
    • Approves an access request for the given user.
    • Denies an access request for the given user.
    • Get a groups list
    • Create a group. Available only for users who can create groups.
    • Get list of owned groups for authenticated user
    • Update a group. Available only for users who can administrate groups.
    • Get a single group, with containing projects.
    • Remove a group.
    • Get a list of projects in this group.
    • Transfer a project to the group namespace. Available only for admin.
    • Get a list of group issues
    • Gets a list of group or project members viewable by the authenticated user.
    • Adds a member to a group or project.
    • Gets a member of a group or project.
    • Updates a member of a group or project.
    • Removes a user from a group or project.
    • Get group level notification level settings, defaults to Global
    • Update group level notification level settings, defaults to Global
  • projects
    • Gets a list of access requests for a project.
      GET
    • Requests access for the authenticated user to a project.
      POST
    • Approves an access request for the given user.
      PUT
    • Denies an access request for the given user.
      DELETE
    • Get a list of project +awardable+ award emoji
      GET
    • Award a new Emoji
      POST
    • Get a specific award emoji
      GET
    • Delete a +awardables+ award emoji
      DELETE
    • Get a list of project +awardable+ award emoji
      GET
    • Award a new Emoji
      POST
    • Get a specific award emoji
      GET
    • Delete a +awardables+ award emoji
      DELETE
    • Get a list of project +awardable+ award emoji
      GET
    • Award a new Emoji
      POST
    • Get a specific award emoji
      GET
    • Delete a +awardables+ award emoji
      DELETE
    • Get a list of project +awardable+ award emoji
      GET
    • Award a new Emoji
      POST
    • Get a specific award emoji
      GET
    • Delete a +awardables+ award emoji
      DELETE
    • Get a list of project +awardable+ award emoji
      GET
    • Award a new Emoji
      POST
    • Get a specific award emoji
      GET
    • Delete a +awardables+ award emoji
      DELETE
    • Get a list of project +awardable+ award emoji
      GET
    • Award a new Emoji
      POST
    • Get a specific award emoji
      GET
    • Delete a +awardables+ award emoji
      DELETE
    • Get all project boards
      GET
    • Get a project repository branches
      GET
    • Create branch
      POST
    • Get a single branch
      GET
    • Delete a branch
      DELETE
    • Protect a single branch
      PUT
    • Unprotect a single branch
      PUT
    • deleteV3ProjectsIdRepositoryMergedBranches
      DELETE
    • Get a project builds
      GET
    • Get builds for a specific commit of a project
      GET
    • Get a specific build of a project
      GET
    • Download the artifacts file from build
      GET
    • Download the artifacts file from build
      GET
    • Get a trace of a specific build of a project
      GET
    • Cancel a specific build of a project
      POST
    • Retry a specific build of a project
      POST
    • Erase build (remove artifacts and build trace)
      POST
    • Keep the artifacts to prevent them from being deleted
      POST
    • Trigger a manual build
      POST
    • Get a project repository commits
      GET
    • Commit multiple file changes as one commit
      POST
    • Get a specific commit of a project
      GET
    • Get the diff for a specific commit of a project
      GET
    • Get a commit's comments
      GET
    • Post comment to commit
      POST
    • Cherry pick commit into a branch
      POST
    • Get a commit's statuses
      GET
    • Post status to a commit
      POST
    • Get a specific project's deploy keys
      GET
    • Add new deploy key to currently authenticated user
      POST
    • Get single deploy key
      GET
    • Delete deploy key for a project
      DELETE
    • Enable a deploy key for a project
      POST
    • Disable a deploy key for a project
      DELETE
    • Get a specific project's deploy keys
      GET
    • Add new deploy key to currently authenticated user
      POST
    • Get single deploy key
      GET
    • Delete deploy key for a project
      DELETE
    • Enable a deploy key for a project
      POST
    • Disable a deploy key for a project
      DELETE
    • Get all deployments of the project
      GET
    • Gets a specific deployment
      GET
    • Get all environments of the project
      GET
    • Creates a new environment
      POST
    • Updates an existing environment
      PUT
    • Deletes an existing environment
      DELETE
    • Get a file from repository
      GET
    • Create new file in repository
      POST
    • Update existing file in repository
      PUT
    • Delete an existing file in repository
      DELETE
    • Set a time estimate for a project issue
      POST
    • Reset the time estimate for a project issue
      POST
    • Add spent time for a project issue
      POST
    • Reset spent time for a project issue
      POST
    • Show time stats for a project issue
      GET
    • Get a list of project issues
      GET
    • Create a new project issue
      POST
    • Get a single project issue
      GET
    • Update an existing issue
      PUT
    • Delete a project issue
      DELETE
    • Move an existing issue
      POST
    • Get all labels of the project
      GET
    • Create a new label
      POST
    • Delete an existing label
      DELETE
    • Update an existing label. At least one optional parameter is required.
      PUT
    • Gets a list of group or project members viewable by the authenticated user.
      GET
    • Adds a member to a group or project.
      POST
    • Gets a member of a group or project.
      GET
    • Updates a member of a group or project.
      PUT
    • Removes a user from a group or project.
      DELETE
    • Get a list of merge request diff versions
      GET
    • Get a single merge request diff version
      GET
    • Set a time estimate for a project merge_request
      POST
    • Reset the time estimate for a project merge_request
      POST
    • Add spent time for a project merge_request
      POST
    • Reset spent time for a project merge_request
      POST
    • Show time stats for a project merge_request
      GET
    • List merge requests
      GET
    • Create a merge request
      POST
    • Delete a merge request
      DELETE
    • Get a single merge request
      GET
    • Update a merge request
      PUT
    • Get a single merge request
      GET
    • Update a merge request
      PUT
    • Get the commits of a merge request
      GET
    • Show the merge request changes
      GET
    • Merge a merge request
      PUT
    • Cancel merge if "Merge When Pipeline Succeeds" is enabled
      POST
    • Get the comments of a merge request
      GET
    • Post a comment to a merge request
      POST
    • List issues that will be closed on merge
      GET
    • Get the commits of a merge request
      GET
    • Show the merge request changes
      GET
    • Merge a merge request
      PUT
    • Cancel merge if "Merge When Pipeline Succeeds" is enabled
      POST
    • Get the comments of a merge request
      GET
    • Post a comment to a merge request
      POST
    • List issues that will be closed on merge
      GET
    • Get a list of project milestones
      GET
    • Create a new project milestone
      POST
    • Get a single project milestone
      GET
    • Update an existing project milestone
      PUT
    • Get all issues for a single project milestone
      GET
    • Get a list of project +noteable+ notes
      GET
    • Create a new +noteable+ note
      POST
    • Get a single +noteable+ note
      GET
    • Update an existing +noteable+ note
      PUT
    • Delete a +noteable+ note
      DELETE
    • Get a list of project +noteable+ notes
      GET
    • Create a new +noteable+ note
      POST
    • Get a single +noteable+ note
      GET
    • Update an existing +noteable+ note
      PUT
    • Delete a +noteable+ note
      DELETE
    • Get a list of project +noteable+ notes
      GET
    • Create a new +noteable+ note
      POST
    • Get a single +noteable+ note
      GET
    • Update an existing +noteable+ note
      PUT
    • Delete a +noteable+ note
      DELETE
    • Get project level notification level settings, defaults to Global
      GET
    • Update project level notification level settings, defaults to Global
      PUT
    • Get all Pipelines of the project
      GET
    • Create a new pipeline
      POST
    • Gets a specific pipeline for the project
      GET
    • Retry failed builds in the pipeline
      POST
    • Cancel all builds in the pipeline
      POST
    • Get project hooks
      GET
    • Add hook to project
      POST
    • Get a project hook
      GET
    • Update an existing project hook
      PUT
    • Deletes project hook
      DELETE
    • Get a list of visible projects for authenticated user
      GET
    • Get a projects list for authenticated user
      GET
    • Create new project
      POST
    • Get an owned projects list for authenticated user
      GET
    • Gets starred project for the authenticated user
      GET
    • Get all projects for admin user
      GET
    • Search for projects the current user has access to
      GET
    • Create new project for a specified user. Only available to admin users.
      POST
    • Get a single project
      GET
    • Update an existing project
      PUT
    • Remove a project
      DELETE
    • Get events for a single project
      GET
    • Fork new project for the current user or provided namespace.
      POST
    • Archive a project
      POST
    • Unarchive a project
      POST
    • Star a project
      POST
    • Unstar a project
      DELETE
    • Mark this project as forked from another
      POST
    • Remove a forked_from relationship
      DELETE
    • Share the project with a group
      POST
    • deleteV3ProjectsIdShareGroupId
      DELETE
    • Upload a file
      POST
    • Get the users list of a project
      GET
    • Get all project snippets
      GET
    • Create a new project snippet
      POST
    • Get a single project snippet
      GET
    • Update an existing project snippet
      PUT
    • Delete a project snippet
      DELETE
    • Get a raw project snippet
      GET
    • Get a project repository tree
      GET
    • Get a raw file contents
      GET
    • Get a raw file contents
      GET
    • Get a raw blob contents by blob sha
      GET
    • Get an archive of the repository
      GET
    • Compare two branches, tags, or commits
      GET
    • Get repository contributors
      GET
    • Get runners available for project
      GET
    • Enable a runner for a project
      POST
    • Disable project's runner
      DELETE
    • Set asana service for project
      PUT
    • Set assembla service for project
      PUT
    • Set bamboo service for project
      PUT
    • Set bugzilla service for project
      PUT
    • Set buildkite service for project
      PUT
    • Set builds-email service for project
      PUT
    • Set campfire service for project
      PUT
    • Set custom-issue-tracker service for project
      PUT
    • Set drone-ci service for project
      PUT
    • Set emails-on-push service for project
      PUT
    • Set external-wiki service for project
      PUT
    • Set flowdock service for project
      PUT
    • Set gemnasium service for project
      PUT
    • Set hipchat service for project
      PUT
    • Set irker service for project
      PUT
    • Set jira service for project
      PUT
    • Set kubernetes service for project
      PUT
    • Set mattermost-slash-commands service for project
      PUT
    • Set slack-slash-commands service for project
      PUT
    • Set pipelines-email service for project
      PUT
    • Set pivotaltracker service for project
      PUT
    • Set pushover service for project
      PUT
    • Set redmine service for project
      PUT
    • Set slack service for project
      PUT
    • Set mattermost service for project
      PUT
    • Set teamcity service for project
      PUT
    • Delete a service for project
      DELETE
    • Get the service settings for project
      GET
    • Trigger a slash command for mattermost-slash-commands
      POST
    • Trigger a slash command for slack-slash-commands
      POST
    • Subscribe to a resource
      POST
    • Unsubscribe from a resource
      DELETE
    • Subscribe to a resource
      POST
    • Unsubscribe from a resource
      DELETE
    • Subscribe to a resource
      POST
    • Unsubscribe from a resource
      DELETE
    • Subscribe to a resource
      POST
    • Unsubscribe from a resource
      DELETE
    • Get a project repository tags
      GET
    • Create a new repository tag
      POST
    • Get a single repository tag
      GET
    • Delete a repository tag
      DELETE
    • Add a release note to a tag
      POST
    • Update a tag's release note
      PUT
    • Create a todo on an issuable
      POST
    • Create a todo on an issuable
      POST
    • Trigger a GitLab project build
      POST
    • Get triggers list
      GET
    • Create a trigger
      POST
    • Get specific trigger of a project
      GET
    • Delete a trigger
      DELETE
    • Get project variables
      GET
    • Create a new variable in a project
      POST
    • Get a specific variable from a project
      GET
    • Update an existing variable from a project
      PUT
    • Delete an existing variable from a project
      DELETE
    • Get the lists of a project board
      GET
    • Create a new board list
      POST
    • Get a list of a project board
      GET
    • Moves a board list to a new position
      PUT
    • Delete a board list
      DELETE
  • internal
    • postV3InternalAllowed
    • postV3InternalLfsAuthenticate
    • getV3InternalMergeRequestUrls
    • getV3InternalDiscover
    • getV3InternalCheck
    • getV3InternalBroadcastMessage
    • postV3InternalTwoFactorRecoveryCodes
  • issues
    • Get currently authenticated user's issues
  • keys
    • Get single ssh key by id. Only available to admin users
  • ci
    • Validation of .gitlab-ci.yml content
  • namespaces
    • Get a namespaces list
  • notification_settings
    • Get global notification level settings and email, defaults to Participate
    • Update global notification level settings and email, defaults to Participate
  • runners
    • Get runners available for user
    • Get all runners - shared and specific
    • Get runner's details
    • Update runner's details
    • Remove a runner
  • snippets
    • Get a snippets list for authenticated user
    • Create new snippet
    • List all public snippets current_user has access to
    • Get a single snippet
    • Update an existing snippet
    • Remove snippet
    • Get a raw snippet
  • hooks
    • Get the list of system hooks
    • Create a new system hook
    • Test a hook
    • Delete a hook
  • todos
    • Get a todo list
    • Mark all todos as done
    • Mark a todo as done
  • users
    • Get the list of users
    • Create a user. Available only for admins.
    • Get a single user
    • Update a user. Available only for admins.
    • Delete a user. Available only for admins.
    • Add an SSH key to a specified user. Available only for admins.
    • Get the SSH keys of a specified user. Available only for admins.
    • Delete an existing SSH key from a specified user. Available only for admins.
    • Add an email address to a specified user. Available only for admins.
    • Get the emails addresses of a specified user. Available only for admins.
    • Delete an email address of a specified user. Available only for admins.
    • Block a user. Available only for admins.
    • Unblock a user. Available only for admins.
    • Get the contribution events of a specified user
  • user
    • Get the currently authenticated user
    • Get the currently authenticated user's SSH keys
    • Add a new SSH key to the currently authenticated user
    • Get a single key owned by currently authenticated user
    • Delete an SSH key from the currently authenticated user
    • Get the currently authenticated user's email addresses
    • Add new email address to the currently authenticated user
    • Get a single email address owned by the currently authenticated user
    • Delete an email address from the currently authenticated user
  • deploy_keys
    • getV3DeployKeys
  • session
    • Login to get token
  • application
    • Get the current application settings
    • Modify application settings
  • sidekiq
    • Get the Sidekiq queue metrics
    • Get the Sidekiq process metrics
    • Get the Sidekiq job statistics
    • Get the Sidekiq Compound metrics. Includes queue, process, and job statistics
  • licenses
    • Get the list of the available license template
    • Get the text for a specific license
  • templates
    • Get the list of the available license template
    • Get the text for a specific license
    • Get the list of the available template
    • Get the text for a specific template present in local filesystem
    • Get the list of the available template
    • Get the text for a specific template present in local filesystem
    • Get the list of the available template
    • Get the text for a specific template present in local filesystem
  • gitignores
    • Get the list of the available template
    • Get the text for a specific template present in local filesystem
  • gitlab_ci_ymls
    • Get the list of the available template
    • Get the text for a specific template present in local filesystem
  • dockerfiles
    • Get the list of the available template
    • Get the text for a specific template present in local filesystem
  • version
    • Get the version information of the GitLab instance.
  1. projects

Create new project

POST
/v3/projects
projects
Create new project
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'http://gitlab.example.com/v3/projects' \
--data-urlencode 'name='
响应示例响应示例
{
  "id": "string",
  "description": "string",
  "default_branch": "string",
  "tag_list": "string",
  "public": "string",
  "archived": "string",
  "visibility_level": "string",
  "ssh_url_to_repo": "string",
  "http_url_to_repo": "string",
  "web_url": "string",
  "owner": {
    "name": "string",
    "username": "string",
    "id": "string",
    "state": "string",
    "avatar_url": "string",
    "web_url": "string"
  },
  "name": "string",
  "name_with_namespace": "string",
  "path": "string",
  "path_with_namespace": "string",
  "container_registry_enabled": "string",
  "issues_enabled": "string",
  "merge_requests_enabled": "string",
  "wiki_enabled": "string",
  "builds_enabled": "string",
  "snippets_enabled": "string",
  "created_at": "string",
  "last_activity_at": "string",
  "shared_runners_enabled": "string",
  "lfs_enabled": "string",
  "creator_id": "string",
  "namespace": {
    "id": "string",
    "name": "string",
    "path": "string",
    "kind": "string"
  },
  "forked_from_project": {
    "id": "string",
    "http_url_to_repo": "string",
    "web_url": "string",
    "name": "string",
    "name_with_namespace": "string",
    "path": "string",
    "path_with_namespace": "string"
  },
  "avatar_url": "string",
  "star_count": "string",
  "forks_count": "string",
  "open_issues_count": "string",
  "runners_token": "string",
  "public_builds": "string",
  "shared_with_groups": "string",
  "only_allow_merge_if_build_succeeds": "string",
  "request_access_enabled": "string",
  "only_allow_merge_if_all_discussions_are_resolved": "string",
  "statistics": {
    "commit_count": "string",
    "storage_size": "string",
    "repository_size": "string",
    "lfs_objects_size": "string",
    "build_artifacts_size": "string"
  }
}

请求参数

Body 参数application/x-www-form-urlencoded
name
string 
必需
The name of the project
path
string 
可选
The path of the repository
description
string 
可选
The description of the project
issues_enabled
boolean 
可选
Flag indication if the issue tracker is enabled
merge_requests_enabled
boolean 
可选
Flag indication if merge requests are enabled
wiki_enabled
boolean 
可选
Flag indication if the wiki is enabled
builds_enabled
boolean 
可选
Flag indication if builds are enabled
snippets_enabled
boolean 
可选
Flag indication if snippets are enabled
shared_runners_enabled
boolean 
可选
Flag indication if shared runners are enabled for that project
container_registry_enabled
boolean 
可选
Flag indication if the container registry is enabled for that project
lfs_enabled
boolean 
可选
Flag indication if Git LFS is enabled for that project
public
boolean 
可选
Create a public project. The same as visibility_level = 20.
visibility_level
enum<integer> <int32>
可选
Create a public project. The same as visibility_level = 20.
枚举值:
01020
public_builds
boolean 
可选
Perform public builds
request_access_enabled
boolean 
可选
Allow users to request member access
only_allow_merge_if_build_succeeds
boolean 
可选
Only allow to merge if builds succeed
only_allow_merge_if_all_discussions_are_resolved
boolean 
可选
Only allow to merge if all discussions are resolved
namespace_id
integer <int32>
可选
Namespace ID for the new project. Default to the user namespace.
import_url
string 
可选
URL from which the project is imported

返回响应

🟢201成功
application/json
Create new project
Body
Unstar a project
id
string 
可选
description
string 
可选
default_branch
string 
可选
tag_list
string 
可选
public
string 
可选
archived
string 
可选
visibility_level
string 
可选
ssh_url_to_repo
string 
可选
http_url_to_repo
string 
可选
web_url
string 
可选
owner
object (UserBasic) 
可选
Get a single user
name
string 
可选
username
string 
可选
id
string 
可选
state
string 
可选
avatar_url
string 
可选
web_url
string 
可选
name
string 
可选
name_with_namespace
string 
可选
path
string 
可选
path_with_namespace
string 
可选
container_registry_enabled
string 
可选
issues_enabled
string 
可选
merge_requests_enabled
string 
可选
wiki_enabled
string 
可选
builds_enabled
string 
可选
snippets_enabled
string 
可选
created_at
string 
可选
last_activity_at
string 
可选
shared_runners_enabled
string 
可选
lfs_enabled
string 
可选
creator_id
string 
可选
namespace
object (Namespace) 
可选
Get a namespaces list
id
string 
可选
name
string 
可选
path
string 
可选
kind
string 
可选
forked_from_project
object (BasicProjectDetails) 
可选
Get all projects for admin user
id
string 
可选
http_url_to_repo
string 
可选
web_url
string 
可选
name
string 
可选
name_with_namespace
string 
可选
path
string 
可选
path_with_namespace
string 
可选
avatar_url
string 
可选
star_count
string 
可选
forks_count
string 
可选
open_issues_count
string 
可选
runners_token
string 
可选
public_builds
string 
可选
shared_with_groups
string 
可选
only_allow_merge_if_build_succeeds
string 
可选
request_access_enabled
string 
可选
only_allow_merge_if_all_discussions_are_resolved
string 
可选
statistics
object (ProjectStatistics) 
可选
commit_count
string 
可选
storage_size
string 
可选
repository_size
string 
可选
lfs_objects_size
string 
可选
build_artifacts_size
string 
可选

【GitLab】API开发者 微信交流群

用微信扫右侧二维码,加入【GitLab】API开发者 交流群,互助沟通

扫码加入交流群
上一页
Get a projects list for authenticated user
下一页
Get an owned projects list for authenticated user
Built with