Events

Get events

1GET https://api.markprompt.com/analytics/events

Retrieves the list of analytics events.

Request body

KeyTypeDescriptionDefault
fromstring

The start of the range, as an ISO 8601 string.

tostring

The end of the range, as an ISO 8601 string.

limitnumber

The maximum number of results to return.

20

Example request

1curl "https://api.markprompt.com/analytics/events?from=2024-10-20T00%3A00%3A00&to=2024-10-21T00%3A00%3A00&limit=10" \
2  -X GET \
3  -H "Authorization: Bearer <TOKEN>" \
4  -H "Content-type: application/json" \
5  -H "Accept: application/json" \
6  -H "X-Markprompt-API-Version: 2024-05-21"

Response

The response is of the form:

1{
2  "object": "list",
3  "data": [
4    {
5      "id": "event-id-1",
6      "name": "generate:summary",
7      "createdAt": "2024-10-20T22:54:49.000000+00:00",
8      "client": "@markprompt/salesforce-ai-copilot",
9      "data": {
10        "caseNumber": "case-number-1"
11      },
12      "user": {
13        "id": "user-id-1",
14        "email": "jane@acme.com",
15        "fullName": "Jane Doe"
16      }
17    },
18    {
19      "id": "event-id-2",
20      "name": "generate:draft",
21      "createdAt": "2024-10-20T22:54:53.000000+00:00",
22      "client": "@markprompt/salesforce-ai-copilot",
23      "data": {
24        "caseNumber": "case-number-2"
25      },
26      "user": {
27        "id": "user-id-2",
28        "email": "john@acme.com",
29        "fullName": "John Doe"
30      }
31    },
32    {
33      "id": "event-id-3",
34      "name": "case:first-response",
35      "createdAt": "{{MP_TODAY_RANDOM_1_ISO_TZ}}",
36      "client": "@markprompt/salesforce-ai-copilot",
37      "data": {
38        "caseNumber": "case-number-2",
39        "timeToFirstResponse": 681
40      },
41      "user": {
42        "id": "user-id-1",
43        "email": "jane@acme.com",
44        "fullName": "Jane Doe"
45      }
46    }
47  ]
48}