Create a new application FE version

POST /api/v4/applications

This feature was introduced in GitLab 10.5

Request body (application/json)

PropertyTypeDescription
confidentialBooleanThe application is used where the client secret can be kept confidential. Native mobile apps \ and Single Page Apps are considered non-confidential. Defaults to true if not supplied
Default: true
name
Required
StringName of the application
Example: MyApplication
redirect_uri
Required
StringRedirect URI of the application
Example: https://redirect.uri
scopes
Required
StringScopes of the application. You can specify multiple scopes by separating\ each scope using a space

Responses

CodeDescriptionSchema
200OKAPIEntitiesApplicationWithSecret
400Bad Request—

Delete an application FE version

DELETE /api/v4/applications/{id}

Delete a specific application

Parameters

NameTypeDescription
id
Path, required
IntegerThe ID of the application (not the application_id)

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
404Not Found—

Renew an application secret FE version

POST /api/v4/applications/{id}/renew-secret

Renew the secret of a specific application

Parameters

NameTypeDescription
id
Path, required
IntegerThe ID of the application (not the application_id)

Responses

CodeDescriptionSchema
200OKAPIEntitiesApplicationWithSecret
400Bad Request—
404Not Found—

List group approval rules

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

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group
Example: 11

Responses

CodeDescriptionSchema
200OK—
404Not Found—

Create a new group approval rule

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

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group
Example: 11

Request body (application/json)

PropertyTypeDescription
approval_rule
Required
Object—
approval_rule.approvals_requiredInteger—
approval_rule.approver_group_idsArray of integers—
approval_rule.approver_user_idsArray of integers—
approval_rule.custom_branch_ruleStringAllowed values: all_branch, all_protected_branch, manually
approval_rule.nameString—
approval_rule.protected_branch_idInteger—
approval_rule.rule_typeStringAllowed values: regular, any_approver
approval_rule.target_branch_textString—

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Update a group approval rule

PUT /api/v4/groups/{id}/approval_rules/{approval_rule_id}

Parameters

NameTypeDescription
approval_rule_id
Path, required
Integer—
id
Path, required
String or integerThe ID or URL-encoded path of the group
Example: 11

Request body (application/json)

PropertyTypeDescription
approval_rule
Required
Object—
approval_rule.approvals_requiredInteger—
approval_rule.approver_group_idsArray of integers—
approval_rule.approver_user_idsArray of integers—
approval_rule.custom_branch_ruleStringAllowed values: all_branch, all_protected_branch, manually
approval_rule.nameString—
approval_rule.protected_branch_idInteger—
approval_rule.rule_typeStringAllowed values: regular, any_approver
approval_rule.target_branch_textString—

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
404Not Found—

Delete a group approval rule

DELETE /api/v4/groups/{id}/approval_rules/{approval_rule_id}

Parameters

NameTypeDescription
approval_rule_id
Path, required
Integer—
id
Path, required
String or integerThe ID or URL-encoded path of the group
Example: 11

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
404Not Found—

List Gitaly object pool members

GET /api/v4/internal/gitaly/object_pool_members

Parameters

NameTypeDescription
disk_paths
Query, required
Array of stringsThe on-disk paths of the pool repositories. Limited to 500
storage
Query, required
StringThe storage shard name
upstream_only
Query
BooleanReturn only the upstream repository
Default: false

Responses

CodeDescriptionSchema
200OK—
400Bad Request—

List project approval rules

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

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11

Responses

CodeDescriptionSchema
200OK—
404Not Found—

Create a new project approval rule

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

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11

Request body (application/json)

PropertyTypeDescription
approval_rule
Required
Object—
approval_rule.approvals_requiredInteger—
approval_rule.approver_group_idsArray of integers—
approval_rule.approver_user_idsArray of integers—
approval_rule.custom_branch_ruleStringAllowed values: all_branch, all_protected_branch, manually
approval_rule.nameString—
approval_rule.protected_branch_idInteger—
approval_rule.rule_typeStringAllowed values: regular, any_approver
approval_rule.target_branch_textString—

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

For new merge request

GET /api/v4/projects/{id}/approval_rules/merge_requests/for-new-merge-request

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11

Responses

CodeDescriptionSchema
200OK—
404Not Found—

List merge_request approval rules

GET /api/v4/projects/{id}/approval_rules/merge_requests/{merge_request_iid}

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11
merge_request_iid
Path, required
——

Responses

CodeDescriptionSchema
200OK—
404Not Found—

Create a new merge_request approval rule

POST /api/v4/projects/{id}/approval_rules/merge_requests/{merge_request_iid}

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11
merge_request_iid
Path, required
——

Request body (application/json)

PropertyTypeDescription
approval_rule
Required
Object—
approval_rule.approvals_requiredInteger—
approval_rule.approver_group_idsArray of integers—
approval_rule.approver_user_idsArray of integers—
approval_rule.custom_branch_ruleStringAllowed values: all_branch, all_protected_branch, manually
approval_rule.nameString—
approval_rule.protected_branch_idInteger—
approval_rule.rule_typeStringAllowed values: regular, any_approver
approval_rule.target_branch_textString—

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Reset to project defaults

POST /api/v4/projects/{id}/approval_rules/merge_requests/{merge_request_iid}/reset-to-project-defaults

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11
merge_request_iid
Path, required
——

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Update a merge_request approval rule

PUT /api/v4/projects/{id}/approval_rules/merge_requests/{merge_request_iid}/{approval_rule_id}

Parameters

NameTypeDescription
approval_rule_id
Path, required
Integer—
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11
merge_request_iid
Path, required
——

Request body (application/json)

PropertyTypeDescription
approval_rule
Required
Object—
approval_rule.approvals_requiredInteger—
approval_rule.approver_group_idsArray of integers—
approval_rule.approver_user_idsArray of integers—
approval_rule.custom_branch_ruleStringAllowed values: all_branch, all_protected_branch, manually
approval_rule.nameString—
approval_rule.protected_branch_idInteger—
approval_rule.rule_typeStringAllowed values: regular, any_approver
approval_rule.target_branch_textString—

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
404Not Found—

Delete a merge_request approval rule

DELETE /api/v4/projects/{id}/approval_rules/merge_requests/{merge_request_iid}/{approval_rule_id}

Parameters

NameTypeDescription
approval_rule_id
Path, required
Integer—
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11
merge_request_iid
Path, required
——

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
404Not Found—

Update a project approval rule

PUT /api/v4/projects/{id}/approval_rules/{approval_rule_id}

Parameters

NameTypeDescription
approval_rule_id
Path, required
Integer—
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11

Request body (application/json)

PropertyTypeDescription
approval_rule
Required
Object—
approval_rule.approvals_requiredInteger—
approval_rule.approver_group_idsArray of integers—
approval_rule.approver_user_idsArray of integers—
approval_rule.custom_branch_ruleStringAllowed values: all_branch, all_protected_branch, manually
approval_rule.nameString—
approval_rule.protected_branch_idInteger—
approval_rule.rule_typeStringAllowed values: regular, any_approver
approval_rule.target_branch_textString—

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
404Not Found—

Delete a project approval rule

DELETE /api/v4/projects/{id}/approval_rules/{approval_rule_id}

Parameters

NameTypeDescription
approval_rule_id
Path, required
Integer—
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
404Not Found—

List approval rules, code owners, and approval settings for merge request

GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/approval_rules_and_code_owners

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 11
merge_request_iid
Path, required
IntegerThe internal ID of an issuable

Responses

CodeDescriptionSchema
200OK—
404Not found—

Swagger compatible API description

GET /api/v4/swagger_doc

Responses

CodeDescriptionSchema
200OK—

Swagger compatible API description for specific API

GET /api/v4/swagger_doc/{name}

Parameters

NameTypeDescription
name
Path, required
StringResource name of mounted API
locale
Query
StringLocale of API documentation

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
404Not Found—

Revoke a GPG key owned by currently authenticated user FE version

POST /api/v4/user/gpg_keys/{key_id}/revoke

This feature was added in GitLab 10.0

Parameters

NameTypeDescription
key_id
Path, required
IntegerThe ID of the GPG key

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Add a GPG key to a specified user Available only for admins

POST /api/v4/users/{id}/gpg_keys

(FE version).

This endpoint has been overridden to change its behavior.

Parameters

NameTypeDescription
id
Path, required
IntegerUser ID

Request body (application/json)

PropertyTypeDescription
key
Required
StringGPG Key

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesGpgKey
400Bad Request—
404Not Found—

Revokes an existing GPG key from a specified user

POST /api/v4/users/{id}/gpg_keys/{key_id}/revoke

Available only for admins. (FE version).

This feature was added in GitLab 10.0

Parameters

NameTypeDescription
id
Path, required
IntegerThe ID of the user
key_id
Path, required
IntegerThe ID of the GPG key

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
404Not Found—

Schemas

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

APIEntitiesApplicationWithSecret

PropertyTypeDescription
application_idStringExample: 5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737
application_nameStringExample: MyApplication
callback_urlStringExample: https://redirect.uri
confidentialBooleanExample: true
idInteger (int64)Example: 1
scopesArrayExample: ["api","read_user"]
secretStringExample: ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34

APIEntitiesGpgKey

PropertyTypeDescription
created_atString (date-time)Example: 2017-09-05T09:17:46.264Z
idInteger (int64)Example: 1
keyStringExample: -----BEGIN PGP PUBLIC KEY BLOCK-----