Skip to content

Error Tracking API

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

Use this API to interact with the Error Tracking feature for projects. For more information, see Error Tracking.

Prerequisites:

  • You must have at least the Maintainer role.

Get Error Tracking settings

Gets the Error Tracking settings for a specified project.

GET /projects/:id/error_tracking/settings
Attribute Type Required Description
id integer yes The ID or URL-encoded path of the project
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"

Example response:

{
  "active": true,
  "project_name": "sample sentry project",
  "sentry_external_url": "https://sentry.io/myawesomeproject/project",
  "api_url": "https://sentry.io/api/0/projects/myawesomeproject/project",
  "integrated": false
}

Create Error Tracking settings

Version history

Creates Error Tracking settings for a specified project.

This API is only available when used with integrated error tracking.

PUT /projects/:id/error_tracking/settings

Supported attributes:

Attribute Type Required Description
id integer yes The ID or URL-encoded path of the project.
active boolean yes Pass true to enable the error tracking setting configuration or false to disable it.
integrated boolean yes Pass true to enable the integrated error tracking backend.

Example request:

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings?active=true&integrated=true"

Example response:

{
  "active": true,
  "project_name": null,
  "sentry_external_url": null,
  "api_url": null,
  "integrated": true
}

Activate the Error Tracking project settings

Activates or deactivates Error Tracking settings for a specified project.

PATCH /projects/:id/error_tracking/settings
Attribute Type Required Description
id integer yes The ID or URL-encoded path of the project.
active boolean yes Pass true to enable the already configured error tracking settings or false to disable it.
integrated boolean no Pass true to enable the integrated error tracking backend.
curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings?active=true"

Example response:

{
  "active": true,
  "project_name": "sample sentry project",
  "sentry_external_url": "https://sentry.io/myawesomeproject/project",
  "api_url": "https://sentry.io/api/0/projects/myawesomeproject/project",
  "integrated": false
}

List all project client keys

Lists all integrated error tracking client keys for a specified project.

GET /projects/:id/error_tracking/client_keys
Attribute Type Required Description
id integer/string yes The ID or URL-encoded path of the project.
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"
```0

Example response:

```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"
```1

## Create a client key

Creates an [integrated error tracking](../operations/integrated_error_tracking.md) client key for a specified project. The public key attribute is generated automatically.

```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"
```2

| Attribute  | Type | Required | Description |
| ---------  | ---- | -------- | ----------- |
| `id`       | integer/string | yes | The ID or [URL-encoded path of the project](rest/_index.md#namespaced-paths). |

```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"
```3

Example response:

```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"
```4

## Delete a client key

Deletes an [integrated error tracking](../operations/integrated_error_tracking.md) client key from a specified project.

```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"
```5

| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id`      | integer/string | yes | The ID or [URL-encoded path of the project](rest/_index.md#namespaced-paths). |
| `key_id`  | integer | yes | The ID of the client key. |

```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"
```6