Use this API to interact with access requests for groups and projects.

List all access requests for a group

GET /api/v4/groups/{id}/access_requests

Lists all access requests for a specified group that are viewable by the authenticated user.

Parameters

NameTypeDescription
id
Path, required
StringThe ID or URL-encoded path of the group owned by the authenticated user
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesAccessRequester
400Bad Request—
404Not Found—

Request access to a group

POST /api/v4/groups/{id}/access_requests

Requests access to a specified group for the authenticated user.

Parameters

NameTypeDescription
id
Path, required
StringThe ID or URL-encoded path of the group owned by the authenticated user

Responses

CodeDescriptionSchema
200OKAPIEntitiesAccessRequester
400Bad Request—
404Not Found—

Deny an access request

DELETE /api/v4/groups/{id}/access_requests/{user_id}

Denies an access request for a specified user in a group.

Parameters

NameTypeDescription
id
Path, required
StringThe ID or URL-encoded path of the group owned by the authenticated user
user_id
Path, required
IntegerThe user ID of the access requester

Responses

CodeDescriptionSchema
204Resource deleted—
400Bad Request—
404Not Found—

Approves an access request for the given user

PUT /api/v4/groups/{id}/access_requests/{user_id}/approve

This feature was introduced in GitLab 8.11.

Parameters

NameTypeDescription
id
Path, required
StringThe ID or URL-encoded path of the group owned by the authenticated user
user_id
Path, required
IntegerThe user ID of the access requester

Request body (application/json)

PropertyTypeDescription
access_levelIntegerA valid access level (defaults: 30, the Developer role)
Default: 30

Responses

CodeDescriptionSchema
200successful operationAPIEntitiesAccessRequester
400Bad Request—
404Not Found—

List all access requests for a project

GET /api/v4/projects/{id}/access_requests

Lists all access requests for a specified project that are viewable by the authenticated user.

Parameters

NameTypeDescription
id
Path, required
StringThe ID or URL-encoded path of the project owned by the authenticated user
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesAccessRequester
400Bad Request—
404Not Found—

Request access to a project

POST /api/v4/projects/{id}/access_requests

Requests access to a specified project for the authenticated user.

Parameters

NameTypeDescription
id
Path, required
StringThe ID or URL-encoded path of the project owned by the authenticated user

Responses

CodeDescriptionSchema
200OKAPIEntitiesAccessRequester
400Bad Request—
404Not Found—

Deny an access request

DELETE /api/v4/projects/{id}/access_requests/{user_id}

Denies an access request for a specified user in a project.

Parameters

NameTypeDescription
id
Path, required
StringThe ID or URL-encoded path of the project owned by the authenticated user
user_id
Path, required
IntegerThe user ID of the access requester

Responses

CodeDescriptionSchema
204Resource deleted—
400Bad Request—
404Not Found—

Approves an access request for the given user

PUT /api/v4/projects/{id}/access_requests/{user_id}/approve

This feature was introduced in GitLab 8.11.

Parameters

NameTypeDescription
id
Path, required
StringThe ID or URL-encoded path of the project owned by the authenticated user
user_id
Path, required
IntegerThe user ID of the access requester

Request body (application/json)

PropertyTypeDescription
access_levelIntegerA valid access level (defaults: 30, the Developer role)
Default: 30

Responses

CodeDescriptionSchema
200successful operationAPIEntitiesAccessRequester
400Bad Request—
404Not Found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesAccessRequester

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringExample: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)Example: 1
lockedBoolean—
nameStringExample: Administrator
public_emailStringExample: john@example.com
requested_atString—
stateStringExample: active
usernameStringExample: admin
web_urlStringExample: https://gitlab.example.com/root

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar