Skip to main content
Project endpoints let you retrieve project details, query event statistics, inspect affected users, and manage service hooks. All project endpoints follow the pattern /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/.

Path parameters

organization_id_or_slug
string
required
The numeric ID or slug of the organization.
project_id_or_slug
string
required
The numeric ID or slug of the project.

Retrieve a project

GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/
Returns details about a single project. Required scope: project:read

Example request

curl https://sentry.io/api/0/projects/my-org/my-project/ \
  -H "Authorization: Bearer sntrys_TOKEN"

Example response

{
  "id": "2",
  "slug": "my-project",
  "name": "My Project",
  "platform": "python",
  "dateCreated": "2018-11-06T21:19:58.536Z",
  "isBookmarked": false,
  "status": "active"
}

Retrieve event counts for a project

GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/stats/
Returns a series of [timestamp, count] pairs representing event volume over a time range. Required scope: project:read
This endpoint may change in the future without notice. Treat it as unstable.

Query parameters

stat
string
The metric to query. One of received, rejected, blacklisted, or generated. Defaults to received.
since
string
Start of the query window as a Unix timestamp (seconds since epoch).
until
string
End of the query window as a Unix timestamp (seconds since epoch).
resolution
string
Time bucket size. One of 10s, 1h, or 1d. The available resolutions depend on the length of your query range.

Example request

curl "https://sentry.io/api/0/projects/my-org/my-project/stats/?stat=received&resolution=1h" \
  -H "Authorization: Bearer sntrys_TOKEN"

Example response

Each item in the array is a [unix_timestamp, count] pair:
[
  [1541455200.0, 1184],
  [1541458800.0, 1410],
  [1541462400.0, 1440],
  [1541466000.0, 1682],
  [1541469600.0, 1203]
]

List users who experienced errors

GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/users/
Returns a list of users that Sentry has seen experience errors in this project. Required scope: project:read

Example request

curl https://sentry.io/api/0/projects/my-org/my-project/users/ \
  -H "Authorization: Bearer sntrys_TOKEN"

List tag values

GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/tags/{key}/values/
Returns all distinct values that Sentry has seen for a given tag key within the project. Required scope: project:read

Path parameters

key
string
required
The tag key to look up, e.g. environment, release, or user.email.

Example request

curl https://sentry.io/api/0/projects/my-org/my-project/tags/environment/values/ \
  -H "Authorization: Bearer sntrys_TOKEN"

Example response

[
  {
    "value": "production",
    "name": "production",
    "count": 12345,
    "lastSeen": "2024-01-15T08:30:00Z",
    "firstSeen": "2022-01-01T00:00:00Z"
  },
  {
    "value": "staging",
    "name": "staging",
    "count": 3210,
    "lastSeen": "2024-01-14T22:00:00Z",
    "firstSeen": "2022-01-01T00:00:00Z"
  }
]

List service hooks

GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/hooks/
Returns all service hooks registered for the project. Required scope: project:read

Example request

curl https://sentry.io/api/0/projects/my-org/my-project/hooks/ \
  -H "Authorization: Bearer sntrys_TOKEN"

Example response

[
  {
    "id": "4f9d73e63b7144ecb8944c41620a090b",
    "url": "https://empowerplant.io/sentry-hook",
    "events": ["event.alert", "event.created"],
    "status": "active",
    "secret": "8fcac28aaa4c4f5fa572b61d40a8e084364db25fd37449c299e5a41c0504cbc2",
    "dateCreated": "2018-11-06T21:20:08.143Z"
  }
]

Create a service hook

POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/hooks/
Registers a new service hook that sends HTTP POST requests to your URL when selected events occur. Required scope: project:write
Service hooks require the servicehooks feature to be enabled for your project. Contact your account team if you do not see this option.

Request body

url
string
required
The URL that Sentry sends the webhook POST to.
events
array
required
An array of event types to subscribe to. Valid values are:
  • event.alert — An alert is generated for an event via rules.
  • event.created — A new event has been processed.

Example request

curl -X POST https://sentry.io/api/0/projects/my-org/my-project/hooks/ \
  -H "Authorization: Bearer sntrys_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://empowerplant.io/sentry-hook",
    "events": ["event.alert", "event.created"]
  }'

Example response

{
  "id": "4f9d73e63b7144ecb8944c41620a090b",
  "url": "https://empowerplant.io/sentry-hook",
  "events": ["event.alert", "event.created"],
  "status": "active",
  "secret": "8fcac28aaa4c4f5fa572b61d40a8e084364db25fd37449c299e5a41c0504cbc2",
  "dateCreated": "2018-11-06T21:20:08.143Z"
}
Save the secret from the response. Sentry signs webhook requests with this secret using HMAC-SHA256, and you can use it to verify that payloads come from Sentry.