Group Applications API

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

Use this API to manage group-owned OAuth applications that:

To manage instance-wide applications, use the Applications API. To manage user-owned applications, use the User Applications API.

Prerequisites:

  • You must have the Owner role for the group.

Create a group application

Creates an OAuth application owned by the specified group.

POST /groups/:id/applications

Supported attributes:

AttributeTypeRequiredDescription
idinteger or stringyesID or URL-encoded path of the group.
namestringyesName of the application.
redirect_uristringyesRedirect URI of the application.
scopesstringyesScopes available to the application. Separate multiple scopes with a space.
confidentialbooleannoIf true, the application can securely store client credentials, such as the client secret. Non-confidential applications (such as native mobile apps and Single Page Apps) might expose client credentials. If unspecified, defaults to true.

If successful, returns 201 Created and the following response attributes:

AttributeTypeDescription
application_idstringOAuth client ID of the application. Differs from id.
application_namestringName of the application.
callback_urlstringRedirect URI of the application.
confidentialbooleanIf true, the application can securely store client credentials.
idintegerID of the application.
scopesarray of stringsScopes available to the application.
secretstringClient secret of the application. Returned only when you create the application.

Example request:

shell
curl --request POST \
    --header "PRIVATE-TOKEN: <your_access_token>" \
    --data "name=MyApplication&redirect_uri=http://redirect.uri&scopes=api read_user email" \
    --url "https://gitlab.example.com/api/v4/groups/1/applications"

Example response:

json
{
    "id": 1,
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
    "application_name": "MyApplication",
    "secret": "ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34",
    "callback_url": "http://redirect.uri",
    "confidential": true,
    "scopes": ["api", "read_user", "email"]
}

The secret value is returned only when you create the application.

List all group applications

Lists all OAuth applications owned by a specified group.

GET /groups/:id/applications

Supported attributes:

AttributeTypeRequiredDescription
idinteger or stringyesID or URL-encoded path of the group.

If successful, returns 200 OK and a list of applications, each with the following response attributes:

AttributeTypeDescription
application_idstringOAuth client ID of the application. Differs from id.
application_namestringName of the application.
callback_urlstringRedirect URI of the application.
confidentialbooleanIf true, the application can securely store client credentials.
idintegerID of the application.
scopesarray of stringsScopes available to the application.

Example request:

shell
curl --request GET \
    --header "PRIVATE-TOKEN: <your_access_token>" \
    --url "https://gitlab.example.com/api/v4/groups/1/applications"

Example response:

json
[
    {
        "id": 1,
        "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
        "application_name": "MyApplication",
        "callback_url": "http://redirect.uri",
        "confidential": true,
        "scopes": ["api", "read_user"]
    }
]

Retrieve a specific group application

Retrieves details of a specified OAuth application owned by a group.

GET /groups/:id/applications/:application_id

Supported attributes:

AttributeTypeRequiredDescription
idinteger or stringyesID or URL-encoded path of the group.
application_idintegeryesID of the application. Differs from the application_id field in the response, which is the OAuth client ID.

If successful, returns 200 OK and the following response attributes:

AttributeTypeDescription
application_idstringOAuth client ID of the application. Differs from id.
application_namestringName of the application.
callback_urlstringRedirect URI of the application.
confidentialbooleanIf true, the application can securely store client credentials.
idintegerID of the application.
scopesarray of stringsScopes available to the application.

Example request:

shell
curl --request GET \
    --header "PRIVATE-TOKEN: <your_access_token>" \
    --url "https://gitlab.example.com/api/v4/groups/1/applications/1"

Example response:

json
{
    "id": 1,
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
    "application_name": "MyApplication",
    "callback_url": "http://redirect.uri",
    "confidential": true,
    "scopes": ["api", "read_user"]
}

Update a group application

Updates a specified OAuth application owned by a group.

You cannot update the redirect_uri and confidential attributes of an existing application. To change them, delete the application and create it again.

PUT /groups/:id/applications/:application_id

Supported attributes:

AttributeTypeRequiredDescription
idinteger or stringyesID or URL-encoded path of the group.
application_idintegeryesID of the application. Differs from the application_id field in the response, which is the OAuth client ID.
namestringnoName of the application.
scopesstringnoScopes available to the application. Separate multiple scopes with a space.

If successful, returns 200 OK and the following response attributes:

AttributeTypeDescription
application_idstringOAuth client ID of the application. Differs from id.
application_namestringName of the application.
callback_urlstringRedirect URI of the application.
confidentialbooleanIf true, the application can securely store client credentials.
idintegerID of the application.
scopesarray of stringsScopes available to the application.

Example request:

shell
curl --request PUT \
    --header "PRIVATE-TOKEN: <your_access_token>" \
    --data "name=UpdatedApplication" \
    --url "https://gitlab.example.com/api/v4/groups/1/applications/1"

Example response:

json
{
    "id": 1,
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
    "application_name": "UpdatedApplication",
    "callback_url": "http://redirect.uri",
    "confidential": true,
    "scopes": ["api", "read_user"]
}

Delete a group application

Deletes a specified OAuth application owned by a group.

DELETE /groups/:id/applications/:application_id

Supported attributes:

AttributeTypeRequiredDescription
idinteger or stringyesID or URL-encoded path of the group.
application_idintegeryesID of the application. Differs from the application_id field in the response, which is the OAuth client ID.

If successful, returns 204 No Content.

Example request:

shell
curl --request DELETE \
    --header "PRIVATE-TOKEN: <your_access_token>" \
    --url "https://gitlab.example.com/api/v4/groups/1/applications/1"