API Call Integration

Connect to any REST API and integrate external services into your workflows.

Overview

The API Call action allows you to make HTTP requests to external APIs, enabling you to integrate with third-party services, fetch data, send information, or trigger actions in other systems as part of your workflow.

How to Configure API Call

  1. Add Action Node:
    • In your workflow, add an Action Node
    • Select "API Call" as the action type
    • The API Call configuration panel will open with four tabs: Request, Authentication, Headers, and Advanced
  2. Configure Request Details:
    • Select the HTTP Method (GET, POST, PUT, DELETE, PATCH)
    • Enter the API URL (e.g., https://api.example.com/endpoint)
    • For POST, PUT, or PATCH requests, add a Request Body in JSON format
    • Use dynamic variables from forms or agent responses in your request body
  3. Set Up Authentication (if required):
    • Switch to the "Authentication" tab
    • Select your authentication type (see Authentication Methods section below)
    • Enter the required credentials
    • Click "Validate" to test the connection
  4. Add Custom Headers (optional):
    • Switch to the "Headers" tab
    • Add custom headers in JSON format (e.g., { "Content-Type": "application/json" })
  5. Configure Advanced Options (optional):
    • Switch to the "Advanced" tab
    • Enable Retry to automatically retry failed requests
    • Set Max Attempts (default: 3) and Delay (default: 1000ms)
    • Enable Continue On Error to prevent workflow from stopping if the API call fails
  6. Save Configuration:
    • Click "Save Configuration" to apply your settings
    • Test your workflow to ensure the API call works as expected

Authentication Methods

None
No authentication required

Use this for public APIs that don't require authentication.

Basic Auth
Username and password authentication

Required Fields

  • Username: Your account username
  • Password: Your account password

How It Works

Basic authentication encodes your username and password in Base64 and sends them in theAuthorization header asBasic <credentials>.

Security Note: Basic Auth sends credentials with every request. Use HTTPS to ensure credentials are encrypted in transit.
Bearer Token
Token-based authentication

Required Fields

  • Token: Your bearer token or access token

How It Works

The token is sent in the Authorization header asBearer <token>. This is commonly used with JWT tokens and OAuth 2.0 access tokens.

Common Use Cases: GitHub API, Stripe API, most modern REST APIs
API Key
Custom API key authentication

Required Fields

  • Key Name: The name of the API key parameter (e.g., X-API-Key, api_key)
  • Value: Your API key value
  • Add To: Where to include the key (Header or Query Parameter)

How It Works

API keys can be sent either as a custom header or as a query parameter in the URL. The location depends on the API's requirements.

Examples

Header: X-API-Key: your_api_key_here

Query Param: ?api_key=your_api_key_here

OAuth 2.0
OAuth 2.0 Client Credentials flow

Required Fields

  • Client ID: Your OAuth application client ID
  • Client Secret: Your OAuth application client secret
  • Access Token: Current access token (if you already have one)
  • Token URL: OAuth token endpoint URL

How It Works

Monology uses the Client Credentials flow to obtain an access token from the token URL using your client ID and secret. The access token is then used to authenticate API requests.

Note: This implementation uses the Client Credentials grant type, suitable for server-to-server authentication. Not all OAuth 2.0 providers support this flow.

HTTP Methods

GETRetrieve Data

Fetch data from an API without modifying anything. No request body required.

POSTCreate Data

Send data to create a new resource. Requires a request body with the data to create.

PUTUpdate/Replace Data

Replace an entire resource with new data. Requires a request body with complete data.

PATCHPartial Update

Update specific fields of a resource. Requires a request body with only the fields to update.

DELETERemove Data

Delete a resource. Usually no request body required.

Using Dynamic Variables

You can use data from previous nodes in your API calls by inserting dynamic variables:

Form Data

Access form field values using {{form.fieldName}}

{
  "name": "{{form.name}}",
  "email": "{{form.email}}",
  "message": "{{form.message}}"
}

Agent Response

Access agent outputs using {{agent.fieldName}}

{
  "intent": "{{agent.classified_intent}}",
  "sentiment": "{{agent.sentiment}}",
  "summary": "{{agent.summary}}"
}

Previous API Response

Access data from a previous API call using {{action.fieldName}}

{
  "user_id": "{{action.id}}",
  "status": "{{action.status}}"
}

Error Handling & Retry

Retry Configuration

Automatically retry failed API calls to handle temporary network issues or rate limits.

  • Enable Retry: Toggle to enable automatic retries
  • Max Attempts: Number of retry attempts (default: 3)
  • Delay (ms): Wait time between retries in milliseconds (default: 1000ms)

Continue On Error

When enabled, the workflow will continue to the next node even if the API call fails. This is useful for non-critical API calls where you don't want to block the entire workflow.

Common Use Cases

CRM Integration

Create leads or contacts in your CRM (Salesforce, HubSpot) when a form is submitted.

Payment Processing

Process payments through Stripe, PayPal, or other payment gateways.

Data Enrichment

Fetch additional data from external APIs to enrich conversation context.

Webhook Triggers

Trigger webhooks in other systems (Zapier, Make, n8n) to start automation workflows.

Database Operations

Store or retrieve data from your database via REST API endpoints.

SMS/Notifications

Send SMS via Twilio or push notifications through Firebase.

Testing & Validation

Always validate your API configuration before deploying your workflow:

  1. Configure your API call with URL, method, and authentication
  2. Click "Validate" in the Authentication tab to test the connection
  3. Check for success (green checkmark) or error messages (red X)
  4. Review the test response to ensure the API returns expected data
  5. Run a test conversation through your workflow to verify end-to-end functionality
Best Practice: Always test API calls in a development workflow before using them in production. Check API rate limits and ensure your credentials have the necessary permissions.

Next Steps

Action Nodes

Learn more about Action nodes and other action types