For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
  • Getting Started
    • What is Runtype?
    • Creating your account
    • Platform Keys vs. BYOK
    • Understanding the Runtype UI
    • Quickstart: Social Media Post Generator
    • Quickstart: From Agent to Chat Widget
  • Dashboard
    • What is the Dashboard?
    • Daily Executions
  • Playground
    • What is the Playground?
  • Products & Surfaces
    • What are Products?
    • What are Surfaces?
    • Creating a Product
    • Setting up a Chat Surface
    • Setting up an API Surface
    • Setting up an MCP Surface
    • Setting up an A2A Surface
    • Setting up a Slack Surface
    • MCP authentication
    • Authenticating with product API keys
    • Embedding the chat widget (script tag)
    • Embedding the chat widget (React)
    • Surface orchestration modes
    • Product views
    • Adding Capabilities to a product
    • Connecting external agents
    • How A2A works
    • Connecting to Cursor / VS Code
    • Connecting to Claude Desktop
    • Scoping API keys to capabilities
    • Auto-generated OpenAPI spec
    • Calling your API endpoints
    • Client tokens and domain restrictions
    • AI-powered theme generation
    • Widget theming and customization
    • Product versioning and status
  • Flows
    • What are Flows?
    • Creating and Editing Flows
    • Flow step types overview
    • Agent and Flow Templates
    • Using prompt steps
    • Using transform-data steps
    • Using conditional steps
    • Using fetch-url and api-call steps
    • Using record steps (upsert/retrieve)
    • Flow variables and templates
    • Flow versioning and publishing
    • Running flows in batch
    • Handling batch failures
    • Debugging flows
  • Agents
    • What are Agents?
    • Creating and configuring Agents
    • Agent tools
  • Records
    • What are Records?
    • Creating and managing records
    • Using records in flows
    • Filtering and searching records
  • Tools
    • What are Tools?
    • Built-in Tools
    • Creating custom tools
    • Creating external tools
    • Runtime tools
  • Evals
    • What are Evals?
    • Running an Eval
    • Interpreting eval results
  • Schedules
    • What are Schedules?
    • Automating batch processing
  • Logs
    • What are Logs?
    • Working with Logs
  • Integrations
    • Connecting AI model providers
    • Slack integration
    • Google Workspace integration
    • GitHub integration
    • Linear integration
    • Weaviate (vector search)
    • Firecrawl (web scraping)
    • Exa (web search)
  • Settings
    • What's in Settings?
    • Available AI models
    • What are Organizations?
    • Managing AI models
    • Managing API keys
    • Billing and plans
    • Usage data
    • Team members and permissions
    • Appearance and preferences
    • Integrations (PostHog, Weaviate, Daytona)
  • Troubleshooting & FAQ
    • FAQ
    • Rate Limits and Usage
    • Managing Runtype with Claude
    • Flow execution failures
    • Common errors and solutions
    • Authentication issues
Dashboard
LogoLogo
On this page
  • Fetch URL step
  • Add a fetch-url step
  • API Call step
  • Add an api-call step
  • Setting headers
  • Request body
  • Authentication
  • Bearer token
  • Basic auth
  • API key in header
  • Handling responses
  • Error handling
  • Dynamic URLs
  • Common patterns
  • REST API integration
  • Webhook notification
  • External data lookup
  • Rate limiting
  • Testing API calls
  • Best practices
  • Next steps
Flows

Using fetch-url and api-call steps

Was this page helpful?
Previous

Using record steps (upsert/retrieve)

Next
Built with

Make HTTP requests to external APIs and services using fetch-url (for simple GET requests) or api-call (for full HTTP control).

Fetch URL step

Use for simple GET requests to public URLs.

Add a fetch-url step

  1. In the Flow editor, click Add Step
  2. Select Fetch URL
  3. Configure:
    • Name: Descriptive label (e.g., “Get Product data”)
    • URL: The endpoint to call
  4. Click Save Step

Example:

https://api.example.com/Products/{{productId}}

The step returns the response body.

API Call step

Use for full HTTP control: POST, PUT, DELETE, custom headers, authentication.

Add an api-call step

  1. Click Add Step
  2. Select API Call
  3. Configure:
    • Name: Descriptive label
    • Method: GET, POST, PUT, DELETE, etc.
    • URL: Endpoint URL
    • Headers: HTTP headers (optional)
    • Body: Request body (for POST/PUT)
  4. Click Save Step

Setting headers

Add headers as key-value pairs:

Content-Type: application/json
Authorization: Bearer {{secrets.apiKey}}
X-Custom-Header: {{customValue}}

Request body

For POST/PUT requests, provide the body as JSON:

1{
2 "customer": "{{customerName}}",
3 "order": {
4 "items": "{{order_items}}",
5 "total": "{{calculate_total}}"
6 }
7}

Authentication

Bearer token

Authorization: Bearer YOUR_API_KEY

Basic auth

Encode username:password in base64:

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

API key in header

X-API-Key: YOUR_API_KEY

Do not hardcode API keys in Flows. Use Runtype’s secrets management to store credentials securely and reference them with {{secret:SECRET_NAME}} syntax.

Handling responses

Access response data in later steps using the step’s outputVariable name:

{{api_response}} // Full response body
{{api_response.data}} // Nested property

Error handling

API calls can fail. Configure error handling on the step itself (continue on error, stop on error, or use fallbacks), or use a conditional step to check the result before proceeding.

Dynamic URLs

Build URLs from variables:

https://api.example.com/{{resource}}/{{itemId}}?filter={{searchTerm}}

Common patterns

REST API integration

Method: POST
URL: https://api.service.com/v1/items
Headers:
Content-Type: application/json
Authorization: Bearer {{apiKey}}
Body:
{
"name": "{{itemName}}",
"value": "{{itemValue}}"
}

Webhook notification

Method: POST
URL: https://hooks.example.com/notify
Body:
{
"event": "flow_completed",
"data": "{{final_output}}"
}

External data lookup

Method: GET
URL: https://api.database.com/lookup?id={{customerId}}
Headers:
X-API-Key: {{secrets.dbApiKey}}

Rate limiting

Some APIs rate-limit requests. Add delay steps between API calls if needed:

  1. API call step
  2. Delay step (e.g., 1 second)
  3. Next API call

Testing API calls

Use the step tester to verify requests without running the full Flow:

  1. Click Test on the API step
  2. Provide sample variables
  3. Review the actual HTTP request sent
  4. Check the response

Best practices

  • Validate responses: Check status codes before using response data
  • Handle errors gracefully: Use conditionals for retry logic or fallbacks
  • Keep secrets secret: Never log or expose API keys
  • Set timeouts: Configure step timeouts to avoid hanging on slow APIs

Next steps

  • Using transform-data steps to process API responses
  • Using conditional steps for error handling
  • Flow variables and templates for building dynamic requests