import Moonbase from '@moonbaseai/sdk';
const client = new Moonbase({
apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const activity of client.activities.list()) {
console.log(activity);
}{
"type": "list",
"data": [
{
"id": "1CLJt2vz9X6Nwj5vGfMMFx",
"occurred_at": "2025-02-13T16:00:00.000Z",
"type": "activity/program_message_unsubscribed",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"email": "[email protected]"
},
{
"id": "1CLJt2vxfDtfVS9n6tspZJ",
"occurred_at": "2025-02-12T16:00:00.000Z",
"type": "activity/program_message_shielded",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"reason_code": "person_previously_unsubscribed"
},
{
"id": "1CLJt2vwRJtZwrhzdRUsyR",
"occurred_at": "2025-02-11T16:00:00.000Z",
"type": "activity/program_message_failed",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"reason_code": "message_contained_virus"
},
{
"id": "1CLJt2vvBPtUQHGD9x5wPY",
"occurred_at": "2025-02-10T16:00:00.000Z",
"type": "activity/program_message_complained",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vtwUtNrhpRgUgzof",
"occurred_at": "2025-02-09T16:00:00.000Z",
"type": "activity/program_message_bounced",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"bounced_recipient_emails": [
"[email protected]"
],
"bounce_type": "Permanent"
},
{
"id": "1CLJt2vshZtHK8NeD1J4Dn",
"occurred_at": "2025-02-08T16:00:00.000Z",
"type": "activity/program_message_clicked",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"link_url_unsafe": "https://google.com/•••",
"link_text": "hi"
},
{
"id": "1CLJt2vrTetBmYvrjXu7du",
"occurred_at": "2025-02-07T16:00:00.000Z",
"type": "activity/program_message_opened",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vqDjt6DyV5G4WB42",
"occurred_at": "2025-02-06T16:00:00.000Z",
"type": "activity/program_message_sent",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"recipient_emails": [
"[email protected]"
]
},
{
"id": "1CLJt2vkkrGws6gekm5ax4",
"occurred_at": "2025-02-04T15:00:00.000Z",
"type": "activity/call_occurred",
"call": {
"id": "1CLJt2vfoCGZgnuWrsVpcY",
"type": "call"
}
},
{
"id": "1CLJt2vk1hg68xDafsqpbj",
"occurred_at": "2025-02-04T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vimnfzbNmoCQSt1r",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vi2e58sEJj7XD7fX",
"occurred_at": "2025-02-04T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vgnj53Kerwe3pB5e",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vf43fhxeSSmzG4GD",
"occurred_at": "2025-02-03T16:00:00.000Z",
"type": "activity/note_created",
"note": {
"id": "1CLJt2veofU63vx65hBU9S",
"type": "note"
},
"related_item": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"related_meeting": null
},
{
"id": "1CLJt2vcKqTtxn4X8kPayg",
"occurred_at": "2025-02-02T16:00:00.000Z",
"type": "activity/inbox_message_sent",
"message": {
"id": "1CLJt2vaqYGBWV8Nxyv4H2",
"type": "email_message"
}
},
{
"id": "1CLJt2vX7oFtsko2YZjEXP",
"occurred_at": "2025-02-01T16:00:00.000Z",
"type": "activity/inbox_message_sent",
"message": {
"id": "1CLJt2vVdW4BRTrtNoFhpj",
"type": "email_message"
}
},
{
"id": "1CLJt2vSeuekWszc3GJeRR",
"occurred_at": "2025-02-01T16:00:00.000Z",
"type": "activity/meeting_held",
"meeting": {
"id": "1CLJt2vLTLeGnzmgfuKwW2",
"type": "meeting"
}
},
{
"id": "1CLJt2vRQzeeyJYpZnuhqY",
"occurred_at": "2025-01-31T16:00:00.000Z",
"type": "activity/meeting_scheduled",
"meeting": {
"id": "1CLJt2vLTLeGnzmgfuKwW2",
"type": "meeting"
}
},
{
"id": "1CLJt2vQfr3oFA5kUufwVD",
"occurred_at": "2025-01-31T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vNSQFE4igYEFxeSE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vPvhSwX1cgQ2SB8t",
"occurred_at": "2025-01-31T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vMSsSkRrj7T5eHy8",
"type": "item",
"collection": {
"id": "1CLJt2uco2zG6pdjxS37sg",
"type": "collection",
"ref": "organizations"
}
}
},
{
"id": "1CLJt2vJUH3KXGrq7YhEZp",
"occurred_at": "2025-01-30T16:00:00.000Z",
"type": "activity/form_submitted",
"item": {
"id": "1CLJt2vFVgdtcgzYn1kBAW",
"type": "item",
"collection": {
"id": "1CLJt2vFk4qWXQUuUJpmHH",
"type": "collection",
"ref": "test_collection_114"
}
}
},
{
"id": "1CLJt2vHj8STo8Pm2fTUDV",
"occurred_at": "2025-01-30T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vFVgdtcgzYn1kBAW",
"type": "item",
"collection": {
"id": "1CLJt2vFk4qWXQUuUJpmHH",
"type": "collection",
"ref": "test_collection_114"
}
}
}
],
"meta": {
"cursors": {
"next": "eyJpZCI6IjFDTEp0MnZIajhTVG84UG0yZlRVRFYiLCJkaXJlY3Rpb24iOiJmb3J3YXJkIn0"
}
}
}Returns a list of activities.
import Moonbase from '@moonbaseai/sdk';
const client = new Moonbase({
apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const activity of client.activities.list()) {
console.log(activity);
}{
"type": "list",
"data": [
{
"id": "1CLJt2vz9X6Nwj5vGfMMFx",
"occurred_at": "2025-02-13T16:00:00.000Z",
"type": "activity/program_message_unsubscribed",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"email": "[email protected]"
},
{
"id": "1CLJt2vxfDtfVS9n6tspZJ",
"occurred_at": "2025-02-12T16:00:00.000Z",
"type": "activity/program_message_shielded",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"reason_code": "person_previously_unsubscribed"
},
{
"id": "1CLJt2vwRJtZwrhzdRUsyR",
"occurred_at": "2025-02-11T16:00:00.000Z",
"type": "activity/program_message_failed",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"reason_code": "message_contained_virus"
},
{
"id": "1CLJt2vvBPtUQHGD9x5wPY",
"occurred_at": "2025-02-10T16:00:00.000Z",
"type": "activity/program_message_complained",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vtwUtNrhpRgUgzof",
"occurred_at": "2025-02-09T16:00:00.000Z",
"type": "activity/program_message_bounced",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"bounced_recipient_emails": [
"[email protected]"
],
"bounce_type": "Permanent"
},
{
"id": "1CLJt2vshZtHK8NeD1J4Dn",
"occurred_at": "2025-02-08T16:00:00.000Z",
"type": "activity/program_message_clicked",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"link_url_unsafe": "https://google.com/•••",
"link_text": "hi"
},
{
"id": "1CLJt2vrTetBmYvrjXu7du",
"occurred_at": "2025-02-07T16:00:00.000Z",
"type": "activity/program_message_opened",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vqDjt6DyV5G4WB42",
"occurred_at": "2025-02-06T16:00:00.000Z",
"type": "activity/program_message_sent",
"program_message": {
"id": "1CLJt2vpyMgUKFziZmRawF",
"type": "program_message"
},
"recipient": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"recipient_emails": [
"[email protected]"
]
},
{
"id": "1CLJt2vkkrGws6gekm5ax4",
"occurred_at": "2025-02-04T15:00:00.000Z",
"type": "activity/call_occurred",
"call": {
"id": "1CLJt2vfoCGZgnuWrsVpcY",
"type": "call"
}
},
{
"id": "1CLJt2vk1hg68xDafsqpbj",
"occurred_at": "2025-02-04T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vimnfzbNmoCQSt1r",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vi2e58sEJj7XD7fX",
"occurred_at": "2025-02-04T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vgnj53Kerwe3pB5e",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vf43fhxeSSmzG4GD",
"occurred_at": "2025-02-03T16:00:00.000Z",
"type": "activity/note_created",
"note": {
"id": "1CLJt2veofU63vx65hBU9S",
"type": "note"
},
"related_item": {
"id": "1CLJt2v84CdKMEKqwBNXfE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
},
"related_meeting": null
},
{
"id": "1CLJt2vcKqTtxn4X8kPayg",
"occurred_at": "2025-02-02T16:00:00.000Z",
"type": "activity/inbox_message_sent",
"message": {
"id": "1CLJt2vaqYGBWV8Nxyv4H2",
"type": "email_message"
}
},
{
"id": "1CLJt2vX7oFtsko2YZjEXP",
"occurred_at": "2025-02-01T16:00:00.000Z",
"type": "activity/inbox_message_sent",
"message": {
"id": "1CLJt2vVdW4BRTrtNoFhpj",
"type": "email_message"
}
},
{
"id": "1CLJt2vSeuekWszc3GJeRR",
"occurred_at": "2025-02-01T16:00:00.000Z",
"type": "activity/meeting_held",
"meeting": {
"id": "1CLJt2vLTLeGnzmgfuKwW2",
"type": "meeting"
}
},
{
"id": "1CLJt2vRQzeeyJYpZnuhqY",
"occurred_at": "2025-01-31T16:00:00.000Z",
"type": "activity/meeting_scheduled",
"meeting": {
"id": "1CLJt2vLTLeGnzmgfuKwW2",
"type": "meeting"
}
},
{
"id": "1CLJt2vQfr3oFA5kUufwVD",
"occurred_at": "2025-01-31T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vNSQFE4igYEFxeSE",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
},
{
"id": "1CLJt2vPvhSwX1cgQ2SB8t",
"occurred_at": "2025-01-31T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vMSsSkRrj7T5eHy8",
"type": "item",
"collection": {
"id": "1CLJt2uco2zG6pdjxS37sg",
"type": "collection",
"ref": "organizations"
}
}
},
{
"id": "1CLJt2vJUH3KXGrq7YhEZp",
"occurred_at": "2025-01-30T16:00:00.000Z",
"type": "activity/form_submitted",
"item": {
"id": "1CLJt2vFVgdtcgzYn1kBAW",
"type": "item",
"collection": {
"id": "1CLJt2vFk4qWXQUuUJpmHH",
"type": "collection",
"ref": "test_collection_114"
}
}
},
{
"id": "1CLJt2vHj8STo8Pm2fTUDV",
"occurred_at": "2025-01-30T15:59:55.000Z",
"type": "activity/item_created",
"item": {
"id": "1CLJt2vFVgdtcgzYn1kBAW",
"type": "item",
"collection": {
"id": "1CLJt2vFk4qWXQUuUJpmHH",
"type": "collection",
"ref": "test_collection_114"
}
}
}
],
"meta": {
"cursors": {
"next": "eyJpZCI6IjFDTEp0MnZIajhTVG84UG0yZlRVRFYiLCJkaXJlY3Rpb24iOiJmb3J3YXJkIn0"
}
}
}Your Moonbase API key.
When specified, returns results starting immediately before the item identified by this cursor. Use the cursor value from the response's metadata to fetch the previous page of results.
When specified, returns results starting immediately after the item identified by this cursor. Use the cursor value from the previous response's metadata to fetch the next page of results.
Maximum number of items to return per page. Must be between 1 and 100. Defaults to 20 if not specified.
1 <= x <= 100Filter activities by type, date, or item.
Show child attributes
Successful response.
A set of results using cursor-based pagination.
"list"An array of Activity items.
The Activity object represents a specific event that has occurred, such as a meeting being scheduled or a form being submitted.
Activities are polymorphic; the type field indicates the specific activity that occurred, and the object will contain a property with a matching name that holds the details of that event. For example, an activity/meeting_held activity will contain a meeting property.
Show child attributes
Metadata about the pagination, including the cursors pointing to the previous and next pages.
Show child attributes