Zapier Integration Quick Start¶
This guide walks through connecting CodeTether to Zapier for workflow automation.
Overview¶
CodeTether provides a simple REST API that Zapier can call to create and monitor AI-powered tasks. The integration uses webhooks for real-time updates when tasks complete.
Prerequisites¶
- A CodeTether instance (self-hosted or managed)
- API key from CodeTether
- Zapier account
Authentication¶
CodeTether supports two authentication methods for Zapier:
- API Key (Recommended for quick setup)
- OAuth 2.0 (For production integrations)
API Key Authentication¶
Your API key starts with ct_ and can be found in your CodeTether dashboard under Settings > API Keys.
Example Header:
OAuth 2.0 Authentication¶
For production use, Zapier supports OAuth 2.0 with the CodeTether authorization server:
- Authorization Endpoint:
https://api.codetether.io/oauth/authorize - Token Endpoint:
https://api.codetether.io/oauth/token - Scopes:
tasks:read,tasks:write,automation:read,automation:write
Quick Start: Create a Zap¶
Step 1: Create a Task with Webhook¶
Use Zapier's "Webhooks by Zapier" or make a direct HTTP POST to CodeTether:
POST /v1/automation/tasks
Headers:
Body:
{
"title": "Analyze customer feedback",
"description": "Analyze the following customer feedback and summarize key points: {{feedback_text}}",
"agent_type": "general",
"model": "claude-sonnet",
"webhook_url": "https://hooks.zapier.com/hooks/catch/123/abc/",
"priority": 0
}
Response:
{
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"run_id": "660e8400-e29b-41d4-a716-446655440001",
"status": "queued",
"title": "Analyze customer feedback",
"description": "Analyze the following customer feedback...",
"created_at": "2025-01-19T10:30:00Z",
"model": "claude-sonnet"
}
Step 2: Set Up a Webhook Catcher in Zapier¶
- Create a new Zap
- Select Webhooks by Zapier as the trigger
- Choose Catch Hook
- Copy the webhook URL provided by Zapier
- Use this URL as the
webhook_urlwhen creating tasks
Step 3: Process the Webhook Response¶
When your task completes, CodeTether will send a POST request to your webhook:
Webhook Payload:
{
"event": "task_completed",
"run_id": "660e8400-e29b-41d4-a716-446655440001",
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"result": "The feedback mentions three key areas: pricing concerns, feature requests for reporting, and positive sentiment about customer support.",
"result": null,
"timestamp": "2025-01-19T10:35:00Z"
}
Available Webhook Events¶
CodeTether sends webhook notifications for these events:
- task_started: Task execution has begun
- task_progress: Task is making progress (optional)
- task_completed: Task finished successfully
- task_failed: Task encountered an error
- task_needs_input: Task requires additional information
Rate Limiting¶
CodeTether enforces rate limits:
- Default: 60 requests per minute
- Headers: Each response includes rate limit info:
- X-RateLimit-Limit: Your current limit
- X-RateLimit-Remaining: Requests remaining
- X-RateLimit-Reset: Unix timestamp when limit resets
Idempotency¶
To prevent duplicate tasks on retries, include an Idempotency-Key header:
Subsequent requests with the same key will return the original task ID.
Webhook Signature Verification (Optional)¶
For added security, configure a webhook signing secret in CodeTether:
- Set
CODETETHER_WEBHOOK_SECRETenvironment variable - CodeTether will include
X-CodeTether-Signatureheader on webhooks - Verify signatures in Zapier using HMAC-SHA256:
Zapier Code by Zapier:
const crypto = require('crypto');
const payload = JSON.stringify(bundle.rawRequest.json);
const signature = bundle.rawRequest.headers['x-codetether-signature'];
const secret = 'your_webhook_secret';
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
if (signature !== expected) {
throw new Error('Invalid webhook signature');
}
Example Zaps¶
Zap 1: Email Analysis¶
- Trigger: New email in Gmail
- Action: CodeTether - Create Task (Analyze sentiment, extract topics)
- Trigger: Webhook catch (CodeTether callback)
- Action: Add to Google Sheet with analysis results
Zap 2: Customer Support Triage¶
- Trigger: New form submission (Typeform/JotForm)
- Action: CodeTether - Create Task (Categorize issue, suggest response)
- Trigger: Webhook catch
- Action: Create Slack message in appropriate channel
Zap 3: Document Summarization¶
- Trigger: New file in Google Drive
- Action: Extract file contents
- Action: CodeTether - Create Task (Summarize document)
- Trigger: Webhook catch
- Action: Update Notion database with summary
API Reference¶
Create Task¶
Get Task Status¶
List Tasks¶
Troubleshooting¶
Task Not Starting¶
- Check API key is valid
- Verify webhook URL format
- Check rate limit headers in response
Webhook Not Received¶
- Verify webhook URL is publicly accessible
- Check Zapier webhook history
- Ensure task completed (check status via GET /tasks/{id})
Signatures Failing¶
- Verify
CODETETHER_WEBHOOK_SECRETis set - Ensure you're using the raw JSON payload, not parsed
- Check character encoding (must be UTF-8)
Support¶
- Documentation: https://docs.codetether.io
- API Status: https://status.codetether.io
- Issues: https://github.com/codetether/codetether/issues