from engini import Engini
client = Engini() # reads ENGINI_API_KEY
trigger = client.triggers.create(
"monday_item_created", connection_id=12, listen_columns=["status"]
)
client.triggers.enable(trigger.id) # triggers are created disabledimport { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
const trigger = await client.triggers.create({
triggerSlug: "monday_item_created",
connectionId: 12,
listenColumns: ["status"],
});
await client.triggers.enable(trigger.id); // triggers are created disabledengini triggers create monday_item_created --connection 12 --listen statusconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
trigger_slug: '<string>',
application_slug: '<string>',
connection_id: 123,
connection_name: '<string>',
config: '<unknown>',
schedule: {
interval: 123,
start_date: '2023-11-07T05:31:56Z',
start_time: '<string>',
week_days: [123],
time_frames: [{start_hour: '<string>', end_hour: '<string>', every_minutes: 123}],
effective: {interval: 123, clamped: true, min_interval_minutes: 123}
},
poll_interval_minutes: 123,
listen_columns: ['<string>'],
destination_id: 123,
dedupe_window_hours: 123
})
};
fetch('https://api.engini.io/v1/triggers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engini.io/v1/triggers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'trigger_slug' => '<string>',
'application_slug' => '<string>',
'connection_id' => 123,
'connection_name' => '<string>',
'config' => '<unknown>',
'schedule' => [
'interval' => 123,
'start_date' => '2023-11-07T05:31:56Z',
'start_time' => '<string>',
'week_days' => [
123
],
'time_frames' => [
[
'start_hour' => '<string>',
'end_hour' => '<string>',
'every_minutes' => 123
]
],
'effective' => [
'interval' => 123,
'clamped' => true,
'min_interval_minutes' => 123
]
],
'poll_interval_minutes' => 123,
'listen_columns' => [
'<string>'
],
'destination_id' => 123,
'dedupe_window_hours' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/triggers"
payload := strings.NewReader("{\n \"trigger_slug\": \"<string>\",\n \"application_slug\": \"<string>\",\n \"connection_id\": 123,\n \"connection_name\": \"<string>\",\n \"config\": \"<unknown>\",\n \"schedule\": {\n \"interval\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"start_time\": \"<string>\",\n \"week_days\": [\n 123\n ],\n \"time_frames\": [\n {\n \"start_hour\": \"<string>\",\n \"end_hour\": \"<string>\",\n \"every_minutes\": 123\n }\n ],\n \"effective\": {\n \"interval\": 123,\n \"clamped\": true,\n \"min_interval_minutes\": 123\n }\n },\n \"poll_interval_minutes\": 123,\n \"listen_columns\": [\n \"<string>\"\n ],\n \"destination_id\": 123,\n \"dedupe_window_hours\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engini.io/v1/triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trigger_slug\": \"<string>\",\n \"application_slug\": \"<string>\",\n \"connection_id\": 123,\n \"connection_name\": \"<string>\",\n \"config\": \"<unknown>\",\n \"schedule\": {\n \"interval\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"start_time\": \"<string>\",\n \"week_days\": [\n 123\n ],\n \"time_frames\": [\n {\n \"start_hour\": \"<string>\",\n \"end_hour\": \"<string>\",\n \"every_minutes\": 123\n }\n ],\n \"effective\": {\n \"interval\": 123,\n \"clamped\": true,\n \"min_interval_minutes\": 123\n }\n },\n \"poll_interval_minutes\": 123,\n \"listen_columns\": [\n \"<string>\"\n ],\n \"destination_id\": 123,\n \"dedupe_window_hours\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trigger_slug\": \"<string>\",\n \"application_slug\": \"<string>\",\n \"connection_id\": 123,\n \"connection_name\": \"<string>\",\n \"config\": \"<unknown>\",\n \"schedule\": {\n \"interval\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"start_time\": \"<string>\",\n \"week_days\": [\n 123\n ],\n \"time_frames\": [\n {\n \"start_hour\": \"<string>\",\n \"end_hour\": \"<string>\",\n \"every_minutes\": 123\n }\n ],\n \"effective\": {\n \"interval\": 123,\n \"clamped\": true,\n \"min_interval_minutes\": 123\n }\n },\n \"poll_interval_minutes\": 123,\n \"listen_columns\": [\n \"<string>\"\n ],\n \"destination_id\": 123,\n \"dedupe_window_hours\": 123\n}"
response = http.request(request)
puts response.read_body{
"kind": "api",
"status": "enabled",
"id": "<string>",
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"trigger_slug": "<string>",
"connection_id": 123,
"activity_id": 123,
"destination_id": 123,
"dedupe_window_hours": 123,
"status_reason": "max_consecutive_failures",
"blocked_since": "2023-11-07T05:31:56Z",
"last_event_at": "2023-11-07T05:31:56Z",
"last_error_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"next_run_at": "2023-11-07T05:31:56Z",
"subscription_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"config": "<unknown>",
"schedule": {
"frequency": "seconds",
"interval": 123,
"start_date": "2023-11-07T05:31:56Z",
"start_time": "<string>",
"week_days": [
123
],
"time_frames": [
{
"start_hour": "<string>",
"end_hour": "<string>",
"every_minutes": 123
}
],
"effective": {
"frequency": "seconds",
"interval": 123,
"clamped": true,
"min_interval_minutes": 123
}
},
"listen_columns": [
"<string>"
],
"webhook_url": "<string>"
}{
"kind": "api",
"status": "enabled",
"id": "<string>",
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"trigger_slug": "<string>",
"connection_id": 123,
"activity_id": 123,
"destination_id": 123,
"dedupe_window_hours": 123,
"status_reason": "max_consecutive_failures",
"blocked_since": "2023-11-07T05:31:56Z",
"last_event_at": "2023-11-07T05:31:56Z",
"last_error_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"next_run_at": "2023-11-07T05:31:56Z",
"subscription_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"config": "<unknown>",
"schedule": {
"frequency": "seconds",
"interval": 123,
"start_date": "2023-11-07T05:31:56Z",
"start_time": "<string>",
"week_days": [
123
],
"time_frames": [
{
"start_hour": "<string>",
"end_hour": "<string>",
"every_minutes": 123
}
],
"effective": {
"frequency": "seconds",
"interval": 123,
"clamped": true,
"min_interval_minutes": 123
}
},
"listen_columns": [
"<string>"
],
"webhook_url": "<string>"
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Create trigger
Created DISABLED. Enabling is what registers the provider subscription, and that should be a deliberate second act rather than a side effect of describing the trigger you want.
Send an Idempotency-Key header. Agents retry, and without one a create that timed out on the wire but succeeded on the server double-subscribes at the provider - which the provider meters and which delivers every event twice. A retry carrying the same key inside 24h returns the instance the first call made; a retry that arrives while the first is still running answers 409.
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
trigger = client.triggers.create(
"monday_item_created", connection_id=12, listen_columns=["status"]
)
client.triggers.enable(trigger.id) # triggers are created disabledimport { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
const trigger = await client.triggers.create({
triggerSlug: "monday_item_created",
connectionId: 12,
listenColumns: ["status"],
});
await client.triggers.enable(trigger.id); // triggers are created disabledengini triggers create monday_item_created --connection 12 --listen statusconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
trigger_slug: '<string>',
application_slug: '<string>',
connection_id: 123,
connection_name: '<string>',
config: '<unknown>',
schedule: {
interval: 123,
start_date: '2023-11-07T05:31:56Z',
start_time: '<string>',
week_days: [123],
time_frames: [{start_hour: '<string>', end_hour: '<string>', every_minutes: 123}],
effective: {interval: 123, clamped: true, min_interval_minutes: 123}
},
poll_interval_minutes: 123,
listen_columns: ['<string>'],
destination_id: 123,
dedupe_window_hours: 123
})
};
fetch('https://api.engini.io/v1/triggers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engini.io/v1/triggers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'trigger_slug' => '<string>',
'application_slug' => '<string>',
'connection_id' => 123,
'connection_name' => '<string>',
'config' => '<unknown>',
'schedule' => [
'interval' => 123,
'start_date' => '2023-11-07T05:31:56Z',
'start_time' => '<string>',
'week_days' => [
123
],
'time_frames' => [
[
'start_hour' => '<string>',
'end_hour' => '<string>',
'every_minutes' => 123
]
],
'effective' => [
'interval' => 123,
'clamped' => true,
'min_interval_minutes' => 123
]
],
'poll_interval_minutes' => 123,
'listen_columns' => [
'<string>'
],
'destination_id' => 123,
'dedupe_window_hours' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/triggers"
payload := strings.NewReader("{\n \"trigger_slug\": \"<string>\",\n \"application_slug\": \"<string>\",\n \"connection_id\": 123,\n \"connection_name\": \"<string>\",\n \"config\": \"<unknown>\",\n \"schedule\": {\n \"interval\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"start_time\": \"<string>\",\n \"week_days\": [\n 123\n ],\n \"time_frames\": [\n {\n \"start_hour\": \"<string>\",\n \"end_hour\": \"<string>\",\n \"every_minutes\": 123\n }\n ],\n \"effective\": {\n \"interval\": 123,\n \"clamped\": true,\n \"min_interval_minutes\": 123\n }\n },\n \"poll_interval_minutes\": 123,\n \"listen_columns\": [\n \"<string>\"\n ],\n \"destination_id\": 123,\n \"dedupe_window_hours\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engini.io/v1/triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trigger_slug\": \"<string>\",\n \"application_slug\": \"<string>\",\n \"connection_id\": 123,\n \"connection_name\": \"<string>\",\n \"config\": \"<unknown>\",\n \"schedule\": {\n \"interval\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"start_time\": \"<string>\",\n \"week_days\": [\n 123\n ],\n \"time_frames\": [\n {\n \"start_hour\": \"<string>\",\n \"end_hour\": \"<string>\",\n \"every_minutes\": 123\n }\n ],\n \"effective\": {\n \"interval\": 123,\n \"clamped\": true,\n \"min_interval_minutes\": 123\n }\n },\n \"poll_interval_minutes\": 123,\n \"listen_columns\": [\n \"<string>\"\n ],\n \"destination_id\": 123,\n \"dedupe_window_hours\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trigger_slug\": \"<string>\",\n \"application_slug\": \"<string>\",\n \"connection_id\": 123,\n \"connection_name\": \"<string>\",\n \"config\": \"<unknown>\",\n \"schedule\": {\n \"interval\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"start_time\": \"<string>\",\n \"week_days\": [\n 123\n ],\n \"time_frames\": [\n {\n \"start_hour\": \"<string>\",\n \"end_hour\": \"<string>\",\n \"every_minutes\": 123\n }\n ],\n \"effective\": {\n \"interval\": 123,\n \"clamped\": true,\n \"min_interval_minutes\": 123\n }\n },\n \"poll_interval_minutes\": 123,\n \"listen_columns\": [\n \"<string>\"\n ],\n \"destination_id\": 123,\n \"dedupe_window_hours\": 123\n}"
response = http.request(request)
puts response.read_body{
"kind": "api",
"status": "enabled",
"id": "<string>",
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"trigger_slug": "<string>",
"connection_id": 123,
"activity_id": 123,
"destination_id": 123,
"dedupe_window_hours": 123,
"status_reason": "max_consecutive_failures",
"blocked_since": "2023-11-07T05:31:56Z",
"last_event_at": "2023-11-07T05:31:56Z",
"last_error_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"next_run_at": "2023-11-07T05:31:56Z",
"subscription_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"config": "<unknown>",
"schedule": {
"frequency": "seconds",
"interval": 123,
"start_date": "2023-11-07T05:31:56Z",
"start_time": "<string>",
"week_days": [
123
],
"time_frames": [
{
"start_hour": "<string>",
"end_hour": "<string>",
"every_minutes": 123
}
],
"effective": {
"frequency": "seconds",
"interval": 123,
"clamped": true,
"min_interval_minutes": 123
}
},
"listen_columns": [
"<string>"
],
"webhook_url": "<string>"
}{
"kind": "api",
"status": "enabled",
"id": "<string>",
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"trigger_slug": "<string>",
"connection_id": 123,
"activity_id": 123,
"destination_id": 123,
"dedupe_window_hours": 123,
"status_reason": "max_consecutive_failures",
"blocked_since": "2023-11-07T05:31:56Z",
"last_event_at": "2023-11-07T05:31:56Z",
"last_error_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"next_run_at": "2023-11-07T05:31:56Z",
"subscription_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"config": "<unknown>",
"schedule": {
"frequency": "seconds",
"interval": 123,
"start_date": "2023-11-07T05:31:56Z",
"start_time": "<string>",
"week_days": [
123
],
"time_frames": [
{
"start_hour": "<string>",
"end_hour": "<string>",
"every_minutes": 123
}
],
"effective": {
"frequency": "seconds",
"interval": 123,
"clamped": true,
"min_interval_minutes": 123
}
},
"listen_columns": [
"<string>"
],
"webhook_url": "<string>"
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Body
The trigger type, connection, and the schedule/listen-columns/event-type parameter blocks that apply to it.
The request body of POST /v1/triggers - everything you may set when creating a trigger instance.
Sugar for { "frequency": "minute", "interval": N }, so the simple polling case is one field. Ignored when Schedule is also supplied - the explicit block wins rather than the two being merged, because merging would make "which interval did I get" depend on field order.
Response
A previous request with this Idempotency-Key already created this trigger; that instance is returned unchanged.
A trigger instance as the API returns it. status is derived on every read, so it reflects whether the trigger is really capturing right now rather than what was last written.
Why the instance is errored. Null whenever the instance is not blocked - see TriggerStatusReason for the frozen vocabulary and the derivation ORDER.
max_consecutive_failures, activity_limit, manual, subscribe_failed, connection_deleted, trigger_type_removed Where a manual_webhook trigger's caller must POST events - the only delivery flavour with no provider subscription, so without this the caller has no way to learn the endpoint. Null for every other delivery flavour, and null until the trigger's webhook endpoint has been provisioned.