API Trigger
Start a workflow from an authenticated HTTP request
The API trigger exposes your workflow as a secure HTTP endpoint. Send JSON data to the endpoint and your workflow processes it immediately. API calls always execute against your latest deployment.
This is a webhook-based trigger. External services or scripts send HTTP requests to start the workflow.
Configuration
Input Format
Enter input format...
Define the JSON input schema accepted by the API endpoint
Add an Input Format field for each parameter. Supported types:
- string — Text values
- number — Numeric values
- boolean — True/false values
- json — JSON objects
- files — File uploads (access via
<api.fieldName[0].url>,<api.fieldName[0].name>, etc.)
Output Reference
| Reference | Type | Description |
|---|---|---|
<api.field> | varies | Field defined in the Input Format |
<api.input> | json | Entire structured request body |
Request Example
curl -X POST \
https://tradinggoose.ai/api/workflows/WORKFLOW_ID/execute \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_KEY' \
-d '{"userId":"demo-user","maxTokens":1024}'Streaming Responses
Enable real-time streaming to receive workflow output as it's generated.
Request Parameters
stream— Set totrueto enable Server-Sent Events (SSE) streamingselectedOutputs— Array of block outputs to stream (e.g.,["agent1.content"])
Example
curl -X POST \
https://tradinggoose.ai/api/workflows/WORKFLOW_ID/execute \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_KEY' \
-d '{"message": "Count to five", "stream": true, "selectedOutputs": ["agent1.content"]}'Response Format
data: {"blockId":"...","chunk":"One"}
data: {"blockId":"...","chunk":", two"}
data: {"event":"done","success":true,"output":{},"metadata":{"duration":610}}
data: [DONE]File Upload Format
{
"documents": [{
"type": "file",
"data": "data:application/pdf;base64,JVBERi0xLjQK...",
"name": "document.pdf",
"mime": "application/pdf"
}]
}A workflow can contain only one API Trigger. Publish a new deployment after changes so the endpoint stays up to date.