Dynamic Endpoints ⚡
Examples of using dynamic endpoints to programmatically generate multiple endpoint configurations
How Dynamic Endpoints Work
Simple Iteration Over Static List
name: "Resources API"
defaults:
state:
base_url: https://api.example.com/v1
request:
headers:
Authorization: "Bearer {secrets.api_key}"
dynamic_endpoints:
# Iterate over a static list of resource types
- iterate: '["users", "orders", "products"]'
into: "state.resource_type"
endpoint:
# Generate endpoint name from resource type
name: "{state.resource_type}"
description: "Fetch {state.resource_type} data"
request:
url: "{state.base_url}/{state.resource_type}"
parameters:
limit: 100
offset: 0
pagination:
next_state:
offset: "{state.offset + 100}"
stop_condition: length(response.records) < 100
response:
records:
jmespath: "data[]"
primary_key: ["id"]
processors:
# Add resource type to each record for tracking
- expression: "state.resource_type"
output: "record._resource_type"Dynamic Discovery from API
Multi-Organization Endpoints
Geographic Regions with Metadata
Combining Static and Dynamic Endpoints
Filtering During Setup
Pattern Matching Dynamic Endpoints
Best Practices
1. Use Meaningful Endpoint Names
2. Filter in Setup Phase
3. Add Context to Records
4. Validate Iteration Data
5. Use Static Endpoints for Unique Resources
6. Consider Performance
Combining Dynamic Endpoints with Other Features
With Incremental Sync
With Backfill
Last updated
Was this helpful?