Skip to main content

RESTful API

Add Query

To add a RESTful API query step to your workflow:

  1. Navigate to the page list and add a new workflow
  2. Select RESTful API from the data sources in the workflow step sidebar
  3. Configure your query in the input window that appears

For detailed setup instructions, see the RESTful API Data Source Guide.

rest-api

Dynamic URLs

Use path variables with templates to create dynamic URLs.

  • {{ /users/{id}/posts }} - Replace {id} with a dynamic value
  • {{ /organizations/{orgId}/teams/{teamId} }} - Use multiple parameters

Body Formats

Choose from these supported formats:

  • Text: Plain text
  • Form: URL-encoded form data
  • Form(Multipart): For file uploads
  • JSON: JSON data

Available Methods

GET

GET requests are the most basic method for retrieving data from a server. Here's how to use GET requests:

  1. Specify the API endpoint URL
  2. Configure URL parameters and query strings as needed
  3. Add any required authentication headers or cookies

While GET requests typically don't include a body, you can add one if your API requires it.

rest-api-get

ParameterTypeDescription
Path (path)stringAPI endpoint URL
URL Parameters (params)objectDynamic URL values
Body TypeenumNone, Text, Form, Form(Multipart), JSON
Body (body)unknownRequest payload (format depends on Body Type)
Headers (headers)objectHTTP headers
Cookies (cookies)objectHTTP cookies

POST

POST requests are used to create new resources. Here's how to use POST requests:

  1. Specify the API endpoint URL
  2. Include the resource data in the request body
  3. Configure URL parameters if needed
  4. Select the appropriate body format
  5. Add any required authentication

rest-api-post

ParameterTypeDescription
Path (path)stringAPI endpoint URL
URL Parameters (params)objectDynamic URL values
Body TypeenumNone, Text, Form, Form(Multipart), JSON
Body (body)unknownRequest payload (format depends on Body Type)
Headers (headers)objectHTTP headers
Cookies (cookies)objectHTTP cookies

PUT

PUT requests are used to update existing resources. Here's how to use PUT requests:

  1. Specify the API endpoint URL
  2. Include the complete resource data in the body
  3. Configure URL parameters if needed
  4. Select the appropriate body format
  5. Add any required authentication

rest-api-put

ParameterTypeDescription
Path (path)stringAPI endpoint URL
URL Parameters (params)objectDynamic URL values
Body TypeenumNone, Text, Form, Form(Multipart), JSON
Body (body)unknownRequest payload (format depends on Body Type)
Headers (headers)objectHTTP headers
Cookies (cookies)objectHTTP cookies

DELETE

DELETE requests are used to remove resources from the server. Here's how to use DELETE requests:

  1. Specify the API endpoint URL
  2. Include the resource identifier in the URL
  3. Configure URL parameters if needed
  4. Add any required authentication

While DELETE requests typically don't include a body, you can add one if your API requires it.

rest-api-delete

ParameterTypeDescription
Path (path)stringAPI endpoint URL
URL Parameters (params)objectDynamic URL values
Body TypeenumNone, Text, Form, Form(Multipart), JSON
Body (body)unknownRequest payload (format depends on Body Type)
Headers (headers)objectHTTP headers
Cookies (cookies)objectHTTP cookies

PATCH

PATCH requests are used to partially modify existing resources. Here's how to use PATCH requests:

  1. Specify the API endpoint URL
  2. Include the resource identifier in the URL
  3. Configure URL parameters if needed
  4. Select the appropriate body format
  5. Add any required authentication

rest-api-patch

ParameterTypeDescription
Path (path)stringAPI endpoint URL
URL Parameters (params)objectDynamic URL values
Body TypeenumNone, Text, Form, Form(Multipart), JSON
Body (body)unknownRequest payload (format depends on Body Type)
Headers (headers)objectHTTP headers
Cookies (cookies)objectHTTP cookies

Working with Responses

When your API request completes, the response will be returned in the format specified by the API provider. Each API defines its own:

  • Response format (JSON, XML, etc.)
  • Data structure and field names
  • Status codes and error handling

Always refer to your API's documentation to properly handle responses.

Response Example

// Response example
{
status: 200,
statusText: 'OK',
data: {
id: 123,
name: 'Hops Kang',
email: 'hops@example.com',
createdAt: '2024-01-01T00:00:00Z'
},
headers: {
'content-type': 'application/json',
'x-request-id': 'abc123'
}
}

// Use the response
return outputs.data.name;