HTTP API Reference

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 organizationId or projectId, the API returns activity across your allowed organizations and projects.

Base API server URL

https://api.sanity.io

Activity

Retrieve activity log events.

Get activity log events

get/v2021-02-01/activity

Returns 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 null to 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
  • Target project ID. Repeat the query parameter to match any of several projects. User tokens may only specify allowed projects.

    items
    • itemsstring
  • 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
  • limitinteger (uint64)default: 10

    Maximum number of JSON events to return. Values above 100 are capped to 100.

    Example:50
  • offsetinteger (uint64)

    Number of matching events to skip.

  • startTimestring (date-time)

    Include events with timestamp greater than or equal to this RFC3339 timestamp.

    Example:2025-05-01T00:00:00Z
  • endTimestring (date-time)

    Include events with timestamp less than or equal to this RFC3339 timestamp.

    Example:2025-11-25T23:59:59Z

Responses

200

Activity log events.

    items
    • idstringrequired

      Activity event ID.

      Example:ale-mock-id
    • versionstringrequired

      Event schema/API version.

      Example:mock-version
    • actorIdstring | nullrequired

      Actor user ID, sanity-system, or null for anonymous actors.

      Example:mock-actor-id
    • actorNamestring | nullrequired

      Actor display name when known.

      Example:mock-actor-name
    • actorEmailstring (email) | nullrequired

      Actor email address when known.

      Example:mock-actor-email@example.com
    • actionstringrequired

      Activity action.

      Example:mock-action
    • timestampstring (date-time)required

      Time at which the activity occurred.

      Example:1977-05-25T00:00:00Z
    • descriptionstringrequired

      Human-readable activity description.

      Example:mock-description
    • correlationIdstring | nullrequired

      Correlation ID for related events.

      Example:mock-correlation-id
    • metadataobject | nullrequired

      Activity metadata key-value pairs.

      Example
      {"key":"key-value","mock-key":"mock-key-value"}
    • userIdstring | nullrequired

      Target user ID.

      Example:mock-user-id
    • userNamestring | nullrequired

      Target user display name.

      Example:mock-user-name
    • userEmailstring (email) | nullrequired

      Target user email address.

      Example:mock-user-email@example.com
    • projectIdstring | nullrequired

      Target project ID.

      Example:mock-project-id
    • projectDisplayNamestring | nullrequired

      Target project display name.

      Example:mock-display-name
    • organizationIdstring | nullrequired

      Target organization ID.

      Example:mock-organization-id
    • organizationDisplayNamestring | nullrequired

      Target organization display name.

      Example:mock-organization-display-name
    • transactionIdstring | nullrequired

      Transaction ID for document-related events.

      Example:mock-transaction-id
    • documentIdstring | nullrequired

      Target document ID.

      Example:mock-document-id
    • datasetNamestring | nullrequired

      Target dataset name.

      Example:mock-dataset-name
Examplesapplication/json
Single activity event
[
  {
    "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

get/v2021-02-01/activity/export/csv

Returns 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 null to 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
  • Target project ID. Repeat the query parameter to match any of several projects. User tokens may only specify allowed projects.

    items
    • itemsstring
  • 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
  • limitinteger (uint64)default: 10000

    Maximum number of CSV events to export. If omitted, defaults to 10000. Values above 50000 are capped to 50000. Explicit values less than or equal to 10 use the CSV default of 10000.

    Example:5000
  • offsetinteger (uint64)

    Number of matching events to skip.

  • startTimestring (date-time)

    Include events with timestamp greater than or equal to this RFC3339 timestamp.

    Example:2025-05-01T00:00:00Z
  • endTimestring (date-time)

    Include events with timestamp less than or equal to this RFC3339 timestamp.

    Example:2025-11-25T23:59:59Z

Responses

200

CSV activity log export.

  • string
Examplestext/csv
CSV activity event export
action,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