---
title: "Search activity logs"
method: POST
path: "/v1/activity-logs/search"
tags: ["Activity Logs"]
---

# Search activity logs

`POST /v1/activity-logs/search`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/activity-logs/search`
- Auth: one of:
  - API key in header `GREPR-API-KEY`
  - OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Search activity logs with flexible filtering and pagination. Logs are returned as LogEvent objects with metadata stored in attributes and tags. Full-text search is supported on the message field using PostgreSQL's text search capabilities. All list filters are optional - null or empty lists mean 'match all' for that field.

## Request body

- ActivityLogsSearch: Activity logs search criteria
  - `endTime` string, date-time: End of time range filter. Must be a valid ISO timestamp in UTC.
  - `limit` integer: Maximum number of results to return
  - `logTypes` string[]: Optional filter by log types. If null or empty, matches all log types.
  - `offset` integer: Number of results to skip for pagination
  - `resourceFilters` ResourceFilter[]: Optional resource filters. Multiple filters use OR logic. If null or empty, matches all resources the user has access to (requires system logs permission if no filters specified).
    - `resourceId` string: Specific resource ID to filter by. If null, matches all resources of this type in the organization.
    - `resourceType` 'INTEGRATION' | 'JOB' | 'DATASET' | 'TEMPLATE' | 'TEAM' | 'USER' | 'ORGANIZATION_SETTINGS' | 'SERVICE_ACCOUNT' | 'ORGANIZATION' | 'BILLING' | 'ISSUE', required: Resource type to filter by
  - `searchQuery` string: Optional full-text search query for message content. Uses PostgreSQL's text search capabilities.
  - `startTime` string, date-time: Start of time range filter. Must be a valid ISO timestamp in UTC.
  - `statuses` string[]: Optional filter by log statuses. If null or empty, matches all log statuses.
  - `userIds` string[]: Optional filter by user IDs who triggered the activity. If null or empty, matches all users.

## Response `200`

activity logs retrieved successfully

- ItemsCollectionLogEvent
  - `items` LogEvent[]
    - `attributes` object: Attributes associated with the event, a map from attribute name to attribute value, which may be a nested map or list.
    - `eventTimestamp` integer, required: Event timestamp that is in the record. Milliseconds from epoch.
    - `id` string, required: Id of the event.
    - `message` string: The log message.
    - `receivedTimestamp` integer, required: Timestamp when the event was received by Grepr. Milliseconds from epoch.
    - `severity` integer: The log severity. Higher numbers mean higher severity, following the OTel format 1-24.
    - `tags` object: Tags associated with the event, a map from tag name to set of tag values.

## Other responses

- `401`: Unauthorized

---

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