The Send API Response job sends an HTTP response back to the caller of an Incoming HTTP Trigger. Use this job to control the response body, content type, status code, and headers returned to the HTTP client.
Properties
The properties for configuring the response are described below.
- Response body (optional; default: Ok)
- Template for the HTTP response body. Supports statement syntax for dynamic values.
- Response content type (optional)
- The content type of the response (for example: application/json, text/plain).
- Response status code (optional)
- The HTTP status code to return (for example: 200, 400, 404).
- Response headers (optional)
- Custom HTTP response headers as key-value pairs. If not set, default headers are used.
Best practices and tips
- Use this job together with Incoming HTTP Trigger to ensure callers receive an explicit response.
- Return a clear status code and body that matches your API contract so integrations are easier to debug.
- Set Response content type explicitly when returning JSON or plain text to avoid ambiguity for the caller.
- Include only the headers you need in Response headers to keep responses predictable.
- Keep the response body focused on the fields the caller actually needs. Smaller, explicit responses are easier to consume and reduce accidental data leakage.
- Use error status codes and response bodies consistently across failure paths so external systems can react predictably when validation or downstream processing fails.
Common response patterns
These patterns are commonly used in API and callback workflows.
200 OK with structured JSON
Use 200 when the request succeeds and you return data.
- Set Response status code to
200. - Set Response content type to
application/json. - Build the response body from workflow context, for example
{{api_response}}.
204 No Content for callbacks
Use 204 when the caller only needs acknowledgement and no payload.
- Set Response status code to
204. - Leave Response body empty.
- Keep the callback path lightweight so acknowledgements are fast.
400 and 404 with minimal payload
Use 400 for validation failures and 404 when a requested item is not found.
- Return a predictable error structure, or an intentionally empty body if the external contract expects that.
- Keep behavior consistent across all failure branches that represent the same error class.
HTML responses
Some workflows return HTML from this job.
- Set Response content type to
text/html. - Use
200for page delivery and302only when redirect semantics are intentional. - Sanitize or strictly validate any dynamic value inserted into HTML.
- Avoid putting sensitive tokens in URLs rendered by HTML responses.
Related jobs and triggers
- Incoming HTTP Trigger
- Send HTTP request
- JSON Pipeline
References
- Quickstart: Your first API
- Step-by-step guide to getting started with API workflows.
- Building your first API
- Advanced patterns and best practices for API workflows.