---
title: "Get Harbor Activity Session"
method: GET
path: "/api/organization/harbor-activity/sessions/{session_id}"
tags: ["Activity"]
---

# Get Harbor Activity Session

`GET /api/organization/harbor-activity/sessions/{session_id}`

## Request

- Base URL: `https://app.polytomic.com`
- URL: `https://app.polytomic.com/api/organization/harbor-activity/sessions/{session_id}`
- Auth: one of:
  - HTTP bearer
  - HTTP basic

Returns one Harbor Activity session and its events.

You must be an active Organization administrator to use this endpoint. The
session must belong to the Organization against which you authenticated.

Events are ordered from oldest to newest by default. Set `order` to `desc` to
retrieve the newest events first. A page contains at most 100 events. Pass
`next_page_token` from the response as `page_token` with the same order and
limit to retrieve the next page.

`history_truncated` is `true` when Activity retention removed events from the
beginning of the session. The lifecycle summary remains available while the
session itself is retained.

The response uses the same event allowlist as the Activity list and detail
endpoints. It does not include session tokens, submitted SQL, raw field names,
detailed provider errors, result rows, or raw pagination tokens.

> ℹ️ Activity retention
>
> Polytomic retains Activity events for at least 90 days. Pagination tokens
> expire 24 hours after the first page.

## Path parameters

- `session_id` string, uuid, required: Harbor Activity session ID

## Query parameters

- `limit` integer: Maximum number of events to return. Defaults to 50 and cannot exceed 100.
- `page_token` string: Opaque pagination cursor returned by the previous request. It expires 24 hours after the first page.
- `order` 'asc' | 'desc': Order in which events were recorded. Defaults to asc.

## Headers

- `X-Polytomic-Version` string

## Response `200`

OK

- HarborActivitySessionEnvelope
  - `data` HarboractivityapiHarborActivitySession
    - `client_name` string: MCP-observed client name
    - `client_version` string: MCP-observed client version
    - `credential` HarboractivityapiHarborActivityIdentitySnapshot
      - `id` string, uuid: ID of the actor, credential, or profile
    - `ended_at` string, date-time, nullable: When the session closed or expired
    - `events` HarboractivityapiHarborActivityEvent[], nullable: Session events on this page
      - `actor` HarboractivityapiHarborActivityActorSnapshot
        - `display_name` string: Actor display name when the event was recorded
        - `email` string: Actor email when the event was recorded
        - `id` string, uuid: ID of the actor, credential, or profile
        - `type` string: Actor type
      - `attempt_id` string, uuid: Query attempt ID
      - `client_name` string: MCP-observed client name of the event's session
      - `client_version` string: MCP-observed client version of the event's session
      - `connection_id` string, uuid: Connection ID involved in the event
      - `context_id` string, uuid: Context document ID involved in the event
      - `context_revision_id` string, uuid: Context revision ID involved in the event
      - `credential` HarboractivityapiHarborActivityIdentitySnapshot
        - `id` string, uuid: ID of the actor, credential, or profile
      - `event_type` 'action.looked_up' | 'action.configuration_changed' | 'action.listed' | 'action.prepared' | 'action.preparation_expired' | 'action.attempt_started' | 'action.succeeded' | 'action.failed' | 'action.unknown' | 'session.started' | 'session.closed' | 'session.expired' | 'context.listed' | 'context.fetched' | 'saved_query.listed' | 'saved_query.fetched' | 'connection.listed' | 'schema.listed' | 'schema.fetched' | 'evidence_capability.fetched' | 'query.submitted' | 'query.started' | 'query.succeeded' | 'query.failed' | 'evidence_link.created' | 'access.denied'
      - `harbor_id` string, uuid: Harbor ID of the event
      - `id` string, uuid: Activity event ID
      - `lifecycle_events` HarboractivityapiHarborActivityEvent[]
      - `metadata` HarboractivityapiHarborActivityMetadata
        - `action_enabled` boolean, nullable: On action.configuration_changed events, whether the action is enabled after the change; true on preparation and execution events
        - `action_field_ids` string[]: Field IDs granted, submitted, or returned by the action
        - `action_id` string: Action identity, as the schema ID and operation ID joined by a slash
        - `action_lookup_field_id` string: Lookup field ID used by the action
        - `action_lookup_field_ids` string[]: Lookup field IDs granted by the action configuration
        - `action_request_id` string, uuid: Action execution ID
        - `attempt_number` integer, nullable: Query attempt number
        - `category` string: Category of the access denial
        - `client_name` string: MCP-observed client name of the session
        - `client_version` string: MCP-observed client version of the session
        - `connection_name` string, nullable: Connection name when the query was submitted, or of the source a fetched source document describes
        - `connection_name_truncated` boolean, nullable: Whether the connection name snapshot was truncated
        - `connection_type` string, nullable: Connection type of the queried connection, or of the source a fetched source document describes
        - `context_version` integer, nullable: Published context version number at fetch time, when recorded
        - `error_category` string: Category of a failed query or action
        - `execution_duration_ms` integer, nullable: Milliseconds the query spent executing
        - `external_run_id` string: Client-supplied run correlation value of the session
        - `failure_code` string: Failure code of a failed query
        - `field_count` integer, nullable: Number of fields returned by a query. Raw field names are not returned.
        - `has_next_page` boolean, nullable: Whether the listed page had more results
        - `label` string, nullable: Bounded resource label snapshot
        - `label_truncated` boolean, nullable: Whether the resource label snapshot was truncated
        - `operation` string: Operation that was denied
        - `phase` 'dispatch' | 'preflight' | 'execution'
        - `queue_duration_ms` integer, nullable: Milliseconds between query submission and the start of execution
        - `reason` string: Reason the session ended or access was denied
        - `record_id` string: Record ID of the created record view link
        - `row_count` integer, nullable: Number of rows returned by the query
        - `saved_query_id` string, uuid: Saved query ID
        - `saved_query_revision_id` string, uuid: Saved query revision ID
        - `saved_query_version` integer, nullable: Saved query version
        - `schema_id` string: Schema ID involved in the event
        - `statement_category` 'select' | 'other' | 'unknown'
        - `supported` boolean, nullable: Whether record view links can be created for the schema
        - `total_duration_ms` integer, nullable: Milliseconds between query submission and its final outcome
      - `occurred_at` string, date-time: When the operation occurred
      - `operation_id` string, uuid: Operation ID shared by the events of one query or action
      - `outcome` 'succeeded' | 'failed' | 'denied' | 'unknown'
      - `profile` HarboractivityapiHarborActivityIdentitySnapshot
        - `id` string, uuid: ID of the actor, credential, or profile
      - `provenance` 'server_observed' | 'service_attested' | 'client_asserted'
      - `query_source` HarboractivityapiHarborActivityQuerySource
        - `kind` string: Query source: saved_query, ad_hoc, or unknown when the submission is no longer retained
        - `saved_query` HarboractivityapiHarborActivitySavedQuerySource
          - `id` string, uuid: Saved query ID
          - `name` string: Saved query name when the query was submitted
          - `name_truncated` boolean: Whether the name snapshot was truncated
          - `revision_id` string, uuid: Saved query revision ID that was submitted
          - `version` integer: Saved query version that was submitted
        - `submission_event_id` string, uuid: ID of the query.submitted event
        - `submitted_at` string, date-time, nullable: When the query was submitted
      - `recorded_at` string, date-time: When Polytomic recorded the event
      - `session_id` string, uuid: Harbor session ID of the event
      - `targets` HarboractivityapiHarborActivityTarget[], nullable: Resources involved in the event
        - `id` string: Target resource ID
        - `label` string: Label snapshot of the target resource
        - `label_truncated` boolean: Whether the label snapshot was truncated
        - `revision_id` string, uuid: Saved query revision ID, for saved query targets
        - `type` string: Type of the target resource: connection, schema, context, context_revision, or saved_query
        - `version` integer, nullable: Saved query version, for saved query targets
    - `expires_at` string, date-time: When the session expires
    - `external_run_id` string: Client-supplied run correlation value
    - `harbor_id` string, uuid: Harbor ID of the session
    - `history_truncated` boolean: Whether retention removed events from the beginning of the session
    - `id` string, uuid: Harbor session ID
    - `profile` HarboractivityapiHarborActivityIdentitySnapshot
      - `id` string, uuid: ID of the actor, credential, or profile
    - `started_at` string, date-time: When the session started
    - `started_event_id` string, uuid: ID of the session.started event
    - `status` 'active' | 'closed' | 'expired': Session status
    - `terminal_event_id` string, uuid: ID of the event that closed or expired the session
  - `pagination` PaginationDetails
    - `next_page_token` string: Token for fetching the next page of results

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `410`: Gone
- `422`: Unprocessable Entity

## Changes

- **2026-10-26** `82ef9c39493c`: 5 breaking, 5 info
  - the `data/allOf[#/components/schemas/HarboractivityapiHarborActivitySession]/events/items/event_type` response's property type changed from `string` to no type for status `200`
  - the `data/allOf[#/components/schemas/HarboractivityapiHarborActivitySession]/events/items/metadata/allOf[#/components/schemas/HarboractivityapiHarborActivityMetadata]/phase` response's property type changed from `string` to no type for status `200`
  - the `data/allOf[#/components/schemas/HarboractivityapiHarborActivitySession]/events/items/metadata/allOf[#/components/schemas/HarboractivityapiHarborActivityMetadata]/statement_category` response's property type changed from `string` to no type for status `200`
  - the `data/allOf[#/components/schemas/HarboractivityapiHarborActivitySession]/events/items/outcome` response's property type changed from `string` to no type for status `200`
  - …6 more
- **2026-10-22** `d80b0fdea14e`: 2 breaking, 16 warning, 2 info
  - the `data` response's property type changed from `object` to no type for status `200`
  - the `pagination` response's property type changed from `object` to no type for status `200`
  - removed the optional property `data/client_name` from the response with the `200` status
  - removed the optional property `data/client_version` from the response with the `200` status
  - …16 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/polytomic/apis/polytomic-api/changes/api/organization/harbor-activity/sessions/:session_id/get.md)

---

[API](https://skmtc.dev/polytomic/apis/polytomic-api.md) - [All operations](https://skmtc.dev/polytomic/apis/polytomic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/polytomic/apis/polytomic-api/revisions/3c88180d2470?raw)
