Skip to main content

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
HTTP adapters support both synchronous and asynchronous execution patterns.

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

Use payloadTemplate to add custom fields:
These fields are merged into the root payload alongside Paperclip’s standard fields.

Authentication

Add authentication headers to secure your webhook:
Store sensitive tokens in Paperclip’s secret vault and reference them using ${secrets.name} syntax.

Response Handling

Synchronous Pattern

For immediate execution, return a 2xx status code:
Paperclip marks the run as succeeded and records token usage.

Asynchronous Pattern

For long-running execution, return 202 Accepted:
Then use the callback endpoint to report completion:

Error Responses

Return 4xx or 5xx for failures:
Paperclip marks the run as failed and logs the error message.

Example Configurations

Serverless Function (AWS Lambda)

Custom Agent Platform

Webhook with HMAC Signature

Timeout Behavior

If the HTTP request exceeds timeoutMs:
The request is aborted and the run is marked as failed.
For long-running agents, use the asynchronous pattern with callbacks instead of increasing timeoutMs.

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:
Paperclip automatically:
  • Creates cost events
  • Updates agent monthly spend
  • Enforces budget limits
  • Triggers auto-pause if budget exceeded

Testing HTTP Adapters

Test your webhook configuration:
Check the heartbeat run logs:

Error Handling

Connection Failures

Non-2xx Responses

Timeout

Best Practices

Always use HTTPS to protect sensitive data in transit:
Verify requests are from Paperclip using HMAC signatures or shared secrets:
Don’t block HTTP responses for long-running work:
Match timeoutMs to your endpoint’s expected response time:

Troubleshooting

Webhook not receiving requests

Check the heartbeat run logs:
Look for connection errors or DNS resolution failures.

Requests timing out

Increase timeoutMs 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