When no native integration fits, build a thin custom connector with the REST API and webhooks.
The pattern
A custom connector is two small pieces:
- Inbound — a script or service in your environment that watches the source system (poll, message queue, file drop) and submits operations via
POST /api/agents/:id/run. - Outbound — a webhook endpoint that receives
operation.completedevents and writes results back to the destination system.
Practical guidance
- Idempotency — include a stable source identifier (document ID, ticket number) in the operation
detailso retries on either side are detectable. - Batching — submit operations individually rather than batching; quota accounting, retries, and escalation all work per-operation.
- Rate limits — the run endpoint allows 60 requests/minute per source. Pace large backfills accordingly.
- Secrets — keep the workspace API key in your secret manager; rotate it from Dashboard → Settings → API keys without redeploying agents.
Example skeleton
// inbound: submit each new document as an operation
const res = await fetch(`https://anysola.com/api/agents/${AGENT_ID}/run`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ANYSOLA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ action: 'DOC_REVIEW', detail: doc.id }),
});