> ## Documentation Index
> Fetch the complete documentation index at: https://sentrydocs.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Projects

> Create, configure, and query project data via the API

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

<ParamField path="organization_id_or_slug" type="string" required>
  The numeric ID or slug of the organization.
</ParamField>

<ParamField path="project_id_or_slug" type="string" required>
  The numeric ID or slug of the project.
</ParamField>

***

## 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

```bash theme={null}
curl https://sentry.io/api/0/projects/my-org/my-project/ \
  -H "Authorization: Bearer sntrys_TOKEN"
```

### Example response

```json theme={null}
{
  "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`

<Warning>
  This endpoint may change in the future without notice. Treat it as unstable.
</Warning>

### Query parameters

<ParamField query="stat" type="string">
  The metric to query. One of `received`, `rejected`, `blacklisted`, or `generated`. Defaults to `received`.
</ParamField>

<ParamField query="since" type="string">
  Start of the query window as a Unix timestamp (seconds since epoch).
</ParamField>

<ParamField query="until" type="string">
  End of the query window as a Unix timestamp (seconds since epoch).
</ParamField>

<ParamField query="resolution" type="string">
  Time bucket size. One of `10s`, `1h`, or `1d`. The available resolutions depend on the length of your query range.
</ParamField>

### Example request

```bash theme={null}
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:

```json theme={null}
[
  [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

```bash theme={null}
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

<ParamField path="key" type="string" required>
  The tag key to look up, e.g. `environment`, `release`, or `user.email`.
</ParamField>

### Example request

```bash theme={null}
curl https://sentry.io/api/0/projects/my-org/my-project/tags/environment/values/ \
  -H "Authorization: Bearer sntrys_TOKEN"
```

### Example response

```json theme={null}
[
  {
    "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

```bash theme={null}
curl https://sentry.io/api/0/projects/my-org/my-project/hooks/ \
  -H "Authorization: Bearer sntrys_TOKEN"
```

### Example response

```json theme={null}
[
  {
    "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`

<Note>
  Service hooks require the `servicehooks` feature to be enabled for your project. Contact your account team if you do not see this option.
</Note>

### Request body

<ParamField body="url" type="string" required>
  The URL that Sentry sends the webhook POST to.
</ParamField>

<ParamField body="events" type="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.
</ParamField>

### Example request

```bash theme={null}
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

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

<Tip>
  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.
</Tip>
