call_api
Execute single API calls or orchestrate multi-step API workflows with sequential, parallel, conditional, and loop operations through APIClaw's extensive API index.
Instructions
Execute an API call through APIClaw. Supports single calls AND multi-step chains.
SINGLE CALL: Provide provider + action + params CHAIN: Provide chain array to execute multiple APIs in sequence/parallel with cross-step references.
Chain features:
Sequential: Steps execute in order, each can reference previous results via $stepId.property
Parallel: Use { parallel: [...steps] } to run concurrently
Conditional: Use { if: "$step.success", then: {...}, else: {...} }
Loops: Use { forEach: "$step.results", as: "item", do: {...} }
Error handling: Per-step retry/fallback via onError
Async: Set async: true to get chainId immediately, poll or use webhook
Example chain: chain: [ { id: "search", provider: "brave_search", action: "search", params: { query: "AI agents" } }, { id: "summarize", provider: "openrouter", action: "chat", params: { message: "Summarize: $search.results" } } ]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| provider | No | Provider ID (e.g., "46elks", "brave_search", "resend", "openrouter", "elevenlabs", "twilio", "coaccept", "frankfurter") | |
| action | No | Action to perform (e.g., "send_sms", "search", "send_email", "chat", "send_invoice", "convert") | |
| params | No | Parameters for the action. Varies by provider/action. | |
| customer_key | No | Optional: Your own API key for providers that require customer authentication (e.g., CoAccept). | |
| confirm_token | No | Confirmation token from a previous call. Required to execute actions that cost money after reviewing the preview. | |
| dry_run | No | If true, shows what WOULD be sent without making actual API calls. Returns mock response and request details. Great for testing and debugging. | |
| chain | No | Execute multiple API calls as a single chain. Each step can reference previous results via $stepId.property | |
| continueOnError | No | Continue chain execution even if a step fails (default: false) | |
| timeout | No | Maximum execution time for the entire chain in milliseconds | |
| async | No | Return immediately with chainId. Use get_chain_status to poll or provide webhook. | |
| webhook | No | URL to POST results when async chain completes | |
| subagent_id | No | Optional subagent identifier for multi-agent tracking | |
| ai_backend | No | AI backend making this request (e.g., "claude-3-sonnet", "gpt-4"). Used for analytics. |