> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Activity Logs

Use this API to retrieve activity log records for a document or organization.

# Endpoint

`POST https://api.velt.dev/v2/activities/get`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string` *required*

Organization ID

**documentId** `string`

Document ID. Filter activities to a specific document.

**targetEntityId** `string`

Target entity ID. Filter activities to a specific entity (e.g., annotation ID).

**featureTypes** `string[]`

Filter by feature type. Must be one or more of: `"comment"`, `"reaction"`, `"recorder"`, `"crdt"`, `"custom"`.

**actionTypes** `string[]`

Filter by action type (e.g., `["comment.add"]`).

**userId** `string`

Filter activities by the acting user's ID.

**activityIds** `string[]`

Fetch specific activities by ID.

**order** `string`

Order results by timestamp. Must be `asc` or `desc`. Default: `desc`.

**pageSize** `number`

Number of items to retrieve per page. Default: 1000. Minimum: 1.

**pageToken** `string`

Encrypted pagination token retrieved from a previous API response.

## **Example Requests**

#### 1. Get by organizationId and documentId

```JSON theme={null}
{
  "data": {
    "organizationId": "org-123",
    "documentId": "doc-456",
    "order": "desc",
    "pageSize": 50
  }
}
```

#### 2. Get by organizationId, documentId and featureTypes

```JSON theme={null}
{
  "data": {
    "organizationId": "org-123",
    "documentId": "doc-456",
    "featureTypes": ["comment"],
    "order": "desc",
    "pageSize": 50
  }
}
```

#### 3. Get specific activity logs by activityIds

```JSON theme={null}
{
  "data": {
    "organizationId": "org-123",
    "activityIds": ["activity-001", "activity-002"]
  }
}
```

#### 4. Get by targetEntityId with pagination

```JSON theme={null}
{
  "data": {
    "organizationId": "org-123",
    "documentId": "doc-456",
    "targetEntityId": "annotation-789",
    "pageSize": 20,
    "pageToken": "encryptedPageToken"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Activity(s) retrieved successfully.",
    "data": [
      {
        "id": "activity-001",
        "featureType": "comment",
        "actionType": "comment.add",
        "actionUser": {
          "userId": "user-1",
          "email": "user@example.com",
          "name": "User Name"
        },
        "targetEntityId": "annotation-789",
        "displayMessageTemplate": "{{user}} added a comment",
        "displayMessageTemplateData": {
          "user": {
            "userId": "user-1",
            "name": "User Name"
          }
        },
        "metadata": {
          "apiKey": "yourApiKey",
          "documentId": "doc-456",
          "organizationId": "org-123"
        },
        "timestamp": 1722409519944
      }
    ],
    "pageToken": "nextPageToken"
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Activity(s) retrieved successfully.",
    "data": [
      {
        "id": "activity-001",
        "featureType": "comment",
        "actionType": "comment.add",
        "actionUser": {
          "userId": "user-1",
          "email": "user@example.com",
          "name": "User Name"
        },
        "targetEntityId": "annotation-789",
        "displayMessageTemplate": "{{user}} added a comment",
        "displayMessageTemplateData": {
          "user": {
            "userId": "user-1",
            "name": "User Name"
          }
        },
        "metadata": {
          "apiKey": "yourApiKey",
          "documentId": "doc-456",
          "organizationId": "org-123"
        },
        "timestamp": 1722409519944
      }
    ],
    "pageToken": "nextPageToken"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.