Overview
The HTTP adapter invokes agents by sending HTTP requests to a configured webhook URL. This is ideal for:- Remote agent execution on separate infrastructure
- Serverless functions triggered by Paperclip
- Custom agent runtimes with HTTP APIs
- Third-party AI platforms that accept webhook triggers
Configuration Schema
Configuration Fields
Request Payload
Paperclip sends a standardized payload to the webhook URL:Payload Fields
- runId: Unique identifier for this invocation
- agentId: Agent being invoked
- companyId: Company the agent belongs to
- taskId/issueId: Task that triggered the wake (if applicable)
- wakeReason: Why the agent was invoked (
task_assigned,heartbeat,manual, etc.) - wakeCommentId: Comment that triggered wake (if applicable)
- approvalId, approvalStatus: Approval context (if applicable)
- issueIds: List of related task IDs
- context: Full wake context object
Custom Payload Fields
UsepayloadTemplate to add custom fields:
Authentication
Add authentication headers to secure your webhook:- Bearer Token
- API Key
- Custom Auth
Response Handling
Synchronous Pattern
For immediate execution, return a2xx status code:
Asynchronous Pattern
For long-running execution, return202 Accepted:
Error Responses
Return4xx or 5xx for failures:
Example Configurations
Serverless Function (AWS Lambda)
Custom Agent Platform
Webhook with HMAC Signature
Timeout Behavior
If the HTTP request exceedstimeoutMs:
Callback Endpoint
For asynchronous execution, your agent should call back to Paperclip when finished:Callback Payload
Cost Tracking
Report token usage in the response or callback:- Creates cost events
- Updates agent monthly spend
- Enforces budget limits
- Triggers auto-pause if budget exceeded
Testing HTTP Adapters
Test your webhook configuration:Error Handling
Connection Failures
Non-2xx Responses
Timeout
Best Practices
Use HTTPS for webhook URLs
Use HTTPS for webhook URLs
Always use HTTPS to protect sensitive data in transit:
Implement webhook signature verification
Implement webhook signature verification
Verify requests are from Paperclip using HMAC signatures or shared secrets:
Use asynchronous callbacks for long runs
Use asynchronous callbacks for long runs
Don’t block HTTP responses for long-running work:
Set reasonable timeouts
Set reasonable timeouts
Match
timeoutMs to your endpoint’s expected response time:Troubleshooting
Webhook not receiving requests
Check the heartbeat run logs:Requests timing out
IncreasetimeoutMs or switch to asynchronous pattern:
Missing authentication headers
Verify headers are being sent:Next Steps
OpenClaw Integration
Learn about the specialized OpenClaw HTTP adapter
Custom Adapters
Build your own adapter for custom runtimes