2020-10-26 21:08:22 +00:00
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
2017-01-04 22:07:49 +00:00
# Applications API
2020-02-06 15:09:11 +00:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/8160) in GitLab 10.5.
2018-01-23 09:50:10 +00:00
2019-01-11 15:38:15 +00:00
Applications API operates on OAuth applications for:
2018-01-23 09:50:10 +00:00
2019-01-11 15:38:15 +00:00
- [Using GitLab as an authentication provider ](../integration/oauth_provider.md ).
- [Allowing access to GitLab resources on a user's behalf ](oauth2.md ).
2018-10-11 10:54:15 +00:00
2019-01-11 15:38:15 +00:00
NOTE: **Note:**
Only admin users can use the Applications API.
2017-01-04 22:07:49 +00:00
2019-01-11 15:38:15 +00:00
## Create an application
Create an application by posting a JSON payload.
2017-01-04 22:07:49 +00:00
Returns `200` if the request succeeds.
2020-05-20 03:08:04 +00:00
```plaintext
2017-01-04 22:07:49 +00:00
POST /applications
```
2019-01-11 15:38:15 +00:00
Parameters:
2020-01-22 18:08:47 +00:00
| Attribute | Type | Required | Description |
|:---------------|:--------|:---------|:---------------------------------|
| `name` | string | yes | Name of the application. |
| `redirect_uri` | string | yes | Redirect URI of the application. |
| `scopes` | string | yes | Scopes of the application. |
| `confidential` | boolean | no | The application will be 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 |
2019-01-11 15:38:15 +00:00
Example request:
2017-01-04 22:07:49 +00:00
2020-01-30 15:09:15 +00:00
```shell
2020-05-28 00:08:37 +00:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " --data "name=MyApplication& redirect_uri=http://redirect.uri& scopes=" "https://gitlab.example.com/api/v4/applications"
2017-01-04 22:07:49 +00:00
```
Example response:
```json
2018-01-23 09:50:10 +00:00
{
2018-10-11 10:54:15 +00:00
"id":1,
2017-01-04 22:07:49 +00:00
"application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
2018-10-11 10:54:15 +00:00
"application_name": "MyApplication",
2017-01-04 22:07:49 +00:00
"secret": "ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34",
2020-01-22 18:08:47 +00:00
"callback_url": "http://redirect.uri",
"confidential": true
2017-01-04 22:07:49 +00:00
}
```
2018-10-11 10:54:15 +00:00
## List all applications
List all registered applications.
2020-05-20 03:08:04 +00:00
```plaintext
2018-10-11 10:54:15 +00:00
GET /applications
```
2019-01-11 15:38:15 +00:00
Example request:
2020-01-30 15:09:15 +00:00
```shell
2020-05-28 00:08:37 +00:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/applications"
2018-10-11 10:54:15 +00:00
```
Example response:
```json
[
{
"id":1,
"application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
"application_name": "MyApplication",
2020-01-22 18:08:47 +00:00
"callback_url": "http://redirect.uri",
"confidential": true
2018-10-11 10:54:15 +00:00
}
]
```
2019-01-11 15:38:15 +00:00
NOTE: **Note:**
The `secret` value will not be exposed by this API.
2018-10-11 10:54:15 +00:00
## Delete an application
Delete a specific application.
Returns `204` if the request succeeds.
2020-05-20 03:08:04 +00:00
```plaintext
2018-10-11 10:54:15 +00:00
DELETE /applications/:id
```
Parameters:
2019-09-01 23:55:51 +00:00
| Attribute | Type | Required | Description |
|:----------|:--------|:---------|:----------------------------------------------------|
2020-05-07 06:09:38 +00:00
| `id` | integer | yes | The ID of the application (not the application_id). |
2018-10-11 10:54:15 +00:00
2019-01-11 15:38:15 +00:00
Example request:
2020-01-30 15:09:15 +00:00
```shell
2020-05-28 00:08:37 +00:00
curl --request DELETE --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/applications/:id"
2018-10-11 10:54:15 +00:00
```