Sign Up
Loading...

Response Settings

You can customise the successful response from an endpoint, including its status code and additional headers.

Configure a response

  1. Open the endpoint and its Output editor.

  2. Select RESPONSE.

  3. Choose a status code or select a variable from the commands section.

  4. Add a response-headers object if you need additional information in the response.

  5. Save, test and publish the endpoint.

This example chooses status 202 and adds an X-Acceptance header with the text database-upgrades.

After publishing, the sample call shows HTTP 202 Accepted in the API client.

Leave the status blank to use 200. For a create operation you might use 201. 204 and 205 responses have no response body.

These settings apply to successful responses. Error responses keep their own status. Some headers, including cookie, browser-access and tracing headers, are reserved and cannot be changed here.

Use a variable when a header depends on the workflow, such as an app version or a value you calculated. Use an empty headers object to remove custom headers.

Related Topics

Endpoint Basics

An endpoint refers to a specific URL (Uniform Resource Locator) that a client can access to interact with the API and perform various operations. Endpoints act as gateways that allow clients (such as web or mobile applications) to communicate with the server hosting the API and perform actions like ...

Create File Endpoints

Overview. Twidget allows you to create file endpoints, which enable you to manage files in your file store. This feature is designed to streamline your workflow by providing predefined endpoints for common file operations. Creating File Endpoints. To create a file endpoint in Twidget, follow these s...

Endpoint Inputs

In Twidget, endpoints have a variety of input types that can be used to configure and execute API requests. These input types include queries, headers, body, files, and path inputs. Each input type serves a specific purpose in allowing users to interact with APIs efficiently. Files. The files input ...

What is an API

An API (Application Programming Interface) is a set of rules and protocols that allows different software applications to communicate and interact with each other. It defines the methods and data formats that applications can use to request and exchange information, services, or functionalities from...

Generate CRUD Endpoints

What are CRUD Endpoints?. CRUD stands for Create, Read, Update, Delete. These are the basic operations required to manage data in a database. Each operation corresponds to a specific HTTP method: - Create: Adds new data (HTTP POST) - Read: Retrieves data (HTTP GET) - Update: Modifies existing data (...