For the complete documentation index, see llms.txt. This page is also available as Markdown.

Automations

Endpoints related to DM automations, which send a direct message in response to a comment or message on a connected social account.

List DM automations

get

Lists the current user's DM automations, ordered by creation time (most recent first). Supports cursor-based pagination.

Authorizations
blotato-api-keystringRequired
Query parameters
limitinteger · min: 1 · max: 250Optional

Maximum number of DM automations to return. Defaults to 50.

Default: 50
cursorstringOptional

Opaque cursor returned by a previous call. Pass it to fetch the next page.

Responses
200

Default Response

application/json
cursorstringOptional

Cursor for the next page. Absent when there are no more DM automations.

get/v2/dm-automations
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"
}

Create a DM automation

post

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.

Authorizations
blotato-api-keystringRequired
Body
accountIdstringRequired
dmMessagestring · min: 1 · max: 640Required
isActivebooleanOptional
namestring · min: 1 · max: 60Required
platformstring · enumRequiredPossible values:
targetone ofRequired
or
triggerone of · nullableOptional
or
Responses
201

Default Response

application/json
post/v2/dm-automations
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"
    }
  }
}

Get a DM automation

get

Fetches a single DM automation by id, including its trigger and the message it sends.

Authorizations
blotato-api-keystringRequired
Path parameters
idstringRequired
Responses
200

Default Response

application/json
get/v2/dm-automations/{id}
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"
    }
  }
}

Delete a DM automation

delete

Archives a DM automation so its trigger stops listening and it no longer fires. Runs already in flight are unaffected.

Authorizations
blotato-api-keystringRequired
Path parameters
idstringRequired
Responses
200

Default Response

application/json
delete/v2/dm-automations/{id}
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"
    }
  }
}

Update a DM automation

patch

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.

Authorizations
blotato-api-keystringRequired
Path parameters
idstringRequired
Body
Responses
200

Default Response

application/json
patch/v2/dm-automations/{id}
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"
    }
  }
}

List DM automation runs

get

Lists the execution runs of a single DM automation, ordered by start time (most recent first). Supports cursor-based pagination.

Authorizations
blotato-api-keystringRequired
Path parameters
idstringRequired
Query parameters
limitinteger · min: 1 · max: 250Optional

Maximum number of execution runs to return. Defaults to 50.

Default: 50
cursorstringOptional

Opaque cursor returned by a previous call. Pass it to fetch the next page.

Responses
200

Default Response

application/json
cursorstringOptional

Cursor for the next page. Absent when there are no more runs.

get/v2/dm-automations/{id}/runs
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"
}

List DM automation logs

get

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.

Authorizations
blotato-api-keystringRequired
Path parameters
idstringRequired
Query parameters
flowRunIdstringOptional

Only return logs belonging to this execution run. Omit to return logs across every run of the automation.

limitinteger · min: 1 · max: 250Optional

Maximum number of logs to return. Defaults to 50.

Default: 50
cursorstringOptional

Opaque cursor returned by a previous call. Pass it to fetch the next page.

Responses
200

Default Response

application/json
cursorstringOptional

Cursor for the next page. Absent when there are no more logs.

get/v2/dm-automations/{id}/logs
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"
}

Get DM automation analytics

get

Returns stats for a single DM automation.

Authorizations
blotato-api-keystringRequired
Path parameters
idstringRequired
Responses
200

Default Response

application/json
get/v2/dm-automations/{id}/analytics
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