Automations
Endpoints related to DM automations, which send a direct message in response to a comment or message on a connected social account.
Lists the current user's DM automations, ordered by creation time (most recent first). Supports cursor-based pagination.
Maximum number of DM automations to return. Defaults to 50.
50Opaque cursor returned by a previous call. Pass it to fetch the next page.
Default Response
Cursor for the next page. Absent when there are no more DM automations.
Not found
Default Response
GET /v2/dm-automations HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
"items": [
{
"accountId": "text",
"buttons": [
{
"title": "text",
"type": "url",
"url": "text"
}
],
"createdAt": "text",
"dmMessage": "text",
"emailGate": {
"message": "text"
},
"followGate": {
"buttonTitle": "I'm following",
"message": "text"
},
"id": "text",
"isActive": true,
"name": "text",
"platform": "facebook",
"publishedVersionId": "text",
"target": {
"pageId": "text",
"targetType": "facebook"
},
"trigger": {
"isActive": true,
"keywords": [
"text"
],
"postId": "text",
"type": "comment-received"
},
"updatedAt": "text",
"webhook": {
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"method": "DELETE",
"url": "text"
}
}
],
"cursor": "text"
}Creates a DM automation: when its trigger fires it sends one direct message (text plus up to 3 link buttons). Set followGate (Instagram only) to gate that message behind a follow check, and emailGate to gate it behind the contact replying with an email address. Set webhook to call an external endpoint once the message is sent; its payload carries the run's contact and identifiers.
Default Response
Not found
Validation error
Default Response
POST /v2/dm-automations HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 468
{
"accountId": "text",
"buttons": [
{
"title": "text",
"type": "url",
"url": "text"
}
],
"dmMessage": "text",
"emailGate": {
"message": "text"
},
"followGate": {
"buttonTitle": "I'm following",
"message": "text"
},
"isActive": true,
"name": "text",
"platform": "facebook",
"target": {
"pageId": "text",
"targetType": "facebook"
},
"trigger": {
"isActive": true,
"keywords": [
"text"
],
"postId": "text",
"type": "comment-received"
},
"webhook": {
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"method": "DELETE",
"url": "text"
}
}{
"flow": {
"accountId": "text",
"buttons": [
{
"title": "text",
"type": "url",
"url": "text"
}
],
"createdAt": "text",
"dmMessage": "text",
"emailGate": {
"message": "text"
},
"followGate": {
"buttonTitle": "I'm following",
"message": "text"
},
"id": "text",
"isActive": true,
"name": "text",
"platform": "facebook",
"publishedVersionId": "text",
"target": {
"pageId": "text",
"targetType": "facebook"
},
"trigger": {
"isActive": true,
"keywords": [
"text"
],
"postId": "text",
"type": "comment-received"
},
"updatedAt": "text",
"webhook": {
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"method": "DELETE",
"url": "text"
}
}
}Fetches a single DM automation by id, including its trigger and the message it sends.
Default Response
Not found
Default Response
GET /v2/dm-automations/{id} HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
"flow": {
"accountId": "text",
"buttons": [
{
"title": "text",
"type": "url",
"url": "text"
}
],
"createdAt": "text",
"dmMessage": "text",
"emailGate": {
"message": "text"
},
"followGate": {
"buttonTitle": "I'm following",
"message": "text"
},
"id": "text",
"isActive": true,
"name": "text",
"platform": "facebook",
"publishedVersionId": "text",
"target": {
"pageId": "text",
"targetType": "facebook"
},
"trigger": {
"isActive": true,
"keywords": [
"text"
],
"postId": "text",
"type": "comment-received"
},
"updatedAt": "text",
"webhook": {
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"method": "DELETE",
"url": "text"
}
}
}Archives a DM automation so its trigger stops listening and it no longer fires. Runs already in flight are unaffected.
Default Response
Not found
Default Response
DELETE /v2/dm-automations/{id} HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
"flow": {
"accountId": "text",
"buttons": [
{
"title": "text",
"type": "url",
"url": "text"
}
],
"createdAt": "text",
"dmMessage": "text",
"emailGate": {
"message": "text"
},
"followGate": {
"buttonTitle": "I'm following",
"message": "text"
},
"id": "text",
"isActive": true,
"name": "text",
"platform": "facebook",
"publishedVersionId": "text",
"target": {
"pageId": "text",
"targetType": "facebook"
},
"trigger": {
"isActive": true,
"keywords": [
"text"
],
"postId": "text",
"type": "comment-received"
},
"updatedAt": "text",
"webhook": {
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"method": "DELETE",
"url": "text"
}
}
}Updates a DM automation. Each field present in the patch replaces that field; omitted fields are left unchanged. Pass null for emailGate, followGate, trigger, or webhook to remove it.
Default Response
Not found
Validation error
Default Response
PATCH /v2/dm-automations/{id} HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 386
{
"patch": {
"buttons": [
{
"title": "text",
"type": "url",
"url": "text"
}
],
"dmMessage": "text",
"emailGate": {
"message": "text"
},
"followGate": {
"buttonTitle": "I'm following",
"message": "text"
},
"isActive": true,
"name": "text",
"trigger": {
"isActive": true,
"keywords": [
"text"
],
"postId": "text",
"type": "comment-received"
},
"webhook": {
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"method": "DELETE",
"url": "text"
}
}
}{
"flow": {
"accountId": "text",
"buttons": [
{
"title": "text",
"type": "url",
"url": "text"
}
],
"createdAt": "text",
"dmMessage": "text",
"emailGate": {
"message": "text"
},
"followGate": {
"buttonTitle": "I'm following",
"message": "text"
},
"id": "text",
"isActive": true,
"name": "text",
"platform": "facebook",
"publishedVersionId": "text",
"target": {
"pageId": "text",
"targetType": "facebook"
},
"trigger": {
"isActive": true,
"keywords": [
"text"
],
"postId": "text",
"type": "comment-received"
},
"updatedAt": "text",
"webhook": {
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"method": "DELETE",
"url": "text"
}
}
}Lists the execution runs of a single DM automation, ordered by start time (most recent first). Supports cursor-based pagination.
Maximum number of execution runs to return. Defaults to 50.
50Opaque cursor returned by a previous call. Pass it to fetch the next page.
Default Response
Cursor for the next page. Absent when there are no more runs.
Not found
Default Response
GET /v2/dm-automations/{id}/runs HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
"items": [
{
"contactId": "text",
"createdAt": "text",
"error": {
"code": 1,
"message": "text"
},
"id": "text",
"platform": "facebook",
"status": "completed",
"updatedAt": "text"
}
],
"cursor": "text"
}Lists the execution logs written as a DM automation's runs progress, ordered by creation time (most recent first). Pass flowRunId to narrow the logs to a single run. Supports cursor-based pagination.
Only return logs belonging to this execution run. Omit to return logs across every run of the automation.
Maximum number of logs to return. Defaults to 50.
50Opaque cursor returned by a previous call. Pass it to fetch the next page.
Default Response
Cursor for the next page. Absent when there are no more logs.
Not found
Default Response
GET /v2/dm-automations/{id}/logs HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
"items": [
{
"context": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"createdAt": "text",
"flowRunId": "text",
"id": "text",
"level": "info",
"message": "text",
"nodeId": "text"
}
],
"cursor": "text"
}Returns stats for a single DM automation.
Default Response
Not found
Default Response
GET /v2/dm-automations/{id}/analytics HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
"analytics": {
"completed": 1,
"failed": 1,
"triggered": 1
}
}Last updated