---
title: "Get by resource"
---

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

Path: Sureshake API › analytics

`GET /v2/analytics/resource/{resourceType}/{resourceId}`

## Path parameters

- `resourceType` (`analytics-get-by-resource.path.resourceType`; string, required)
- `resourceId` (`analytics-get-by-resource.path.resourceId`; string, required)

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.sureshake.com/v2/analytics/resource/<resourceType>/<resourceId>'
```

### TypeScript

```typescript
const url = 'https://api.sureshake.com/v2/analytics/resource/<resourceType>/<resourceId>';
const options = {method: 'GET'};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sureshake.com/v2/analytics/resource/<resourceType>/<resourceId>"

response = requests.get(url)

print(response.text)
```

## Responses

### 200

Default Response

#### Example

```json
{
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "eventType": "string",
      "category": "communication",
      "actorUserId": "string",
      "targetUserId": "string",
      "entityId": "156e622c-6cdf-4c27-9bc9-2f2db69919f5",
      "resourceType": "string",
      "resourceId": "string",
      "payload": {
        "property1": null,
        "property2": null
      },
      "status": "created",
      "correlationId": "48fb4cd3-2ef6-4479-bea1-7c92721b988c",
      "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459",
      "ipAddress": "string",
      "userAgent": "string",
      "occurredAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z",
      "schemaVersion": "string"
    }
  ],
  "meta": {
    "total": 0,
    "limit": 0,
    "offset": 0,
    "hasMore": true,
    "page": 0,
    "totalPages": 0
  }
}
```

- `data` (`analytics-get-by-resource.response.200.data`; array<object>, required)
  - `id` (`analytics-get-by-resource.response.200.data.id`; string, required)
    - format `uuid`
  - `eventType` (`analytics-get-by-resource.response.200.data.eventType`; string, required)
  - `category` (`analytics-get-by-resource.response.200.data.category`; string, required)
    - one of `"communication"`, `"auth"`, `"profile"`, `"document"`, `"social"`, `"billing"`, `"system"`
  - `actorUserId` (`analytics-get-by-resource.response.200.data.actorUserId`; string, required, nullable)
  - `targetUserId` (`analytics-get-by-resource.response.200.data.targetUserId`; string, required, nullable)
  - `entityId` (`analytics-get-by-resource.response.200.data.entityId`; string, required, nullable)
    - format `uuid`
  - `resourceType` (`analytics-get-by-resource.response.200.data.resourceType`; string, required, nullable)
  - `resourceId` (`analytics-get-by-resource.response.200.data.resourceId`; string, required, nullable)
  - `payload` (`analytics-get-by-resource.response.200.data.payload`; map<unknown>, required)
  - `status` (`analytics-get-by-resource.response.200.data.status`; string, required)
    - one of `"created"`, `"pending"`, `"delivered"`, `"failed"`, `"bounced"`
  - `correlationId` (`analytics-get-by-resource.response.200.data.correlationId`; string, required, nullable)
    - format `uuid`
  - `sessionId` (`analytics-get-by-resource.response.200.data.sessionId`; string, required, nullable)
    - format `uuid`
  - `ipAddress` (`analytics-get-by-resource.response.200.data.ipAddress`; string, required, nullable)
  - `userAgent` (`analytics-get-by-resource.response.200.data.userAgent`; string, required, nullable)
  - `occurredAt` (`analytics-get-by-resource.response.200.data.occurredAt`; string, required)
    - format `date-time`
  - `createdAt` (`analytics-get-by-resource.response.200.data.createdAt`; string, required)
    - format `date-time`
  - `schemaVersion` (`analytics-get-by-resource.response.200.data.schemaVersion`; string, required)
- `meta` (`analytics-get-by-resource.response.200.meta`; object, required)
  - `total` (`analytics-get-by-resource.response.200.meta.total`; number, required) — Total number of items available
  - `limit` (`analytics-get-by-resource.response.200.meta.limit`; number, required) — Number of items per page
  - `offset` (`analytics-get-by-resource.response.200.meta.offset`; number, required) — Number of items skipped
  - `hasMore` (`analytics-get-by-resource.response.200.meta.hasMore`; boolean, required) — Whether more items are available
  - `page` (`analytics-get-by-resource.response.200.meta.page`; number, optional) — Current page number
  - `totalPages` (`analytics-get-by-resource.response.200.meta.totalPages`; number, optional) — Total number of pages

### 400

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`analytics-get-by-resource.response.400.error`; object, required)
  - `code` (`analytics-get-by-resource.response.400.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`analytics-get-by-resource.response.400.error.message`; string, required) — Human-readable error message
  - `details` (`analytics-get-by-resource.response.400.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`analytics-get-by-resource.response.400.error.traceId`; string, optional) — Unique ID for log correlation

### 401

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`analytics-get-by-resource.response.401.error`; object, required)
  - `code` (`analytics-get-by-resource.response.401.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`analytics-get-by-resource.response.401.error.message`; string, required) — Human-readable error message
  - `details` (`analytics-get-by-resource.response.401.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`analytics-get-by-resource.response.401.error.traceId`; string, optional) — Unique ID for log correlation

### 403

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`analytics-get-by-resource.response.403.error`; object, required)
  - `code` (`analytics-get-by-resource.response.403.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`analytics-get-by-resource.response.403.error.message`; string, required) — Human-readable error message
  - `details` (`analytics-get-by-resource.response.403.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`analytics-get-by-resource.response.403.error.traceId`; string, optional) — Unique ID for log correlation

### 500

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`analytics-get-by-resource.response.500.error`; object, required)
  - `code` (`analytics-get-by-resource.response.500.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`analytics-get-by-resource.response.500.error.message`; string, required) — Human-readable error message
  - `details` (`analytics-get-by-resource.response.500.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`analytics-get-by-resource.response.500.error.traceId`; string, optional) — Unique ID for log correlation


Source: https://docs.sureshake.com/reference/analytics-get-by-resource/index.md
