For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
  • API Reference
      • GETList workflows
      • POSTCreate a workflow
      • POSTFilter workflows
      • GETGet latest workflow draft
      • DELDelete workflow
      • PATCHUpdate latest workflow draft
      • GETList workflow versions
      • POSTCreate workflow version
      • GETGet workflow version
      • PATCHUpdate workflow version
      • POSTDeploy workflow version
      • DELUndeploy workflow
      • POSTValidate workflow
  • Reference
    • Filters API Reference
LogoLogo
DiscordPlatform
API ReferenceWorkflows

Create a workflow

POST
https://api.respan.ai/api/workflows/
POST
/api/workflows/
$curl -X POST https://api.respan.ai/api/workflows/ \
> -H "Authorization: Bearer sk_live_xxxxx" \
> -H "Content-Type: application/json" \
> -d '{
> "type": "monitors",
> "name": "High error rate alert",
> "description": "Alert when error rate rises above 5% over 10 minutes.",
> "trigger_event_type": "request_log",
> "tasks": [
> {
> "type": "aggregation",
> "id": "monitor-agg",
> "next": "monitor-threshold",
> "config": {
> "time_step_minutes": 10
> }
> },
> {
> "type": "condition",
> "id": "monitor-threshold",
> "next": "monitor-notify",
> "config": {
> "time_step_minutes": 10
> }
> },
> {
> "type": "notification",
> "id": "monitor-notify",
> "next": "monitor-end",
> "config": {
> "time_step_minutes": 10
> }
> }
> ]
>}'
1{
2 "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
3 "workflow_id": "high-error-rate-alert-001",
4 "version": 1,
5 "name": "High error rate alert",
6 "description": "Alert when error rate rises above 5% over 10 minutes.",
7 "type": "monitors",
8 "trigger_event_type": "request_log",
9 "tasks": [
10 {}
11 ],
12 "is_enabled": true,
13 "is_read_only": false,
14 "created_at": "2024-01-15T09:30:00Z",
15 "updated_at": "2024-01-15T09:30:00Z"
16}

Create a workflow. Set type to automations, monitors, or evaluators to specify the workflow kind.

Was this page helpful?
Previous

Filter workflows

Next
Built with

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY.

Request

This endpoint expects an object.
typeenumRequired
Workflow type.
Allowed values:
workflow_idstringOptional
Optional workflow ID. Omit to let the server generate one.
namestringOptional
descriptionstring or nullOptional
trigger_event_typeenum or nullOptional
is_starredbooleanOptional
taskslist of objectsOptional
Workflow task definitions. Monitor tasks are typically generated by the monitor editor.

Response

Workflow created successfully
idstring
workflow_idstring
versioninteger
namestring
descriptionstring or null
typeenum
Allowed values:
trigger_event_typestring or null
taskslist of maps from strings to any
is_enabledboolean
is_read_onlyboolean
created_atdatetime
updated_atdatetime

Errors

401
Unauthorized Error