REST

The REST Task in Gaio DataOS allows you to connect to any external API — public or private — directly within your data flow. You can use it to fetch data, post information, automate API integrations, and convert JSON responses into usable tables inside your project.
How to Use the REST Task
1. Open the REST Task
In the Studio, go to the Tasks panel.
Under the ETL section, select REST.
2. Choose Method and Configure URL
Select the HTTP method:
GET
,POST
,PUT
,DELETE
, etc.In the URL field, type the API endpoint.
You can use dynamic parameters in the URL:
plaintextCopiarEditar{{param.name}} or {{table_name.column_name}}
Example:
bashCopiarEditarhttps://api.example.com/users/{{user_id}}/posts?status={{status}}
3. Add Parameters
In the Parameters tab, you can define URL parameters:
URL Parameter: Name of the parameter (e.g.,
userId
).Value: Static or dynamic value (e.g.,
{{param.user_id}}
)
Click + Add Parameter to add more.
4. Define the Request Body (if needed)
In the Body tab, you can:
Enter JSON, XML, or plain text content for the request body (mainly used for
POST
andPUT
).Use dynamic variables inside the content.
5. Headers and Authorization
Headers tab: add custom headers like Authorization, Content-Type, Accept, Bearer Tokens
Authorization tab: configure Basic Auth.
6. Result Tab
This tab controls how the API response is interpreted and converted into a table.
Structure Identification: Lets Gaio automatically detect column names and data types. Set to “Automatic” by default.
Object Property: Define the path to the array in the JSON response, if it’s nested. Example: results.items.
Always Drop Table: If enabled, the existing result table will be replaced each time the task runs.
📌 Behavior:
If the API returns a JSON object, one row will be created.
If it returns a JSON array, each item will be inserted as a separate row.
7. Error Log Tab
This tab allows you to capture and store any errors encountered during execution.
Log Table: The name of the table that will receive error logs from the REST task (e.g.,
log_api_errors
)
This makes debugging and monitoring easier in production.
✅ Best Practices
Always run Run test before finalizing the configuration.
Use dynamic parameters to reuse the same task with different inputs.
When using nested JSON, define the Object Property path precisely.
Enable the Error Log tab to trace failed API calls and improve reliability.
Last updated