Workflow triggers API
This page documents the 15 gateway endpoints tagged workflow triggers in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.
| Method | Path | Summary |
|---|---|---|
| GET | /v1/triggers/list | List workflow triggers |
| GET | /v1/triggers/info | Read one trigger |
| GET | /v1/triggers/fires | Read a trigger's fire history |
| GET | /v1/triggers/event_types | List the gateway events a trigger can subscribe to |
| POST | /v1/triggers/new | Create a trigger |
| POST | /v1/triggers/update | Replace a trigger's settings |
| POST | /v1/triggers/delete | Delete a trigger |
| POST | /v1/triggers/enable | Turn a trigger on |
| POST | /v1/triggers/disable | Turn a trigger off |
| POST | /v1/triggers/rotate_secret | Rotate a webhook trigger's signing secret |
| POST | /v1/triggers/test | Queue a test fire |
| POST | /v1/triggers/webhook/{trigger_id} | Receive a signed webhook delivery |
| POST | /v1/triggers/chat | Send a message to a chat trigger |
| GET | /v1/triggers/form/schema | Read a form trigger's fields |
| POST | /v1/triggers/form/submit | Submit a form trigger |
Endpoints
GET /v1/triggers/list
List workflow triggers
List the triggers the caller may see, the webhooks, schedules, gateway events, chats and forms that start a saved workflow, with the workflow version each starts and whether it is on. Owners, members of a team or organization trigger's team or organization, proxy admins and admin viewers may see a trigger. Nothing changes. Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#who-can-do-what)
Example request:
curl -X GET "http://localhost:4000/v1/triggers/list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The triggers the caller may see | application/json TriggerPage |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
triggers | array of TriggerView | Yes | Triggers |
GET /v1/triggers/info
Read one trigger
Read one trigger with its source settings, whether it is on and why it was switched off, and the last characters of its signing secret. The same people who may list it may read it, otherwise it answers 404. Nothing changes. Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers)
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
trigger_id | query | string | Yes |
Example request:
curl -X GET "http://localhost:4000/v1/triggers/info?trigger_id=trigger_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The trigger | application/json TriggerView |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
name | string | Yes | Name |
description | string or null | Yes | Description |
kind | enum: "webhook", "cron", "event", "chat", "form" | Yes | Kind |
source | WebhookSource or CronSource or EventSource or ChatSource or FormSource or null | Yes | Source |
definition_id | string | Yes | Definition Id |
definition_version | integer | Yes | Definition Version |
enabled | boolean | Yes | Enabled |
disabled_reason | string or null | Yes | Disabled Reason |
visibility | enum: "private", "team", "org" | Yes | Visibility |
event_reach | enum: "owner", "org", "proxy" | Yes | Event Reach |
owner_user_id | string or null | Yes | Owner User Id |
owner_team_id | string or null | Yes | Owner Team Id |
actor_user_id | string or null | Yes | Actor User Id |
run_budget_usd | number or null | Yes | Run Budget Usd |
max_fires_per_minute | integer | Yes | Max Fires Per Minute |
input_mapping | object or null | Yes | Input Mapping |
next_fire_at | string or null | Yes | Next Fire At |
secret_hint | string or null | Yes | Secret Hint |
webhook_url | string or null | Yes | Webhook Url |
consecutive_failures | integer | Yes | Consecutive Failures |
revision | integer | Yes | Revision |
created_at | string | Yes | Created At |
updated_at | string | Yes | Updated At |
GET /v1/triggers/fires
Read a trigger's fire history
Read a trigger's fire history, newest first: when each fire arrived, whether it started a run, the run id and
why a fire was refused. The trigger's owner, its team admins and proxy admins may call it, plus admin viewers for
reading. Payloads are never shown, and nothing changes.
Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#failures-and-auto-disable)
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
trigger_id | query | string | Yes | |
page | query | integer | No |
Example request:
curl -X GET "http://localhost:4000/v1/triggers/fires?trigger_id=trigger_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of fires, newest first | application/json FirePage |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
fires | array of FireView | Yes | Fires |
page | integer | Yes | Page |
GET /v1/triggers/event_types
List the gateway events a trigger can subscribe to
List every gateway event an event trigger may subscribe to, such as a key going over its budget, with the shape of the filter each one accepts. Any key may call it, and nothing changes. Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#gateway-events)
Example request:
curl -X GET "http://localhost:4000/v1/triggers/event_types" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The event types and their filters | application/json EventTypes |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
event_types | array of EventTypeView | Yes | Event Types |
POST /v1/triggers/new
Create a trigger
Create a trigger that starts a saved workflow when a webhook arrives, a schedule comes due, a gateway event
happens, or someone chats or submits a form. Roles that can write may create one, and the run uses the key given
as actor_key. A webhook trigger's signing secret is returned once, here, and never again. The creation is
written to the audit log. Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#create-a-trigger)
Request body (application/json, schema TriggerFields):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name |
description | string or null | No | Description |
source | WebhookSource or CronSource or EventSource or ChatSource or FormSource | Yes | Source |
definition_id | string | Yes | Definition Id |
definition_version | integer | Yes | Definition Version |
visibility | enum: "private", "team", "org" | No | Visibility |
owner_team_id | string or null | No | Owner Team Id |
event_reach | enum: "owner", "org", "proxy" | No | Event Reach |
actor_key | string or null | No | Actor Key |
run_budget_usd | number or null | No | Run Budget Usd |
max_fires_per_minute | integer | No | Max Fires Per Minute |
input_mapping | object or null | No | Input Mapping |
provider_secret | string or null | No | The signing secret Slack or the Teams security token, write only |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/new" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"source": "string",
"definition_id": "definition_id-123",
"definition_version": 1
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The new trigger, with a webhook's signing secret shown this once. A Slack or Teams trigger keeps the secret pasted as provider_secret and answers signing_secret null | application/json TriggerCreated |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 409 | The object already exists or is in a state that does not allow this change | application/json ErrorDetail |
| 422 | The trigger cannot be created as sent | application/json ErrorDetail |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
trigger | TriggerView | Yes | |
signing_secret | string or null | Yes | Signing Secret |
POST /v1/triggers/update
Replace a trigger's settings
Replace a trigger's settings, for example to point it at a newer workflow version. Roles that can write may
change triggers they manage, and a webhook, cron or event trigger then runs as the editor's own key. Its kind
and signing secret do not change here. The change is written to the audit log.
Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#who-can-do-what)
Request body (application/json, schema UpdateTrigger):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name |
description | string or null | No | Description |
source | WebhookSource or CronSource or EventSource or ChatSource or FormSource | Yes | Source |
definition_id | string | Yes | Definition Id |
definition_version | integer | Yes | Definition Version |
visibility | enum: "private", "team", "org" | No | Visibility |
owner_team_id | string or null | No | Owner Team Id |
event_reach | enum: "owner", "org", "proxy" | No | Event Reach |
actor_key | string or null | No | Actor Key |
run_budget_usd | number or null | No | Run Budget Usd |
max_fires_per_minute | integer | No | Max Fires Per Minute |
input_mapping | object or null | No | Input Mapping |
provider_secret | string or null | No | The signing secret Slack or the Teams security token, write only |
trigger_id | string | Yes | Trigger Id |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/update" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"trigger_id": "trg_01J...",
"name": "support tickets",
"source": {
"kind": "webhook"
},
"definition_id": "def-support-triage",
"definition_version": 3,
"actor_key": "sk-...",
"run_budget_usd": 2
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The trigger after the change | application/json TriggerView |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 409 | The object already exists or is in a state that does not allow this change | application/json ErrorDetail |
| 422 | The change is not allowed through update | application/json ErrorDetail |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
name | string | Yes | Name |
description | string or null | Yes | Description |
kind | enum: "webhook", "cron", "event", "chat", "form" | Yes | Kind |
source | WebhookSource or CronSource or EventSource or ChatSource or FormSource or null | Yes | Source |
definition_id | string | Yes | Definition Id |
definition_version | integer | Yes | Definition Version |
enabled | boolean | Yes | Enabled |
disabled_reason | string or null | Yes | Disabled Reason |
visibility | enum: "private", "team", "org" | Yes | Visibility |
event_reach | enum: "owner", "org", "proxy" | Yes | Event Reach |
owner_user_id | string or null | Yes | Owner User Id |
owner_team_id | string or null | Yes | Owner Team Id |
actor_user_id | string or null | Yes | Actor User Id |
run_budget_usd | number or null | Yes | Run Budget Usd |
max_fires_per_minute | integer | Yes | Max Fires Per Minute |
input_mapping | object or null | Yes | Input Mapping |
next_fire_at | string or null | Yes | Next Fire At |
secret_hint | string or null | Yes | Secret Hint |
webhook_url | string or null | Yes | Webhook Url |
consecutive_failures | integer | Yes | Consecutive Failures |
revision | integer | Yes | Revision |
created_at | string | Yes | Created At |
updated_at | string | Yes | Updated At |
POST /v1/triggers/delete
Delete a trigger
Delete a trigger and its fire history, so it never fires again. Roles that can write may delete triggers they
manage. Runs it already started keep going, and the deletion is written to the audit log.
Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#who-can-do-what)
Request body (application/json, schema TriggerRef):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/delete" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"trigger_id": "trg_01J..."
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The id of the deleted trigger | application/json TriggerRef |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
POST /v1/triggers/enable
Turn a trigger on
Turn a trigger back on, for example after it was switched off for repeated failures. For a webhook, cron or
event trigger only the user whose key it runs as or a proxy admin may. Its failure count and disabled reason
clear, a cron trigger's next fire is computed from now, and the change is written to the audit log.
Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#failures-and-auto-disable)
Request body (application/json, schema TriggerRef):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/enable" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"trigger_id": "trg_01J..."
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The trigger, on again | application/json TriggerView |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 409 | The object already exists or is in a state that does not allow this change | application/json ErrorDetail |
| 422 | A field failed validation and the detail names it | application/json ErrorDetail |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
name | string | Yes | Name |
description | string or null | Yes | Description |
kind | enum: "webhook", "cron", "event", "chat", "form" | Yes | Kind |
source | WebhookSource or CronSource or EventSource or ChatSource or FormSource or null | Yes | Source |
definition_id | string | Yes | Definition Id |
definition_version | integer | Yes | Definition Version |
enabled | boolean | Yes | Enabled |
disabled_reason | string or null | Yes | Disabled Reason |
visibility | enum: "private", "team", "org" | Yes | Visibility |
event_reach | enum: "owner", "org", "proxy" | Yes | Event Reach |
owner_user_id | string or null | Yes | Owner User Id |
owner_team_id | string or null | Yes | Owner Team Id |
actor_user_id | string or null | Yes | Actor User Id |
run_budget_usd | number or null | Yes | Run Budget Usd |
max_fires_per_minute | integer | Yes | Max Fires Per Minute |
input_mapping | object or null | Yes | Input Mapping |
next_fire_at | string or null | Yes | Next Fire At |
secret_hint | string or null | Yes | Secret Hint |
webhook_url | string or null | Yes | Webhook Url |
consecutive_failures | integer | Yes | Consecutive Failures |
revision | integer | Yes | Revision |
created_at | string | Yes | Created At |
updated_at | string | Yes | Updated At |
POST /v1/triggers/disable
Turn a trigger off
Stop a trigger from firing until it is turned on again. Roles that can write may disable triggers they
manage. Fires already queued are refused when the dispatcher reaches them, and the change is written to the
audit log. Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#failures-and-auto-disable)
Request body (application/json, schema TriggerRef):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/disable" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"trigger_id": "trg_01J..."
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The trigger, now off | application/json TriggerView |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
name | string | Yes | Name |
description | string or null | Yes | Description |
kind | enum: "webhook", "cron", "event", "chat", "form" | Yes | Kind |
source | WebhookSource or CronSource or EventSource or ChatSource or FormSource or null | Yes | Source |
definition_id | string | Yes | Definition Id |
definition_version | integer | Yes | Definition Version |
enabled | boolean | Yes | Enabled |
disabled_reason | string or null | Yes | Disabled Reason |
visibility | enum: "private", "team", "org" | Yes | Visibility |
event_reach | enum: "owner", "org", "proxy" | Yes | Event Reach |
owner_user_id | string or null | Yes | Owner User Id |
owner_team_id | string or null | Yes | Owner Team Id |
actor_user_id | string or null | Yes | Actor User Id |
run_budget_usd | number or null | Yes | Run Budget Usd |
max_fires_per_minute | integer | Yes | Max Fires Per Minute |
input_mapping | object or null | Yes | Input Mapping |
next_fire_at | string or null | Yes | Next Fire At |
secret_hint | string or null | Yes | Secret Hint |
webhook_url | string or null | Yes | Webhook Url |
consecutive_failures | integer | Yes | Consecutive Failures |
revision | integer | Yes | Revision |
created_at | string | Yes | Created At |
updated_at | string | Yes | Updated At |
POST /v1/triggers/rotate_secret
Rotate a webhook trigger's signing secret
Issue a new signing secret for a webhook trigger, returned once, for example after the old one leaked. Only
the user whose key the trigger runs as or a proxy admin may. The old secret keeps verifying for
grace_seconds so the sender can switch over, and the rotation is written to the audit log. A Slack or
Teams trigger takes the new secret from that service as provider_secret instead.
Docs (https://docs.spanway.ai/docs/proxy/workflow_service_triggers#secrets)
Request body (application/json, schema RotateSecret):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
grace_seconds | integer | No | Grace Seconds |
provider_secret | string or null | No | The new Slack signing secret or Teams security token, for those triggers |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/rotate_secret" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"trigger_id": "trigger_id-123"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The new secret, shown this once, and when the old one stops verifying. A Slack or Teams trigger stores the pasted provider_secret instead and answers signing_secret null | application/json SecretRotated |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 422 | The trigger has no secret to rotate, or the provider_secret does not fit | application/json ErrorDetail |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
signing_secret | string or null | Yes | Signing Secret |
secret_hint | string | Yes | Secret Hint |
previous_secret_expires_at | string or null | Yes | Previous Secret Expires At |
POST /v1/triggers/test
Queue a test fire
Queue a fire with a sample payload to check a trigger end to end. It goes through the same dispatcher, key
and approval checks as a real fire and counts toward the trigger's per-minute limit. For a webhook, cron or
event trigger only the user whose key it runs as or a proxy admin may, and the test is written to the audit log.
Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#who-can-do-what)
Request body (application/json, schema SampleFire):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
payload | object | No | Payload |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/test" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"trigger_id": "trg_01J...",
"payload": {
"ticket": {
"title": "Printer on fire"
}
}
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The queued test fire | application/json FireAccepted |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 409 | The object already exists or is in a state that does not allow this change | application/json ErrorDetail |
| 413 | The body is larger than the gateway accepts | application/json ErrorDetail |
| 422 | A field failed validation and the detail names it | application/json ErrorDetail |
| 429 | A rate or concurrency limit was reached, retry after Retry-After seconds | application/json ErrorDetail |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
fire_id | string | Yes | Fire Id |
status | enum: "pending", "starting", "started", "skipped", "refused", "failed" | Yes | Status |
run_id | string or null | No | Run Id |
POST /v1/triggers/webhook/{trigger_id}
Receive a signed webhook delivery
Receive a Standard Webhooks or X-Hub-Signature-256 delivery, or an event from Slack, Microsoft Teams,
Microsoft Graph (Outlook mail and calendar), Gmail over Pub/Sub push or Google Calendar. The signature is the
only credential, Slack's and Graph's setup checks are answered, a connected service's sender and place must be
in the trigger's access mapping, a replayed delivery returns the original fire, and the run starts in the
background. Docs (https://docs.spanway.ai/docs/proxy/workflow_service_triggers)
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
trigger_id | path | string | Yes |
Request body (application/json, object):
Example request:
curl -X POST "http://localhost:4000/v1/triggers/webhook/trigger_id-123" \
-H "Content-Type: application/json" \
-d '{}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The fire was accepted, a replayed delivery returned its original fire, or a connected service's setup check or event was answered. Slack's url_verification gets its challenge back, Microsoft Teams gets a message reply, Microsoft Graph's validationToken is echoed as text/plain, and a Slack or Google Calendar event the trigger ignores gets an empty 200 | application/json FireAccepted or SlackChallengeAnswer or TeamsMessageReply |
| 202 | A Microsoft Graph notification batch was accepted, or Graph sent a lifecycle notice or a change the trigger ignores. The body is empty | |
| 204 | A verified ping delivery, acknowledged without starting a run | |
| 400 | The signature verified but the body is not what the sender sends, or a Standard Webhooks body is not a JSON object | application/json object |
| 401 | Missing or invalid webhook signature, or the trigger id is unknown or the trigger is off | application/json object |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 413 | The body is larger than the trigger allows, or has no Content-Length | application/json object |
| 422 | Validation Error | application/json HTTPValidationError |
| 429 | The gateway, the sender's address or the trigger fired more often than its per-minute limit | application/json object |
POST /v1/triggers/chat
Send a message to a chat trigger
Send a message to a chat trigger. The run acts as your own key, and with wait the reply carries the run's
step outputs when it finishes within the trigger's wait window.
Request body (application/json, schema ChatRequest):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
message | string | Yes | Message |
wait | boolean | No | Wait |
run_as_key | string or null | No | Run As Key |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/chat" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"trigger_id": "trg-chat",
"message": "Summarize yesterday'\''s incidents",
"wait": true
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful response | application/json ChatReply |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 409 | The object already exists or is in a state that does not allow this change | application/json ErrorDetail |
| 422 | A field failed validation and the detail names it | application/json ErrorDetail |
| 429 | A rate or concurrency limit was reached, retry after Retry-After seconds | application/json ErrorDetail |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
fire_id | string | Yes | Fire Id |
status | enum: "pending", "starting", "started", "skipped", "refused", "failed" or enum: "completed", "running", "failed", "cancelled" | Yes | Status |
run_id | string or null | Yes | Run Id |
outputs | object | No | Outputs |
GET /v1/triggers/form/schema
Read a form trigger's fields
The title and fields of a form trigger, so a client can render the form before submitting it. Docs (https://docs.spanway.ai/docs/proxy/workflow_triggers#chat-and-forms)
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
trigger_id | query | string | Yes |
Example request:
curl -X GET "http://localhost:4000/v1/triggers/form/schema?trigger_id=trigger_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful response | application/json FormSchema |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
title | string | Yes | Title |
fields | array of TextField or LongTextField or NumberField or SelectField or BooleanField | Yes | Fields |
POST /v1/triggers/form/submit
Submit a form trigger
Submit a form trigger. Values are checked against the form's fields, and the run acts as your own key.
Request body (application/json, schema FormSubmission):
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | string | Yes | Trigger Id |
values | object | Yes | Values |
run_as_key | string or null | No | Run As Key |
Example request:
curl -X POST "http://localhost:4000/v1/triggers/form/submit" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"trigger_id": "trg_01K...",
"values": {
"service": "checkout"
}
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful response | application/json ChatReply |
| 401 | No valid key or Admin UI session was presented | application/json ErrorDetail |
| 403 | The key's role, grants or license do not allow this action | application/json ErrorDetail |
| 404 | No object with that id is visible to the caller | application/json ErrorDetail |
| 409 | The object already exists or is in a state that does not allow this change | application/json ErrorDetail |
| 422 | A field failed validation and the detail names it | application/json ErrorDetail |
| 429 | A rate or concurrency limit was reached, retry after Retry-After seconds | application/json ErrorDetail |
| 500 | The gateway hit an internal error, usually the database is not connected | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
fire_id | string | Yes | Fire Id |
status | enum: "pending", "starting", "started", "skipped", "refused", "failed" or enum: "completed", "running", "failed", "cancelled" | Yes | Status |
run_id | string or null | Yes | Run Id |
outputs | object | No | Outputs |