Appearance
Call API Endpoints from interface workflows
Calling API Endpoints from your interface allows you to execute secure logic.
Here is how you can call an API Endpoint from the interface:
1. Add the action
- Create or open a workflow in the
Interfacetab (for example, on a buttonOn click) - Click
+ Add an action - Hover
From Data & API→API - Select your API Endpoint from the list
2. Map inputs
With the API Endpoint action selected, you can configure what you wish to use for the values of the input parameters. You can type a fixed value, or bind it and pass a dynamic value, such as the value of a variable or input.
UNDERSTANDING INPUT PARAMETERS
Input parameters are used to pass dynamic values to API Endpoints, allowing for the API Endpoint to perform logic specific to your inputs, such as retrieving records that match your search input, or creating records with the data you passed in.
3. Handle results
API Endpoints will always return a response, and in many cases, you will want to use the response returned by an API Endpoint in some way.
Here are some examples of a use case for an API Endpoint and how you may want to use the response in the interface:
Create order and redirect to detail page
Imagine you have an API Endpoint to create an order for a user.
- Interface calls the API Endpoint to create an order for the current user
- API Endpoint returns the
orderIdof the newly created order - Navigate the user to an order detail page for the new order
/orders/{orderId}
Update profile and refresh UI
Imagine you have an API Endpoint to update the information of a user, and on the page you show the information of the user currently being viewed.
- Interface calls the API Endpoint and passes as inputs which user to update and what their new information should be
- API Endpoint returns updated
userData - Depending on if you are using a view or variable to show the data of the user being viewed:
- If variable — Update variable used to show information
currentUserData=userDatareturned by API - If view — Refetch the view to get the latest data of the user
- If variable — Update variable used to show information
Securing API Endpoints
By default, any authentication restrictions you have set on the API Endpoint will automatically be enforced.
This means if you have the API Endpoint set to only be usable by Authenticated users, then whenever you try to call the API Endpoint from the interface, it will only work if you are logged in. If you are not logged in, the API Endpoint will return an error.
CUSTOM MIDDLEWARE
To introduce more granular access controls in your API Endpoints, check out the dedicated documentation for securing API Endpoints.

