API Specifications
API specs are YAML definitions for extracting data from REST APIs. They handle authentication, pagination, response processing, and incremental sync automatically.
When to Use
- Extract data from REST APIs (GET endpoints only)
- Build incremental sync workflows
- Handle complex pagination patterns
- Process nested JSON responses
- Chain multiple API calls with queues
Basic Structure
name: "My API"
description: "Data extraction from My API"
authentication:
type: "static"
headers:
Authorization: "Bearer {secrets.api_token}"
defaults:
state:
base_url: "https://api.example.com/v1"
request:
headers:
Accept: "application/json"
endpoints:
users:
description: "Fetch users"
request:
url: "{state.base_url}/users"
response:
records:
jmespath: "data[]"
primary_key: ["id"]
MCP Operations
Parse a Spec
{
"action": "parse",
"input": {"file_path": "/path/to/spec.yaml"}
}
Test Endpoints
{
"action": "test",
"input": {
"connection": "MY_API",
"endpoints": ["users"],
"debug": true,
"limit": 10
}
}
Topics Reference
This skill includes detailed documentation for each aspect of API specification building:
| Topic |
Description |
| AUTHENTICATION.md |
All 8 authentication types (static, basic, OAuth2, AWS, HMAC, sequence) |
| ENDPOINTS.md |
Endpoint configuration, setup/teardown sequences |
| REQUEST.md |
HTTP request configuration, rate limiting |
| PAGINATION.md |
All pagination patterns (cursor, offset, page, link header) |
| RESPONSE.md |
Record extraction, deduplication |
| PROCESSORS.md |
Data transformations, aggregations |
| VARIABLES.md |
Variable scopes, expressions, rendering order |
| QUEUES.md |
Endpoint chaining, iteration |
| INCREMENTAL.md |
Sync state, context variables |
| DYNAMIC.md |
Runtime endpoint generation |
| FUNCTIONS.md |
Expression functions reference |
| RULES.md |
Response rules, retries, error handling |
Quick Reference
Authentication Types
| Type |
Use Case |
static |
API key, Bearer token |
basic |
Username/password |
oauth2 |
OAuth 2.0 flows (client_credentials, authorization_code, device_code) |
aws-sigv4 |
AWS services |
hmac |
Crypto exchanges, custom signing |
sequence |
Multi-step custom auth |
Pagination Patterns
| Pattern |
Example |
| Cursor |
starting_after, page_token |
| Offset |
offset + limit |
| Page |
page number |
| Link header |
GitHub-style rel="next" |
Variable Scopes
| Scope |
Description |
secrets.* |
Credentials from connection |
state.* |
Endpoint state variables |
sync.* |
Persisted from previous run |
response.* |
HTTP response data |
record.* |
Current record in processor |
queue.* |
Endpoint chaining |
Full Documentation
See https://docs.slingdata.io/concepts/api-specs.md for complete reference.
1---2name: sling-api-specs3description: Build REST API specifications for Sling data extraction. Use when creating API specs, configuring authentication (OAuth, API key, Bearer token, HMAC), setting up pagination (cursor, offset, page), processing responses, handling rate limits, chaining endpoints with queues, or implementing incremental sync.4---56# API Specifications78API specs are YAML definitions for extracting data from REST APIs. They handle authentication, pagination, response processing, and incremental sync automatically.910## When to Use1112- Extract data from REST APIs (GET endpoints only)13- Build incremental sync workflows14- Handle complex pagination patterns15- Process nested JSON responses16- Chain multiple API calls with queues1718## Basic Structure1920```yaml21name: "My API"22description: "Data extraction from My API"2324authentication:25 type: "static"26 headers:27 Authorization: "Bearer {secrets.api_token}"2829defaults:30 state:31 base_url: "https://api.example.com/v1"32 request:33 headers:34 Accept: "application/json"3536endpoints:37 users:38 description: "Fetch users"39 request:40 url: "{state.base_url}/users"41 response:42 records:43 jmespath: "data[]"44 primary_key: ["id"]45```4647## MCP Operations4849### Parse a Spec50```json51{52 "action": "parse",53 "input": {"file_path": "/path/to/spec.yaml"}54}55```5657### Test Endpoints58```json59{60 "action": "test",61 "input": {62 "connection": "MY_API",63 "endpoints": ["users"],64 "debug": true,65 "limit": 1066 }67}68```6970## Topics Reference7172This skill includes detailed documentation for each aspect of API specification building:7374| Topic | Description |75|-------|-------------|76| [AUTHENTICATION.md](AUTHENTICATION.md) | All 8 authentication types (static, basic, OAuth2, AWS, HMAC, sequence) |77| [ENDPOINTS.md](ENDPOINTS.md) | Endpoint configuration, setup/teardown sequences |78| [REQUEST.md](REQUEST.md) | HTTP request configuration, rate limiting |79| [PAGINATION.md](PAGINATION.md) | All pagination patterns (cursor, offset, page, link header) |80| [RESPONSE.md](RESPONSE.md) | Record extraction, deduplication |81| [PROCESSORS.md](PROCESSORS.md) | Data transformations, aggregations |82| [VARIABLES.md](VARIABLES.md) | Variable scopes, expressions, rendering order |83| [QUEUES.md](QUEUES.md) | Endpoint chaining, iteration |84| [INCREMENTAL.md](INCREMENTAL.md) | Sync state, context variables |85| [DYNAMIC.md](DYNAMIC.md) | Runtime endpoint generation |86| [FUNCTIONS.md](FUNCTIONS.md) | Expression functions reference |87| [RULES.md](RULES.md) | Response rules, retries, error handling |8889## Quick Reference9091### Authentication Types9293| Type | Use Case |94|------|----------|95| `static` | API key, Bearer token |96| `basic` | Username/password |97| `oauth2` | OAuth 2.0 flows (client_credentials, authorization_code, device_code) |98| `aws-sigv4` | AWS services |99| `hmac` | Crypto exchanges, custom signing |100| `sequence` | Multi-step custom auth |101102### Pagination Patterns103104| Pattern | Example |105|---------|---------|106| Cursor | `starting_after`, `page_token` |107| Offset | `offset` + `limit` |108| Page | `page` number |109| Link header | GitHub-style `rel="next"` |110111### Variable Scopes112113| Scope | Description |114|-------|-------------|115| `secrets.*` | Credentials from connection |116| `state.*` | Endpoint state variables |117| `sync.*` | Persisted from previous run |118| `response.*` | HTTP response data |119| `record.*` | Current record in processor |120| `queue.*` | Endpoint chaining |121122## Full Documentation123124See https://docs.slingdata.io/concepts/api-specs.md for complete reference.