Skip to main content
POST
/
v1
/
gateway
/
triggers
JavaScript
import Triglit from 'triglit';

const client = new Triglit({
  apiKey: 'My API Key',
});

const trigger = await client.triggers.create({
  config: {},
  name: 'x',
  type: 'schedule',
  workflowVersionId: 'x',
});

console.log(trigger.id);
{
  "id": "trg_abc123def456",
  "tenantId": "tenant_123",
  "workflowVersionId": "wfv_abc123def456",
  "name": "User Registration Webhook",
  "type": "webhook",
  "config": {},
  "isActive": true,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z",
  "subTenantId": "sub_tenant_456"
}

Authorizations

X-API-Key
string
header
required

Chave de API do tenant (publishable key ou secret key)

Headers

X-API-Key
string
required

Chave de API do tenant (publishable key ou secret key)

Body

application/json
workflowVersionId
string
required
Minimum string length: 1
name
string
required
Required string length: 1 - 255
type
enum<string>
required
Available options:
schedule,
webhook
config
object
required

Response

Trigger created successfully

id
string
required

Unique trigger identifier

Example:

"trg_abc123def456"

tenantId
string
required

Tenant identifier

Example:

"tenant_123"

workflowVersionId
string
required

Workflow version identifier

Example:

"wfv_abc123def456"

name
string
required

Trigger name

Example:

"User Registration Webhook"

type
enum<string>
required

Trigger type

Available options:
schedule,
webhook
Example:

"webhook"

config
object
required

Trigger configuration

isActive
boolean
required

Whether the trigger is active

Example:

true

createdAt
string
required

Creation timestamp

Example:

"2024-01-15T10:30:00.000Z"

updatedAt
string
required

Last update timestamp

Example:

"2024-01-15T10:30:00.000Z"

subTenantId
string

Sub-tenant identifier

Example:

"sub_tenant_456"