Skip to main content

Overview

The API cURL node executes cURL commands to make HTTP/HTTPS requests. It’s perfect for importing existing cURL commands from browser dev tools, Postman, or API documentation. The node parses cURL syntax and executes the request, storing the response in the workflow context.

Configuration

curlCommand
string
required
Complete cURL command string. Supports variable interpolation.Example:
curl -X POST https://api.example.com/data \
  -H "Authorization: Bearer token" \
  -H "Content-Type: application/json" \
  -d '{"key": "value"}'
timeout
number
default:"30000"
Request timeout in milliseconds.
contextKey
string
default:"apiResponse"
Context variable name to store the response.
failSilently
boolean
default:"false"
If true, failed requests log warnings but don’t stop workflow execution.

Retry Configuration

retryEnabled
boolean
default:"false"
Enable automatic retry on failure.
retryCount
number
default:"3"
Number of retry attempts.
retryDelay
number
default:"1000"
Delay between retries in milliseconds.
retryDelayStrategy
string
default:"fixed"
Delay strategy: fixed or exponential

Supported cURL Options

The node supports most common cURL options:
  • -X, --request - HTTP method (GET, POST, PUT, DELETE, etc.)
  • -H, --header - Custom headers
  • -d, --data - Request body
  • --data-raw - Raw request body
  • --data-binary - Binary data
  • -F, --form - Form data (multipart)
  • -u, --user - Basic authentication
  • --compressed - Accept compressed responses
  • -L, --location - Follow redirects
  • -A, --user-agent - Custom user agent

Response Structure

Same as API Request node:
{
  "status": 200,
  "statusText": "OK",
  "headers": { ... },
  "body": { ... },
  "duration": 523,
  "timestamp": "2024-01-15T10:30:00Z"
}

Examples

Basic Requests

{
  "type": "apiCurl",
  "data": {
    "curlCommand": "curl https://api.example.com/users",
    "contextKey": "users"
  }
}

With Authentication

{
  "type": "apiCurl",
  "data": {
    "curlCommand": "curl https://api.example.com/protected -H 'Authorization: Bearer ${data.token}'"
  }
}

From Browser DevTools

{
  "type": "apiCurl",
  "data": {
    "curlCommand": "curl 'https://api.github.com/users/octocat' -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ghp_xxxxxxxxxxxx' -H 'X-GitHub-Api-Version: 2022-11-28'"
  }
}

Form Data & File Upload

{
  "type": "apiCurl",
  "data": {
    "curlCommand": "curl -X POST https://api.example.com/submit -F 'username=john' -F '[email protected]' -F 'age=30'"
  }
}

With Variables

{
  "type": "apiCurl",
  "data": {
    "curlCommand": "curl https://api.example.com/users/${data.userId}"
  }
}

Multiline cURL

Long Command
{
  "type": "apiCurl",
  "data": {
    "curlCommand": "curl -X POST https://api.example.com/graphql -H 'Content-Type: application/json' -H 'Authorization: Bearer token' -d '{\"query\": \"query { users { id name email } }\"}'"
  }
}

With Retry

Resilient Request
{
  "type": "apiCurl",
  "data": {
    "curlCommand": "curl https://api.example.com/unstable-endpoint",
    "retryEnabled": true,
    "retryCount": 3,
    "retryDelay": 2000,
    "retryDelayStrategy": "exponential"
  }
}

Converting Browser Requests

Chrome DevTools

  1. Open DevTools (F12)
  2. Go to Network tab
  3. Perform the request
  4. Right-click on the request
  5. Select “Copy” > “Copy as cURL”
  6. Paste into the curlCommand field

Firefox DevTools

  1. Open DevTools (F12)
  2. Go to Network tab
  3. Perform the request
  4. Right-click on the request
  5. Select “Copy” > “Copy as cURL”
  6. Paste into the curlCommand field

From Postman

  1. Open your request in Postman
  2. Click “Code” button (code icon)
  3. Select “cURL” from the dropdown
  4. Copy the generated cURL command
  5. Paste into the curlCommand field

cURL to API Request

You can convert cURL commands to API Request nodes:
curl -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer token" \
  -d '{"name": "John"}'

Accessing Response Data

const response = context.getData('apiResponse');

console.log(`cURL request completed in ${response.duration}ms`);
console.log(`Status: ${response.status}`);

// Process response
if (response.status === 200) {
  context.setData('requestSuccessful', true);
}

Notes

The cURL parser automatically handles quote escaping and multi-line commands. Just paste the command as-is from browser dev tools or Postman.
File paths in -F (form) options must exist on the machine running the workflow. The @ symbol indicates a file upload.
Variable interpolation works within the cURL command string, allowing dynamic URLs, headers, and body content.

Common Patterns

API Testing

[
  {
    "type": "apiCurl",
    "data": {
      "curlCommand": "curl https://api.example.com/health",
      "contextKey": "healthCheck"
    }
  },
  {
    "type": "verify",
    "data": {
      "domain": "api",
      "verificationType": "status",
      "contextKey": "healthCheck",
      "expectedValue": 200
    }
  }
]

Quick Prototyping

// Paste cURL from browser, iterate quickly
{
  "type": "apiCurl",
  "data": {
    "curlCommand": "<paste from browser dev tools>"
  }
}

Build docs developers (and LLMs) love