# Get database activity

`GET https://api.instacloud.com/projects/{projectId}/database/activity`

**Token scope:** `account` · `org` · `project` — read-only tokens allowed.

Currently running queries (pg_stat_activity/provider API, ≤100). Provider-specific; may wake a suspended database.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `branch` | query | `string` | no | branch name (default branch if omitted) |
| `group` | query | `string` | no | postgres service name (default: the sole postgres service) |
| `projectId` | path | `string` | yes |  |

## Response 200

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `queries` | `object[]` | no |  |
| `queries.pid` | `integer` | no |  |
| `queries.state` | `string` | no |  |
| `queries.waitEvent` | `string` | no |  |
| `queries.durationMs` | `number` | no |  |
| `queries.query` | `string` | no |  |
| `queries.application` | `string` | no |  |
| `queries.client` | `string` | no |  |
| `queries.queryStart` | `string` | no |  |

## Response 400

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 403

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 404

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 409

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 502

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |
