正式なドキュメントは英語版であり、この日本語訳はAI支援翻訳により作成された参考用のものです。日本語訳の一部の内容は人間によるレビューがまだ行われていないため、翻訳のタイミングにより英語版との間に差異が生じることがあります。最新かつ正確な情報については、英語版をご参照ください。

User Applications API

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

Use this API to manage user-level OAuth applications that:

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

Prerequisites:

  • Administrator access or authenticated as the user who owns the application.

Create an application

Creates a new OAuth application for the authenticated user.

Returns 201 if the request succeeds.

POST /user/applications

Supported attributes:

AttributeTypeRequiredDescription
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.

Example request:

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/user/applications"

Example response:

{
    "id":1,
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
    "application_name": "MyApplication",
    "secret": "ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34",
    "callback_url": "http://redirect.uri",
    "confidential": true
}

List all applications

Lists all applications owned by the authenticated user.

GET /user/applications

Example request:

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

Example response:

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

Retrieve a specific application

Retrieves details of a specific application owned by the authenticated user.

Returns 200 if the request succeeds.

GET /user/applications/:id

Supported attributes:

AttributeTypeRequiredDescription
idintegeryesID of the application. Differs from the application_id.'

Example request:

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

Example response:

{
    "id":1,
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
    "application_name": "MyApplication",
    "callback_url": "http://redirect.uri",
    "confidential": true
}

Update an application

Updates an existing application owned by the authenticated user.

Returns 200 if the request succeeds.

PUT /user/applications/:id

Supported attributes:

AttributeTypeRequiredDescription
idintegeryesID of the application. Differs from the application_id.'
namestringnoName of the application.
scopesstringnoScopes available to the application. Separate multiple scopes with a space.

Example request:

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

Example response:

{
    "id":1,
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
    "application_name": "UpdatedApplication",
    "callback_url": "http://redirect.uri",
    "confidential": true
}

Delete an application

Deletes a specified application owned by the authenticated user.

Returns 204 if the request succeeds.

DELETE /user/applications/:id

Supported attributes:

AttributeTypeRequiredDescription
idintegeryesID of the application. Differs from the application_id.'

Example request:

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