Skip to main content
GET
/
metrics
/
sessions
Get Session Metrics
curl --request GET \
  --url https://use.hoop.dev/api/metrics/sessions
{
  "data": [
    {
      "connection_name": "production-db",
      "connection_subtype": "amazon-rds",
      "connection_type": "postgres",
      "count_analyzed": 20,
      "count_masked": 15,
      "info_type": "EMAIL_ADDRESS",
      "is_masked": true,
      "org_id": "0CD7F941-2BB8-4F9F-93B0-11620D4652AB",
      "session_created_at": "2023-08-15T14:30:45Z",
      "session_duration_sec": 325,
      "session_ended_at": "2023-08-15T14:35:10Z",
      "session_id": "1CBC8DB5-FBF8-4293-8E35-59A6EEA40207"
    }
  ],
  "pages": {
    "page": 123,
    "size": 123,
    "total": 123
  }
}

Query Parameters

connection_type
string[]

Filter by connection types (e.g., postgres, mysql)

connection_subtype
string[]

Filter by connection subtypes (e.g., amazon-rds, azure-db)

connection_name
string[]

Filter by specific connection names

info_type
string[]

Filter by Presidio data types (e.g., EMAIL_ADDRESS, CREDIT_CARD, PHONE_NUMBER)

only_masked
boolean

Only return masked data (count_masked > 0)

only_unmasked
boolean

Only return unmasked data (count_masked = 0, but count_analyzed > 0)

start_date
string

Start date for filtering (format: YYYY-MM-DD)

end_date
string

End date for filtering (format: YYYY-MM-DD)

session_id
string[]

Filter by specific session IDs

session_start_date
string

Filter sessions that started on or after this date (format: YYYY-MM-DD)

session_end_date
string

Filter sessions that ended on or before this date (format: YYYY-MM-DD)

min_duration_sec
integer

Minimum session duration in seconds

max_duration_sec
integer

Maximum session duration in seconds

include_open_sessions
boolean

Include sessions that are still open (not ended)

logic_operator
string

Logic operator for combining filters: 'and' or 'or' (default: 'and')

page
integer

Pagination page (default: 1)

limit
integer

Pagination limit (default: 100, max: 1000)

aggregated
boolean

Return aggregated metrics instead of detailed list

Response

OK

data
object[]
pages
object