Error Tracking settings API

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

Error Tracking project settings

The project settings API allows you to retrieve the Error Tracking settings for a project. Only for users with Maintainer role for the project.

Get Error Tracking settings

Copy to clipboard
GET /projects/:id/error_tracking/settings
AttributeTypeRequiredDescription
idintegeryesThe ID or URL-encoded path of the project
Copy to clipboard
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/error_tracking/settings"

Example response:

Copy to clipboard
{
  "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

History

The API allows you to create Error Tracking settings for a project. Only for users with Maintainer role for the project.

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

Copy to clipboard
PUT /projects/:id/error_tracking/settings

Supported attributes:

AttributeTypeRequiredDescription
idintegeryesThe ID or URL-encoded path of the project.
activebooleanyesPass true to enable the error tracking setting configuration or false to disable it.
integratedbooleanyesPass true to enable the integrated error tracking backend.

Example request:

Copy to clipboard
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:

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

Enable or disable the Error Tracking project settings

The API allows you to enable or disable the Error Tracking settings for a project. Only for users with the Maintainer role for the project.

Copy to clipboard
PATCH /projects/:id/error_tracking/settings
AttributeTypeRequiredDescription
idintegeryesThe ID or URL-encoded path of the project.
activebooleanyesPass true to enable the already configured error tracking settings or false to disable it.
integratedbooleannoPass true to enable the integrated error tracking backend.
Copy to clipboard
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:

Copy to clipboard
{
  "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
}

Error Tracking client keys

For integrated error tracking feature. Only for users with the Maintainer role for the project.

List project client keys

Copy to clipboard
GET /projects/:id/error_tracking/client_keys
AttributeTypeRequiredDescription
idinteger/stringyesThe ID or URL-encoded path of the project.
Copy to clipboard
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/error_tracking/client_keys"

Example response:

Copy to clipboard
[
  {
    "id": 1,
    "active": true,
    "public_key": "glet_aa77551d849c083f76d0bc545ed053a3",
    "sentry_dsn": "https://glet_aa77551d849c083f76d0bc545ed053a3@example.com/errortracking/api/v1/projects/5"
  },
  {
    "id": 3,
    "active": true,
    "public_key": "glet_0ff98b1d849c083f76d0bc545ed053a3",
    "sentry_dsn": "https://glet_aa77551d849c083f76d0bc545ed053a3@example.com/errortracking/api/v1/projects/5"
  }
]

Create a client key

Creates a new client key for a project. The public key attribute is generated automatically.

Copy to clipboard
POST /projects/:id/error_tracking/client_keys
AttributeTypeRequiredDescription
idinteger/stringyesThe ID or URL-encoded path of the project.
Copy to clipboard
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --header "Content-Type: application/json" \
  --url "https://gitlab.example.com/api/v4/projects/5/error_tracking/client_keys"

Example response:

Copy to clipboard
{
  "id": 3,
  "active": true,
  "public_key": "glet_0ff98b1d849c083f76d0bc545ed053a3",
  "sentry_dsn": "https://glet_aa77551d849c083f76d0bc545ed053a3@example.com/errortracking/api/v1/projects/5"
}

Delete a client key

Removes a client key from the project.

Copy to clipboard
DELETE /projects/:id/error_tracking/client_keys/:key_id
AttributeTypeRequiredDescription
idinteger/stringyesThe ID or URL-encoded path of the project.
key_idintegeryesThe ID of the client key.
Copy to clipboard
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/error_tracking/client_keys/13"