NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #4850 most downloaded on crates.io
Gitlab API client.
Last release 8 days ago
25 Sep 2026
Ships on a steady schedule
a new release about every 4 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
11 years old
165 releases · first in 2016
Add "title" to webhooks::MergeRequestChanges.
webhooks::MergeRequestChanges./projects/:id/packages/:package_id endpoint/projects/:id/packages/:package_id/package_files endpoint/projects/:id/packages/:package_id/package_files/:package_file_id endpoint/groups/:id/packages endpoint.gitlab::api::projects::repository::commits::CreateCommitAdd "approval" and "unapproval" to webhooks::MergeRequestAction.
webhooks::MergeRequestAction.One column per quarter.
Expose RestError at the crate root.
RestError at the crate root.ImpersonationClient type to use impersonation tokens with an
existing client./projects/:id/packages endpoint.Add API endpoint api::merge_requests::approval_rules.
api::projects::merge_requests::approval_rules.Implement Clone for structs that implement Endpoint.
Clone for structs that implement Endpoint./project/:project/repository/archive endpoint.No changes needed for GitLab 15.6.
No changes needed for GitLab 15.5.
API endpoints for user impersonation tokens.
api::{CreateProject, EditProject}::container_registry_enabled is deprecated in favor of container_registry_access_level.
types::GroupHook has been added.Push branch protections when creating groups.Similarity.path,
prevent_sharing_groups_outside_hierarchy,
prevent_forking_outside_group, and file_template_project_id.invite_source, tasks_to_be_done, and tasks_project_id
when adding a member to a group or project.skip_subresources when deleting group memberships.epic_id when listing issues.Preparing and WaitingForResource.security_and_compliance_access_level when creating
and editing projects.mr_default_target_self and ci_separated_caches
project fields.merge_request_diff_sha when editing and creating MR notes
(required for the /merge command).execute_filemode and last_commit_id when editing files through
the API.without_project_bots and saml_provider_id when listing users.all project membership endpoints have been split out.api::issues::IssueOrderBy::WeightFields is now
api::issues::IssueOrderBy::Weight. The old name seems to come from a
misreading of the documentation's list of supported fields. Its field name
has also been fixed to weight instead of weight_fields.api::projects::{CreateProject, EditProject}::container_registry_enabled
is deprecated in favor of container_registry_access_level.api::projects::{CreateProject, EditProject}::{tag, tags} are deprecated
in favor of topic and topics.api::projects::merge_requests::MergeRequests::search_in is deprecated
because GitLab doesn't actually have such a query parameter.api::projects::merge_requests::MergeRequestSearchScope is deprecated
because GitLab doesn't actually have such a query parameter it represented.api::projects::pipelines::Pipelines::name is deprecated; GitLab never
supported such a parameter.api::projects::members::{ProjectMember, ProjectMembers}::all_members is
deprecated. The all endpoints have different parameters, so merging them
doesn't work anymore.api::deploy_keys::DeployKeys::public is now private.api::projects::{CreateProject, EditProject}::requirements_access_level do
not support Public, so they now uses api::FeatureAccessLevel instead of
api::FeatureAccessLevelPublic.api::users::Users::external is now a () instead of bool because
GitLab doesn't actually support external=false.api::projects::repository::Tree now uses keyset pagination and requires
GitLab 15.0. Page-based iteration has been deprecated by GitLab.api::projects::variables::ProjectVariableFilter::environment_scope is now
private.graphql_client has been updated to 0.11.
graphql_client has been updated to 0.11.api::merge_requests::MergeRequestPipelines and associated structures have been moved to api::merge_requests::pipelines.
api::projects::merge_requests::MergeRequestPipelines and associated
structures have been moved to api::projects::merge_requests::pipelines.api::projects::edit::EditProject fixes a typo from
printing_merge_requests_link_enabled to
printing_merge_request_link_enabledapi::projects::protected_branches::ProtectedBranches is now paginated.types::UserState::Deactivated has been added.types::Hook:
push_events_branch_filterissues_eventsconfidential_issues_eventsmerge_requests_eventsnote_eventsconfidential_note_eventsrepository_update_eventsjob_eventspipeline_eventswiki_page_eventstypes::ProjectHook:
deployment_eventsreleases_eventstypes::Project:
build_git_strategyci_default_git_depthwebhooks::MergeRequestHook:
changeswebhooks::MergeRequestChanges structureNo changes needed for GitLab 15.0.
No changes needed for GitLab 14.10.
No changes needed for GitLab 14.9.
Added the api::merge_trains endpoint to get merge trains for a specific project.
api::projects::merge_trains endpoint to get merge trains
for a specific project.types::RepoCommit::parent_ids is now an Option.
types::RepoCommit::parent_ids is now an Option./) are now handled
properly with api::projects::protected_tags::ProtectedTag.types::DiscussionNoteType::Note variant has been added.EditGroup.rustls feature to support static linking (no OpenSSL).MergeRequestCommitProjectVariableProtectedTagAccessLevelProtectedTagReleaseTagTagcontainer_registry_access_levelmerge_pipelines_enabledmerge_trains_enabledsquash_optiontopicscontainer_registry_access_levelmerge_commit_templatesquash_commit_templateissues_templatemerge_requests_templatesquash_optionmerge_pipelines_enabledmerge_trains_enabledprinting_merge_requests_link_enabledtopicskeep_latest_artifactNo changes needed for GitLab 14.6.
No functional changes. Only documentation and tests were updated.
Missing Builder type exports have been added.
Builder type exports have been added.Builder instances are now distinct per builder type.Added the first_contributors field to api::merge_requests::MergeRequest
first_contributors field to api::projects::merge_requests::MergeRequestapi::projects::merge_requests::pipelines endpoint to get
the pipelines attached to a merge requestapi::projects::merge_requests::changes endpoint to get
information about a merge request along with diffscode_owner_approval_required in types::ProtectedRepoBranch
an Option<bool> instead of bool as the field is only present in
Gitlab premiumPaged::iter_async returning a paginated asynchronous stream
analogous to Pages::iter.api::groups::issues::Issues endpoint to get issues associated
with a group.GitlabBuilderNo changes needed for GitLab 14.3.
Added the api::merge_requests::MergeRequestApprovals endpoint to get approvals of a merge request.
api::projects::merge_requests::approvals::MergeRequestApprovals
endpoint to get approvals of a merge request.Gitlab client now supports unauthenticated connections.api::retry::Client in order to perform
exponential backoff for service-side errors. Backoff parameters are
configurable via the api::retry::Backoff structure.types::MergeRequest::source_project_id is now an Option
types::MergeRequest::source_project_id is now an Option<ProjectId>A new RestClient trait has been refactored from Client and AsyncClient.
RestClient trait has been refactored from Client and
AsyncClient.api::paged type now has an .iter() method which may be used to
iterate over paginated results using lazily fetched API results. This can
be used to reduce memory usage for large result sets.confidential parameter for api::projects::issues::EditIssueApiError::GitlabService error variant. Previously, the JSON
deserialization would have been exposed.Allow arbitrary strings for the UID of ExternalProvider matching what the API expects and allows.
ExternalProvider matching what the
API expects and allows.Project hooks can now be edited via EditHook.
EditHook.Upgraded reqwest and bytes which use tokio 1.0.
reqwest and bytes which use tokio 1.0.Added the api::releases::ProjectReleases endpoint to list all releases for a project.
api::projects::releases::ProjectReleases endpoint to list all
releases for a project.api::projects::repository::tagsCommitsapi::AsyncQuery and client api::AsyncClient.AsyncGitlab (created by GitlabBuilder::build_async).types::{Pipeline,PipelineBasic} now have a project_id member.
types::{Pipeline,PipelineBasic} now have a project_id member.EditIssue::remove_labels is deprecated in favor of the better clear_labels wording.
ParamValue::as_value now takes its value as &self rather than self.
This was required in order to implement CommaSeparatedList reliably.api::common::CommaSeparatedList now exists for easy use of
comma-separated values.RemoveProjectMember.EditGroupMember.EditProjectMember.EditIssue::remove_labels is deprecated in favor of the better
clear_labels wording.EditMergeRequest::remove_labels is deprecated in favor of the better
clear_labels wording."minimal" access level.name_regex_delete
(replacing the now-deprecated name_regex) and name_regex_keep.operations_access_level
settings.requirements_access_level
settings.analytics_access_level
settings.show_default_award_emojis
settings.restrict_user_defined_variables settings.allow_merge_on_skipped_pipeline settings.ci_forward_deployment_enabled settings.approvals_before_merge
setting."scheduled" pipeline status.No changes needed for GitLab 13.8.
Added api::merge_requests::approval_state::MergeRequestApprovalState query to access the approval rules state of a particular merge request.
api::projects::repository::files::FileRawapi::projects::merge_requests::approval_state::MergeRequestApprovalState
query to access the approval rules state of a particular merge request.No changes needed for GitLab 13.6.
Changed ci_config_path to Option in gitlab::PipelineHookAttrs
ci_config_path to Option<String> in gitlab::webhooks::PipelineHookAttrsAdded head_pipeline_id field to gitlab::MergeRequestHookAttrs
head_pipeline_id field to gitlab::webhooks::MergeRequestHookAttrsError types now use #[non_exhaustive]
#[non_exhaustive]## Additions * Added gitlab::PipelineHook
gitlab::webhooks::PipelineHook## Additions * Id types now implement Hash
Id types now implement HashAdded api::issues::MergeRequestsClosing and api::issues::MergeRequestsClosing
api::projects::issues::MergeRequestsClosing and
api::projects::issues::MergeRequestsClosingapproved and unapproved merge request actions for
CE.Added the api::protected_tags::ProtectTag api::protected_tags::UnprotectTag api::protected_tags::ProtectedTag api::protected_tags::ProtectedTags endpo
api::projects::protected_tags::ProtectTag
api::projects::protected_tags::UnprotectTag
api::projects::protected_tags::ProtectedTag
api::projects::protected_tags::ProtectedTags endpoint to query, protect
and unprotect a projects tags.api::projects::labels::DeleteLabel endpoint to delete existing
labels from a project.api::projects::labels::PromoteLabel endpoint to promote a project
label to a group label.api::projects:merge_requests::MergeMergeRequest endpoint to
merge open merge requests.api::projects:merge_requests::RebaseMergeRequest endpoint to
rebase open merge requests when using the fast-forward merge model.api::projects:merge_requests::ApproveMergeRequest endpoint to
approve open merge requests.api::projects:merge_requests::UnapproveMergeRequest endpoint to
unapprove approved merge requests.Updated api::members::ProjectMember[s] to support the ability to include member details for those members that have access as a result of belonging to
api::projects::members::ProjectMember[s] to support the ability
to include member details for those members that have access as a result
of belonging to ancestor/enclosing groups, in addition to directly added
members.api::projects::labels::Label endpoint to be queried
by id or name.api::groups::projects::GroupProjects endpoint to list a groups
projects.api::groups::subgroups::GroupSubgroups endpoint to list a
groups subgroups.api::projects::protected_branches::ProtectedBranches endpoint
to list a projects protected branches.api::projects::protected_branches::ProtectedBranch endpoint
to query a projects protected branch.api::projects::labels::LabelsLinks HTTP
header.The REST endpoint methods on the Gitlab structure have been removed. Associated helper structures for resource creation endpoints have been removed as
Gitlab structure have been removed.
Associated helper structures for resource creation endpoints have been
removed as well:
CreateMergeRequestParamsCreateMergeRequestParamsBuilderCreateGroupParamsCreateGroupParamsBuilderCreateProjectParamsCreateProjectParamsBuilderMergeMethodBuildGitStrategyAutoDeployStrategyWebhookEventsCommitStatusInfoMergeRequestStateFilterRepoFileProjectFeaturesQueryParamSliceQueryParamVecGitlabError.The Serialize implementations of the API types are deprecated (though marking them as such is difficult).
Gitlab structure now have Endpoint structures
implemented. In a future release, these methods (and their support types)
will be removed.Serialize implementations of the API types are deprecated (though
marking them as such is difficult).api::projects::issues::Issues endpoint's milestone field was
changed to match the actual API exposed by GitLab (with None and Any
options).api::projects::pipelines::PipelineVariables endpoint is now pageable.EnableState fields may now be set using bool values.api::projects::merge_requests::EditMergeRequest endpoint now supports
unlabeling a merge request.api::Client trait has been changed to use the http crate types.
This allows for clients to not be tied to reqwest and for mocking and
testing of the endpoints themselves.min_access_level field for api::groups::Groups and the
access_level for api::projects::members::AddProjectMember are now
properly passed as integers to the API. (#42)It was observed (#41) that the new API pattern was not handling POST and PUT parameters properly. This has now been fixed.
It was observed (#41) that the new API pattern was not handling POST and
PUT parameters properly. This has now been fixed.
In the process of updating the body handling, a simpler pattern for query parameters was also implemented.
Some additional merge status names for merge requests were missing and have been added.
api::projects::environments::Environment endpoint uses the correct
path now.api::groups::members::GroupMembers,
api::projects::members::ProjectMembers, and
api::projects::repository::Branches endpoints now accepts plain strings
for their query fields.api::projects::protected_branches::UnprotectBranch endpoint now
properly escapes branch names with URL-special characters.api::projects::repository::CreateFile endpoint now properly upgrades
the encoding when attempting to encode binary contents using
Encoding::Text.api::projects::CreateProject and api::projects::EditProject
endpoints now accepts plain strings in its import_url field.api::projects::issues::EditIssue now uses issue rather than
issue_iid for consistency.If your endpoint is deprecated, it has been marked as such and you should migrate to the new pattern. Please see the docs for available endpoints.
A new pattern for API implementation is now underway. Instead of methods
directly on the Gitlab instance, there are now structures which implement an
api::Endpoint trait. This trait may be used to query any structure
implementing the api::Client trait using the api::Query trait. All
endpoints use the "builder" pattern to collect required and optional
parameters.
There are some adaptor functions to handle various use cases:
api::paged: This may be used to handle pagination of any endpoint which
supports it (checked at compile time).api::ignore: This may be used to ignore the content of the response for
any endpoint. HTTP and GitLab error messages are still captured.api::raw: Instead of deserializing the contents of the result from GitLab
into a structure, the raw bytes may be fetched instead using this function.api::sudo: This function adapts any endpoint into being called as another
user if the client is able to do so (basically, is an administrator).The api::Query trait deserializes the contents from GitLab into any structure
which implements the serde::DeserializeOwned trait. This can be used to only
grab information of interest to the caller instead of extracting all of the
information available through the types module.
If your endpoint is deprecated, it has been marked as such and you should migrate to the new pattern. Please see the docs for available endpoints.
All new endpoint implementations should use the new pattern rather than adding
methods to Gitlab. Result structures do not need to be added to this crate
either. It is expected that they too will be deprecated at some point and
either not provided or moved to a dedicated crate.
use std::env;
use serde::Deserialize;
use gitlab::Gitlab;
use gitlab::api::{self, projects, Query};
#[derive(Debug, Deserialize)]
struct Project {
name: String,
}
fn example() {
// Create the client.
let client = Gitlab::new("gitlab.com", env::get("GITLAB_TOKEN").unwrap()).unwrap();
// Create a simple endpoint.
let endpoint = projects::Project::builder().project("gitlab-org/gitlab").build().unwrap();
// Get the information.
let project: Project = endpoint.query(&client).unwrap();
// Call it again, but ignore the response from GitLab.
let _: () = api::ignore(endpoint).query(&client).unwrap();
// Create an endpoint that supports pagination.
let pageable_endpoint = projects::Projects::builder().build().unwrap();
// Get just the first page (20 results).
let first_page: Vec<Project> = pageable_endpoint.query(&client).unwrap();
// Get 200 results instead.
let first_200_projects: Vec<Project> = api::paged(pageable_endpoint, api::Pagination::Limit(200)).query(&client).unwrap();
// Query `gitlab-org/gitlab` except by ID this time.
let endpoint = projects::Project::builder().project(278964).build().unwrap();
// Get the raw data from the response.
let raw_data: Vec<u8> = api::raw(endpoint).query(&client).unwrap();
}
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →