> This page is for version 2025-09-18 (default).
> For other versions, use one of these documentation indexes:
> - 2025-09-18 (default): https://apidocs.polytomic.com/2025-09-18/llms.txt
> - 2024-02-08: https://apidocs.polytomic.com/2024-02-08/llms.txt
> - 2023-04-25: https://apidocs.polytomic.com/2023-04-25/llms.txt
> - 2022-12-12: https://apidocs.polytomic.com/2022-12-12/llms.txt
> - 2021-05-23: https://apidocs.polytomic.com/2021-05-23/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

# List Harbor Activity

GET https://app.polytomic.com/api/organization/harbor-activity

Lists Harbor Activity recorded for the caller's organization.

You must be an active Organization administrator to use this endpoint.

`start_time` is inclusive and `end_time` is exclusive. Both filter the time at
which Polytomic recorded each event, which can differ from `occurred_at`. A
single request can cover at most 90 days.

Results are ordered from newest to oldest by default. Set `order` to `asc` to
retrieve the oldest events first. A page contains at most 100 events. Pass
`next_page_token` from the response as `page_token` with the same time range,
filters, order, and limit to retrieve the next page. The token expires 24 hours
after the first page. Pagination uses a live descending cursor, so an event from
a transaction that commits between pages can require a fresh traversal.

Responses include stable identities, bounded resource snapshots, schema label
snapshots with truncation state, field counts, and row counts when available.
They do not include internal recorded-order values, 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.

Reference: https://apidocs.polytomic.com/api-reference/activity/list

## Authentication

- `Authorization` header (bearer token, required) — Bearer user API key
- `Authorization` header (basic auth, required) — Basic organization-scoped API key

## Request

### Query parameters

- `start_time` (datetime, required) — Inclusive start of the event recorded-time range.
- `end_time` (datetime, required) — Exclusive end of the event recorded-time range. The range can span at most 90 days.
- `limit` (integer, optional, default: 50) — Maximum number of events to return. Defaults to 50 and cannot exceed 100.
- `page_token` (string, optional) — Opaque pagination cursor returned by the previous request. It expires 24 hours after the first page.
- `order` (enum, optional, default: desc) — Order in which events were recorded. Defaults to desc.
  - Allowed values: `asc`, `desc`
- `harbor_id` (list of string, optional) — Return events for these Harbors. Repeat the parameter to filter by multiple IDs.
- `event_type` (list of string, optional) — Return events with these event types. Repeat the parameter to filter by multiple types.
- `outcome` (list of string, optional) — Return events with these outcomes. Repeat the parameter to filter by multiple outcomes.
- `operation_id` (list of string, optional) — Return events for these operation IDs.
- `session_id` (list of string, optional) — Return events for these session IDs.
- `actor_id` (list of string, optional) — Return events for these actor IDs.
- `credential_id` (list of string, optional) — Return events for these credential IDs.
- `connection_id` (list of string, optional) — Return events for these Connection IDs.

## Response

### 200

OK

- `data` (list of HarboractivityapiHarborActivityEvent, optional, nullable)
- `pagination` (PaginationDetails, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

### 401 Unauthorized Error

Unauthorized

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

### 403 Forbidden Error

Forbidden

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

### 410 Gone Error

Gone

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

### 422 Unprocessable Entity Error

Unprocessable Entity

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

## Types

### HarboractivityapiHarborActivityEvent

- `actor` (HarboractivityapiHarborActivityActorSnapshot, optional)
- `attempt_id` (string, optional)
- `client_name` (string, optional)
- `client_version` (string, optional)
- `connection_id` (string, optional)
- `context_id` (string, optional)
- `context_revision_id` (string, optional)
- `credential` (HarboractivityapiHarborActivityIdentitySnapshot, optional)
- `event_type` (string, optional)
- `harbor_id` (string, optional)
- `id` (string, optional)
- `lifecycle_events` (list of HarboractivityapiHarborActivityEvent, optional)
- `metadata` (HarboractivityapiHarborActivityMetadata, optional)
- `occurred_at` (datetime, optional)
- `operation_id` (string, optional)
- `outcome` (string, optional)
- `profile` (HarboractivityapiHarborActivityIdentitySnapshot, optional)
- `provenance` (string, optional)
- `query_source` (HarboractivityapiHarborActivityQuerySource, optional)
- `recorded_at` (datetime, optional)
- `session_id` (string, optional)
- `targets` (list of HarboractivityapiHarborActivityTarget, optional, nullable)

### PaginationDetails

- `next_page_token` (string, optional)

### HarboractivityapiHarborActivityActorSnapshot

- `display_name` (string, optional)
- `email` (string, optional)
- `id` (string, optional)
- `type` (string, optional)

### HarboractivityapiHarborActivityIdentitySnapshot

- `id` (string, optional)

### HarboractivityapiHarborActivityMetadata

- `action_enabled` (boolean, optional, nullable)
- `action_field_ids` (list of string, optional)
- `action_id` (string, optional)
- `action_lookup_field_id` (string, optional)
- `action_lookup_field_ids` (list of string, optional)
- `action_request_id` (string, optional)
- `attempt_number` (integer, optional, nullable)
- `category` (string, optional)
- `client_name` (string, optional)
- `client_version` (string, optional)
- `connection_name` (string, optional, nullable)
- `connection_name_truncated` (boolean, optional, nullable)
- `connection_type` (string, optional, nullable)
- `context_version` (integer, optional, nullable) — Published context version number at fetch time, when recorded.
- `error_category` (string, optional)
- `execution_duration_ms` (integer, optional, nullable)
- `external_run_id` (string, optional)
- `failure_code` (string, optional)
- `field_count` (integer, optional, nullable) — Number of fields returned by a query. Raw field names are not returned.
- `has_next_page` (boolean, optional, nullable)
- `label` (string, optional, nullable) — Bounded resource label snapshot.
- `label_truncated` (boolean, optional, nullable) — Whether the resource label snapshot was truncated.
- `operation` (string, optional)
- `phase` (string, optional)
- `queue_duration_ms` (integer, optional, nullable)
- `reason` (string, optional)
- `record_id` (string, optional)
- `row_count` (integer, optional, nullable)
- `saved_query_id` (string, optional)
- `saved_query_revision_id` (string, optional)
- `saved_query_version` (integer, optional, nullable)
- `schema_id` (string, optional)
- `statement_category` (string, optional)
- `supported` (boolean, optional, nullable)
- `total_duration_ms` (integer, optional, nullable)

### HarboractivityapiHarborActivityQuerySource

- `kind` (string, optional)
- `saved_query` (HarboractivityapiHarborActivitySavedQuerySource, optional)
- `submission_event_id` (string, optional)
- `submitted_at` (datetime, optional, nullable)

### HarboractivityapiHarborActivityTarget

- `id` (string, optional)
- `label` (string, optional)
- `label_truncated` (boolean, optional)
- `revision_id` (string, optional)
- `type` (string, optional)
- `version` (integer, optional, nullable)

### HarboractivityapiHarborActivitySavedQuerySource

- `id` (string, optional)
- `name` (string, optional)
- `name_truncated` (boolean, optional)
- `revision_id` (string, optional)
- `version` (integer, optional)

## Examples

**Response**

```json
{
  "data": [
    {
      "actor": {
        "display_name": "string",
        "email": "string",
        "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
        "type": "string"
      },
      "attempt_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "client_name": "string",
      "client_version": "string",
      "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "context_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "context_revision_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "credential": {
        "id": "248df4b7-aa70-47b8-a036-33ac447e668d"
      },
      "event_type": "string",
      "harbor_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "lifecycle_events": [
        null
      ],
      "metadata": {
        "action_enabled": true,
        "action_field_ids": [
          "string"
        ],
        "action_id": "string",
        "action_lookup_field_id": "string",
        "action_lookup_field_ids": [
          "string"
        ],
        "action_request_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
        "attempt_number": 1,
        "category": "string",
        "client_name": "string",
        "client_version": "string",
        "connection_name": "string",
        "connection_name_truncated": true,
        "connection_type": "string",
        "context_version": 1,
        "error_category": "string",
        "execution_duration_ms": 1,
        "external_run_id": "string",
        "failure_code": "string",
        "field_count": 1,
        "has_next_page": true,
        "label": "string",
        "label_truncated": true,
        "operation": "string",
        "phase": "string",
        "queue_duration_ms": 1,
        "reason": "string",
        "record_id": "string",
        "row_count": 1,
        "saved_query_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
        "saved_query_revision_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
        "saved_query_version": 1,
        "schema_id": "string",
        "statement_category": "string",
        "supported": true,
        "total_duration_ms": 1
      },
      "occurred_at": "2024-01-15T09:30:00Z",
      "operation_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "outcome": "string",
      "profile": {
        "id": "248df4b7-aa70-47b8-a036-33ac447e668d"
      },
      "provenance": "string",
      "query_source": {
        "kind": "string",
        "saved_query": {
          "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
          "name": "string",
          "name_truncated": true,
          "revision_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
          "version": 1
        },
        "submission_event_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
        "submitted_at": "2024-01-15T09:30:00Z"
      },
      "recorded_at": "2024-01-15T09:30:00Z",
      "session_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "targets": [
        {
          "id": "string",
          "label": "string",
          "label_truncated": true,
          "revision_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
          "type": "string",
          "version": 1
        }
      ]
    }
  ],
  "pagination": {
    "next_page_token": "AmkYh8v0jR5B3kls2Qcc9y8MjrPmvR4CvaK7H0F4rEwqvg76K=="
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.polytomic.com/api/organization/harbor-activity"

querystring = {"end_time":"end_time","start_time":"start_time"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://app.polytomic.com/api/organization/harbor-activity?end_time=end_time&start_time=start_time';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://app.polytomic.com/api/organization/harbor-activity?end_time=end_time&start_time=start_time"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.polytomic.com/api/organization/harbor-activity?end_time=end_time&start_time=start_time")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.polytomic.com/api/organization/harbor-activity?end_time=end_time&start_time=start_time")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.polytomic.com/api/organization/harbor-activity?end_time=end_time&start_time=start_time', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.polytomic.com/api/organization/harbor-activity?end_time=end_time&start_time=start_time");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.polytomic.com/api/organization/harbor-activity?end_time=end_time&start_time=start_time")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```