API Manager
Logo
Request & Response

Request & Response

Logo

4 mins READ

An API's request and response contract describes the inputs it accepts from callers and the response shapes it returns for each HTTP status code. The schema comes from what backs the API, such as the backing automation's trigger and response configuration.

Overview

Every published API has a contract: what the caller must send, and what they can expect back. An API's contract comes from what backs it. For a Callable or Webhook automation, you define the parameters, request body and responses on the automation's trigger; the API's details page shows them read-only (Parameters, Request Body, Responses) and they feed the API spec export. To change the contract, update and redeploy the automation. External APIs have no contract.

The Request

An API's incoming request is made up of typed parameters plus an optional body, as defined on the backing automation's trigger. Each parameter carries a name, a schema (type and validation), and a required flag.

Parameter Type

Where It Appears

Example

Path parameters

Embedded in the URL path

{id} in /orders/{id}

Query parameters

After the ? in the URL

?status=open

Request headers

HTTP headers the caller sends

X-Correlation-ID

Request body

The JSON or XML payload

POST/PUT/PATCH payloads

Parameters marked required form part of the contract callers must follow. They appear in the OpenAPI export so consumers know what is mandatory.

request_response_endpoint.png
request_response_endpoint.png

Responses

Responses are described as a schema per HTTP status code — for example a 200 success shape, a 400 validation-error shape, and a 500 error shape — on the backing automation's trigger. Each entry pairs a status code with the body schema and content type (such as application/json). Describing responses this way documents every outcome for callers, feeds the OpenAPI export, and makes the API self-describing. Define at least the success response (2xx) and the common error shapes (400, 500).

Enforcing Required Parameters

Parameters marked required form the API's structural contract. To enforce them at the gateway — rejecting malformed requests before the backing resource runs — attach a request validator policy to the API or API group. A request missing a required parameter is then rejected with a clear error rather than passed through to the automation where the failure would be less obvious. Your backing automation can also perform its own validation for business-rule checks the structural validator cannot cover.

How the Request Reaches the Backing Resource

When the API is backed by a Callable automation, the platform maps the request — path variables, query parameters, headers, and body — into the automation's inputs, runs it, and waits for the result. When the API is backed by a Webhook automation, the platform maps the request the same way but accepts it immediately and runs the automation asynchronously, returning 204 with a trace ID that can be used to track the run. An Event Stream resource is mapped the same way and publishes the request payload as an event. For an External API, the request is forwarded to the upstream URL with your configured authentication and headers, and the upstream response is returned. For an LLM Model, the payload is passed to the model.

Notes

  • Mark only the parameters your operation genuinely requires as required — optional parameters need not be listed as required just because they are commonly sent.

  • Define response schemas for error codes as carefully as for success codes — callers build error-handling logic from those shapes.

  • Export the OpenAPI spec after redeploying the automation to give consumers an accurate, up-to-date contract.

  • Use a request validator policy to enforce structural rules at the gateway; use the backing automation for business logic validation.

  • For REST APIs, the request body applies to POST, PUT, and PATCH methods; GET and DELETE typically use path or query parameters instead.

FAQs

Do I have to define a request body for every API?

No. The request body is optional and only relevant for methods that carry one — POST, PUT, and PATCH. GET and DELETE operations use path parameters and query parameters. Define a body on the automation's trigger only when the calling application is expected to send one.

What happens if a caller sends a parameter I did not define?

By default, parameters you did not define are not rejected at the gateway. To enforce the defined schema, attach a Request Validator policy to the API or API group so it rejects requests that don't conform to the configured parameter and body schema.

Do response schemas affect what my automation actually returns?

No — response schemas are documentation and contract definitions, not enforcement. They describe to callers what to expect and appear in the OpenAPI export, but the platform returns whatever the backing automation produces. For the response to match the schema, the automation itself must return the correct shape.

How does a Webhook API respond to a caller?

A Webhook API accepts the request immediately and runs the backing automation asynchronously. The caller receives a 204 response with a trace-ID header it can use to track the run.

Can an Event Stream back an API's request and response contract?

Yes. Event Streams are also a supported backing resource type — the request payload is published as an event to the configured topic.