Activity Log API Reference
HTTP endpoints for fetching organization/project activity logs of management activities. E.g. invites, role changes, plan changes.
Use the Activity Log API to retrieve management activity events for Sanity users, projects, and organizations. This API cannot be used to retrieve activities for content.
Authentication
- All requests to private data must be authenticated. Requests to public information, like public assets, are available without an authentication token.
- Your token only returns activity for organizations and projects that you or the robot token can access. If you do not pass
organizationIdorprojectId, the API returns activity across your allowed organizations and projects.
Base API server URL
https://api.sanity.ioActivity
Retrieve activity log events.
Get activity log events
/v2021-02-01/activityReturns activity log events matching the supplied filters.
Requests only return events for organizations and projects that the authenticated user can access.
Query parameters
- actorIdarray
Actor user ID. Use the literal value
nullto match events whose actor ID is null.items
- itemsstring
- userIdarray
Target user ID. Repeat the query parameter to match any of several users.
items
- itemsstring
- projectIdarray
Target project ID. Repeat the query parameter to match any of several projects. User tokens may only specify allowed projects.
items
- itemsstring
- organizationIdarray
Target organization ID. Repeat the query parameter to match any of several organizations. User tokens may only specify allowed organizations.
items
- itemsstring
- actionarray
Activity action. Repeat the query parameter to match any of several actions.
Example["organization.name.edit"]items
- itemsstring
Maximum number of JSON events to return. Values above
100are capped to100.Example:50- offsetinteger (uint64)
Number of matching events to skip.
- startTimestring (date-time)
Include events with
timestampgreater than or equal to this RFC3339 timestamp.Example:2025-05-01T00:00:00Z - endTimestring (date-time)
Include events with
timestampless than or equal to this RFC3339 timestamp.Example:2025-11-25T23:59:59Z
Responses
Activity log events.
Activity event ID.
Example:ale-mock-idEvent schema/API version.
Example:mock-versionActor user ID,
sanity-system, or null for anonymous actors.Example:mock-actor-idActor display name when known.
Example:mock-actor-nameActor email address when known.
Example:mock-actor-email@example.comActivity action.
Example:mock-actionTime at which the activity occurred.
Example:1977-05-25T00:00:00ZHuman-readable activity description.
Example:mock-descriptionCorrelation ID for related events.
Example:mock-correlation-idActivity metadata key-value pairs.
Example{"key":"key-value","mock-key":"mock-key-value"}Target user ID.
Example:mock-user-idTarget user display name.
Example:mock-user-nameTarget user email address.
Example:mock-user-email@example.comTarget project ID.
Example:mock-project-idTarget project display name.
Example:mock-display-nameTarget organization ID.
Example:mock-organization-idTarget organization display name.
Example:mock-organization-display-nameTransaction ID for document-related events.
Example:mock-transaction-idTarget document ID.
Example:mock-document-idTarget dataset name.
Example:mock-dataset-name
items
application/json[
{
"id": "ale-mock-id",
"version": "mock-version",
"actorId": "mock-actor-id",
"actorName": "mock-actor-name",
"actorEmail": "actor@example.com",
"action": "mock-action",
"timestamp": "1977-05-25T00:00:00Z",
"description": "mock-description",
"correlationId": "mock-correlation-id",
"metadata": {
"key": "key-value",
"mock-key": "mock-key-value"
},
"userId": "mock-user-id",
"userName": "mock-user-name",
"userEmail": "user@example.com",
"projectId": "mock-project-id",
"projectDisplayName": "mock-display-name",
"organizationId": "mock-organization-id",
"organizationDisplayName": "mock-organization-display-name",
"transactionId": "mock-transaction-id",
"documentId": "mock-document-id",
"datasetName": "mock-dataset-name"
}
]Export activity log events as CSV
/v2021-02-01/activity/export/csvReturns a CSV export of activity log events matching the supplied filters.
CSV headers are sorted alphabetically. Metadata keys appear as dynamic
metadata.<key> columns when present in the returned events.
Query parameters
- actorIdarray
Actor user ID. Use the literal value
nullto match events whose actor ID is null.items
- itemsstring
- userIdarray
Target user ID. Repeat the query parameter to match any of several users.
items
- itemsstring
- projectIdarray
Target project ID. Repeat the query parameter to match any of several projects. User tokens may only specify allowed projects.
items
- itemsstring
- organizationIdarray
Target organization ID. Repeat the query parameter to match any of several organizations. User tokens may only specify allowed organizations.
items
- itemsstring
- actionarray
Activity action. Repeat the query parameter to match any of several actions.
Example["organization.name.edit"]items
- itemsstring
Maximum number of CSV events to export. If omitted, defaults to
10000. Values above50000are capped to50000. Explicit values less than or equal to10use the CSV default of10000.Example:5000- offsetinteger (uint64)
Number of matching events to skip.
- startTimestring (date-time)
Include events with
timestampgreater than or equal to this RFC3339 timestamp.Example:2025-05-01T00:00:00Z - endTimestring (date-time)
Include events with
timestampless than or equal to this RFC3339 timestamp.Example:2025-11-25T23:59:59Z
Responses
CSV activity log export.
- string
text/csvaction,actorEmail,actorId,actorName,correlationId,datasetName,description,documentId,id,metadata.key,metadata.mock-key,organizationDisplayName,organizationId,projectDisplayName,projectId,timestamp,transactionId,userEmail,userId,userName,version
mock-action,mock-actor-email,mock-actor-id,mock-actor-name,mock-correlation-id,mock-dataset-name,mock-description,mock-document-id,ale-mock-id,key-value,mock-key-value,mock-organization-display-name,mock-organization-id,mock-display-name,mock-project-id,1977-05-25T00:00:00Z,mock-transaction-id,mock-user-email,mock-user-id,mock-user-name,mock-version