Buni.aiDocs
API referenceFlows

Register a polling trigger

Registers (or updates, when the pollKey already exists) a polling trigger. Buni.ai calls pollEndpoint with GET every intervalMs, starting straight away.

POST/flows/{projectId}/polling

Registers (or updates, when the pollKey already exists) a polling trigger. Buni.ai calls pollEndpoint with GET every intervalMs, starting straight away. The response may be an array, an object with a data array, or a single object. Each item whose dedupeField value has not been seen before runs the project's flow with the item as its payload.

Requires the flow:trigger scope.

Authorization

AuthorizationBearer <token>

Authorization: Bearer bai_ext_.... Tokens belong to one project and carry scopes: bot:invoke, flow:trigger, automation:trigger.

In: header

Scope: flow:trigger

Path Parameters

projectId*string

The project ID. The token must belong to this project.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/flows/string/polling" \  -H "Content-Type: application/json" \  -d '{    "source": "crm",    "pollKey": "new-leads",    "pollEndpoint": "https://crm.example.com/api/leads?status=new",    "dedupeField": "id",    "authHeader": "Bearer crm_example_token",    "intervalMs": 300000  }'
{  "data": {    "id": "clxa01p0q0001ab12cd34ef70",    "source": "crm",    "pollKey": "new-leads",    "dedupeField": "id",    "pollEndpoint": "https://crm.example.com/api/leads?status=new",    "intervalMs": 300000,    "lastSeenValue": null,    "lastPolledAt": null,    "nextPollAt": null,    "createdAt": "2026-09-24T10:00:00.000Z",    "updatedAt": "2026-09-24T10:00:00.000Z"  }}