API Endpoint Trigger
Exposes a programmable HTTP endpoint backed by your workflow. Supports multiple HTTP methods, authentication, and synchronous responses — the caller waits for the workflow to finish and receives the result.
Use API Endpoint when:
- You want to build a custom REST API without writing server code
- Callers need a synchronous response from your workflow
- You need to authenticate incoming requests with an API key or bearer token
If callers do not need a synchronous response and you just want to react to events, use Webhook instead.
API Endpoint creates one output handle per HTTP method you enable. For example, if you enable GET and POST, the node produces a GET handle and a POST handle.
Each handle emits an api_request object with this shape:
| Field | Type | Description |
|---|---|---|
body | any | Parsed request body |
headers | object | Request headers |
query | object | URL query parameters |
method | string | HTTP method used |
path | string | Request path |
| Setting | Type | Default | Description |
|---|---|---|---|
path | string | /api | Route suffix. Example: /users |
allowedMethods | multiselect | GET, POST | HTTP methods accepted. Each creates an output handle. |
authType | select | none | Authentication: none, api-key, or bearer-token |
apiKeyLocation | select | header | Where to read the API key: header or query. |
apiKeyName | string | X-API-Key | Header or query param name for the API key. |
authorizationHeaderName | string | Authorization | Header name for the bearer token. |
bearerPrefix | string | Bearer | Prefix stripped from the Authorization header value. |
secret | secret | — | Expected API key or bearer token value. Stored securely. |
parseBodyAs | select | auto | Body parsing: auto, json, text, or form |
responseMode | select | use-workflow-response | Holds the connection until Return fires, or responds 200 immediately. |
defaultStatusCode | number | 200 | Status code for ack-immediately or when no Return fires. |
mockMethod | select | GET | HTTP method to simulate during canvas testing. |
mockPayload | JSON | — | Test body injected during canvas testing. |
mockHeaders | JSON | — | Test headers injected during canvas testing. |
mockQuery | JSON | — | Test query params injected during canvas testing. |
When responseMode is use-workflow-response, you must connect a Return node somewhere in the workflow. Without it, the caller's connection will hang until the timeout.
The value wired into the Return node becomes the HTTP response body. Tensorify serializes it as JSON automatically.
A minimal synchronous API workflow:
API Endpoint (POST) → [your logic] → Return
Build an endpoint that looks up a user and returns their profile:
- Set
pathto/users/lookup - Set
allowedMethodstoPOST - Set
authTypetoapi-key - Add an HTTP Request node connected to the POST handle — it calls your internal user service with
{{ api_request.body.userId }} - Connect the HTTP Request result to a Return node
Test with curl:
curl -X POST https://triggers.tensorify.io/your-endpoint/users/lookup \
-H "X-API-Key: your-secret" \
-H "Content-Type: application/json" \
-d '{"userId": "usr_123"}'
- Multiple methods: Each allowed method creates a separate output handle. You need to route them separately in your workflow if you want different logic per method.
- Timeout: If your workflow takes longer than the configured timeout to produce a Return value, the connection drops and the caller receives a timeout error.
- Auth: The
secretfield is stored encrypted. Never pass it through a workflow variable — it is only used for request validation.
- Return — wire the response value
- Webhook Trigger — fire-and-forget events
- Deploying Workflows — get your endpoint URL
