REST API
Execute HTTP requests to REST APIs with authentication and response handling.
REST API Node
Make HTTP requests to REST APIs with full support for all HTTP methods, authentication schemes, and response processing in Axellero workflows.
Features
- Complete HTTP Method Support: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
- Flexible Authentication: API Key, Bearer Token, Basic Auth, OAuth2, Custom Headers
- Dynamic Request Building: Headers, query parameters, request body configuration
- Response Processing: Status code handling, header extraction, JSON/XML parsing
- Error Handling: Configurable retry logic and error response processing
Workflow Integration
REST API nodes have access to workflow execution context, allowing use of data from previous nodes, variables, and user information in API requests.
Quick Navigation
Authentication Methods
Configure API keys, tokens, and OAuth2 for secure API access
HTTP Methods
Complete reference for all supported HTTP request types
Workflow Integration
Use dynamic data from other nodes and workflow variables
Response Handling
Process API responses, handle errors, and extract data
Connector Configuration
The REST API node uses reusable connector configuration for common API settings:
| Parameter | Type | Required | Description |
|---|---|---|---|
baseUrl | TEXT | Yes | Base URL of the API (e.g., https://api.example.com) |
timeout | INT | No | Request timeout in milliseconds (default: 30000) |
retryAttempts | INT | No | Number of retry attempts on failure (default: 0) |
retryDelay | INT | No | Delay between retries in milliseconds (default: 1000) |
Authentication Methods
Credential Security
Do not hardcode credentials in workflows. Use environment variables or secure credential references.
API Key Authentication
Configure API key authentication in headers or query parameters:
{
"baseUrl": "https://api.example.com",
"headers": {
"X-API-Key": "{{ctx.consts.API_KEY}}",
"Content-Type": "application/json"
}
}{
"baseUrl": "https://api.example.com",
"queryParams": {
"apikey": "{{ctx.consts.API_KEY}}",
"format": "json"
}
}Bearer Token Authentication
For OAuth2 and JWT token-based authentication:
{
"baseUrl": "https://api.example.com",
"headers": {
"Authorization": "Bearer {{ctx.vars.accessToken}}",
"Content-Type": "application/json"
}
}Basic Authentication
HTTP Basic Authentication with username and password:
{
"baseUrl": "https://api.example.com",
"auth": {
"type": "basic",
"username": "{{ctx.consts.USERNAME}}",
"password": "{{ctx.consts.PASSWORD}}"
}
}OAuth2 Authentication
OAuth2 flow with automatic token refresh:
{
"baseUrl": "https://api.example.com",
"auth": {
"type": "oauth2",
"clientId": "{{ctx.consts.OAUTH_CLIENT_ID}}",
"clientSecret": "{{ctx.consts.OAUTH_CLIENT_SECRET}}",
"tokenUrl": "https://api.example.com/oauth/token",
"scope": "read write"
}
}HTTP Methods
GET Request
Retrieve data from an API endpoint:
| Parameter | Type | Required | Description |
|---|---|---|---|
endpoint | TEXT | Yes | API endpoint path (e.g., /users/123) |
queryParams | OBJECT | No | Query parameters as key-value pairs |
headers | OBJECT | No | Additional HTTP headers |
{
"method": "GET",
"endpoint": "/users/{{ctx.vars.userId}}",
"queryParams": {
"include": "profile,settings",
"fields": "id,name,email"
},
"headers": {
"Accept": "application/json",
"X-Client-Version": "2.1.0"
}
}POST Request
Create new resources or submit data:
| Parameter | Type | Required | Description |
|---|---|---|---|
endpoint | TEXT | Yes | API endpoint path |
body | OBJECT/STRING | No | Request body data |
contentType | TEXT | No | Content-Type header (auto-detected from body) |
headers | OBJECT | No | Additional HTTP headers |
{
"method": "POST",
"endpoint": "/users",
"body": {
"name": "{{ctx.nodes.userInput.outputs.name}}",
"email": "{{ctx.nodes.userInput.outputs.email}}",
"role": "user"
},
"headers": {
"Content-Type": "application/json"
}
}PUT Request
Update existing resources completely:
{
"method": "PUT",
"endpoint": "/users/{{ctx.vars.userId}}",
"body": {
"name": "{{ctx.vars.updatedName}}",
"email": "{{ctx.vars.updatedEmail}}",
"status": "active"
}
}PATCH Request
Partial updates to existing resources:
{
"method": "PATCH",
"endpoint": "/users/{{ctx.vars.userId}}",
"body": {
"status": "{{ctx.vars.newStatus}}"
}
}DELETE Request
Remove resources from the API:
{
"method": "DELETE",
"endpoint": "/users/{{ctx.vars.userId}}",
"headers": {
"X-Reason": "{{ctx.vars.deletionReason}}"
}
}Workflow Context Integration
📖 Reference
For context documentation, see the Workflow Context reference.
Dynamic URL Construction
Build endpoints using workflow data:
{
"method": "GET",
"endpoint": "/organizations/{{ctx.user.attrs.orgId}}/users",
"queryParams": {
"page": "{{ctx.vars.currentPage}}",
"limit": "{{ctx.consts.PAGE_SIZE}}",
"role": "{{ctx.nodes.roleFilter.outputs.selectedRole}}"
}
}Conditional Request Headers
Add headers based on workflow conditions:
{
"method": "POST",
"endpoint": "/data/upload",
"headers": {
"Content-Type": "{{ctx.vars.fileType || 'application/json'}}",
"X-User-Role": "{{ctx.user.roles[0]}}",
"X-Workspace": "{{ctx.workspace_slug}}"
},
"body": "{{ctx.nodes.dataProcessor.outputs.processedData}}"
}Request Body from Previous Nodes
Use outputs from other workflow nodes:
{
"method": "POST",
"endpoint": "/analytics/events",
"body": {
"eventType": "{{ctx.nodes.eventClassifier.outputs.type}}",
"data": "{{ctx.nodes.dataTransformer.outputs.result}}",
"timestamp": "{{ctx.nodes.timer.outputs.currentTime}}",
"userId": "{{ctx.user.id}}"
}
}Response Processing
Success Response Format
{
"statusCode": 200,
"headers": {
"content-type": "application/json",
"x-rate-limit-remaining": "99"
},
"data": {
"id": 12345,
"name": "John Doe",
"email": "john@example.com"
},
"success": true
}Error Response Format
{
"statusCode": 404,
"headers": {
"content-type": "application/json"
},
"data": {
"error": "User not found",
"code": "USER_NOT_FOUND"
},
"success": false,
"error": "HTTP 404: User not found"
}Status Code Handling
Automatic Success Detection
Status codes 200-299 are automatically marked as successful. Use workflow conditions to handle specific status codes for business logic.
Response Validation Example:
{
"method": "GET",
"endpoint": "/health",
"validateStatus": [200, 201, 202],
"onError": "continue"
}Editor Features
REST API Editor Capabilities:
- Endpoint Auto-completion: Suggestions for common REST patterns
- Header Templates: Pre-configured headers for popular APIs
- Authentication Helpers: Guided setup for common auth methods
- Request Validation: Real-time validation of request structure
- Response Preview: Live preview of API responses during testing
For complete editor details, see Code Editing & Schema Reference.
Common Patterns
Pagination Handling
{
"method": "GET",
"endpoint": "/data",
"queryParams": {
"page": "{{ctx.vars.page || 1}}",
"limit": "50"
}
}Error Retry Logic
{
"method": "POST",
"endpoint": "/critical-operation",
"retryAttempts": 3,
"retryDelay": 2000,
"retryOn": [502, 503, 504]
}Rate Limiting Awareness
{
"method": "GET",
"endpoint": "/api/data",
"headers": {
"X-Rate-Limit-Tier": "premium"
},
"timeout": 45000
}Security Best Practices
Security Guidelines
- Never hardcode credentials in request configurations
- Use HTTPS for all API communications
- Validate SSL certificates in production environments
- Implement proper error handling to avoid credential leaks
- Use least-privilege access with API keys and tokens
Getting Started
- Configure Base Settings: Set up your API's base URL and authentication
- Choose HTTP Method: Select the appropriate method for your operation
- Configure Endpoint: Define the specific API endpoint and parameters
- Set Up Authentication: Add API keys, tokens, or other auth methods
- Test the Request: Validate the request configuration and response handling
- Handle Responses: Process success and error responses in your workflow