Send Logs
The /send-logs endpoint allows you to view the metadata of your past sends.
The shape of a SendLog is as follows:
type SendLog = {
/** The _id of the send log */
_id: string;
/** The _id of the campaign triggered the send */
campaign_id: string;
/** The unresolved template that was sent */
message: string;
/** The type of send, or the reason it was triggered */
triggeredBy: string;
/** The datetime that the send started being delivered */
startDeliveryAt: string;
/** The number of contacts that were sent to
* Or, if you pass the `group_destinations=list` query param, an array of the cell numbers that were sent to
*/
destinations: number | string[];
};
View a single send log
GET /send-logs/:send_id
View a single send log.
- 🔐 Permissions:
["sendLog.read"]
Request
URL Parameters
| Field | Type | Required | Description |
|---|---|---|---|
send_id | string | ✅ | The _id of the send you want to fetch. You can get a particular send_id from the Sends Report, or by using {{send._id}} in a webhook template |
group_destinations | count | list | ❌ | If you pass group_destinations=count, the destinations field will be the number of contacts that were sent to. If you pass group_destinations=list, the destinations field will be an array of the cell numbers that were sent to. |
Response
Success
200
{
ok: true,
data: SendLog
}
Error
404
{
ok: false,
error: {
code: "resource_not_found",
message: string
}
}
Search send logs
POST /send-logs/search
Search for send logs.
- 🔐 Permissions:
["sendLog.read"]
Request
Body
| Field | Type | Required | Description |
|---|---|---|---|
find.campaign_id | string[] | ❌ | The _id of the campaigns you want to search for. You can get a particular campaign_id from the Campaigns Report, or by using {{campaign._id}} in a webhook template |
find.startDeliveryAt | { $gte: string; $lte: string } | ❌ | The datetime that the send started being delivered. |
options.skip | number | ❌ | The number of records to skip. Defaults to 0. |
options.limit | number | ❌ | The number of records to return. Defaults to ~1000. |
Example
200
{
find: {
campaign_id: ["5f5a1d8d2e0e4c6c8c0c0c0c"],
startDeliveryAt: {
$gte: "2022-01-01T00:00:00.000Z",
$lte: "2022-01-31T23:59:59.999Z",
},
},
options: {
skip: 0,
limit: 1000
},
}
Response
Success
200
{
ok: true,
data: {
total: number
send_logs: SendLog[]
// Your parsed search input, useful to paginate subsequent requests
parsed: Record<string, unknown>
}
}