# GET /v1/sessions/facets - Facet counts and masthead metrics

Source: <https://everruns.com/docs/api/operations/get_session_facets/>

GET

/v1/sessions/facets

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/sessions/facets?agent_id=agent_01933b5a00007000800000000000001';
const options = {method: 'GET'};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request GET \
  --url 'https://app.everruns.com/api/v1/sessions/facets?agent_id=agent_01933b5a00007000800000000000001'
```

* Production APIapp.everruns.com/api/v1/sessions/facets

## Parameters

### Query Parameters

**side\_chats\_only**

boolean

Exclude the permanent Chat from side-conversation pages.

**playground\_user\_id**

string

Filter by the fixed Playground end-user identity.

**archived\_only**

boolean

Return only archived sessions.

**agent\_id**

string

##### Example

```plaintext
agent_01933b5a00007000800000000000001
```

**search**

string

**source**

string

**status**

string

**mine**

boolean

**include\_archived**

boolean

**created\_after**

string

**created\_before**

string

**order**

string

## Responses

### 200

Facet counts over the applied filters

Media typeapplication/json

Facet-rail counts and masthead metrics for the sessions surface (EVE-852).

Every count is aggregated server-side over the same filter predicate as `GET /v1/sessions`, so a client never derives them by paging the list. Each facet dimension is counted with the other filters applied but its own selection excluded, which is what lets the rail offer multi-select.

object

**active\_now**

required

Sessions executing a turn or awaiting client tool results right now.

integer format: int64

**by\_activity**

required

Counts per derived activity (`running`, `paused`, `failed`, `completed`, `idle`).

Array\<object>

One bucket of a sessions facet dimension.

object

**count**

required

integer format: int64

**value**

required

The dimension value: an activity, a source, or an agent’s public id.

string

**by\_agent**

required

Counts per agent, keyed by the agent’s public id. Sessions with no agent are omitted.

Array\<object>

One bucket of a sessions facet dimension.

object

**count**

required

integer format: int64

**value**

required

The dimension value: an activity, a source, or an agent’s public id.

string

**by\_source**

required

Counts per session source.

Array\<object>

One bucket of a sessions facet dimension.

object

**count**

required

integer format: int64

**value**

required

The dimension value: an activity, a source, or an agent’s public id.

string

**failed\_today**

required

Sessions whose most recent turn failed or was cancelled today (UTC).

integer format: int64

**p95\_duration\_ms**

required

95th percentile session duration over the filtered set, milliseconds.

integer format: int64

**tokens\_today**

required

Tokens consumed by sessions created today (UTC).

integer format: int64

**total**

required

Sessions matching every applied filter.

integer format: int64

##### Example

```json
{
  "by_activity": [
    {
      "value": "running"
    }
  ],
  "by_agent": [
    {
      "value": "running"
    }
  ],
  "by_source": [
    {
      "value": "running"
    }
  ]
}
```

### 400

Unknown filter value

### 500

Internal server error