Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.anygen.io/llms.txt

Use this file to discover all available pages before exploring further.

External systems can trigger a claw session by calling a webhook endpoint. No login session is required — the webhook_id path parameter itself acts as the bearer secret. Both POST and GET are supported. They have the same behavior; the only difference is how the prompt is passed.

1. Trigger via POST

POST https://www.anygen.io/v1/openapi/anyclaw/webhook/{webhook_id}
Content-Type: application/json
Content-Type can be application/json, text/plain, or any other type. The entire HTTP request body is delivered directly to the claw as the prompt. The body is not parsed, and it does not need to be valid JSON. This makes integration with external systems almost zero-cost. Default webhook payloads from services such as GitHub, Linear, Zapier, and others can be forwarded directly.

Request Body

The body can be any text content. All examples below are valid:
PR #128 has been merged.
{
  "event": "pull_request.merged",
  "pr": 128,
  "title": "fix login bug"
}
hello

Success Response

HTTP 200
{
  "success": true,
  "webhook_id": "wh_xxxxxxxxxxxxxxxxxxxxxx",
  "claw_token": "claw_xxxxxxxxxxxxxxxxxxxxxx",
  "chat_token": "chat_xxxxxxxxxxxxxxxxxxxxxx"
}

Response Fields

FieldDescription
successWhether the webhook trigger request was accepted successfully.
webhook_idThe webhook ID used for this trigger request.
claw_tokenThe token of the claw that will handle the prompt.
chat_tokenThe token of the session created for this webhook trigger. Use it to query message status later.
Execution is asynchronous. When chat_token is returned, the claw may not have started processing yet. The caller should poll the message API to retrieve the reply/status.

2. Trigger via GET

GET triggering is provided for convenient browser or curl usage.
GET https://www.anygen.io/v1/openapi/anyclaw/webhook/{webhook_id}?text=xxx

Query Parameters

ParameterLocationRequiredDescription
textQueryYesThe prompt to deliver to the claw.

Success Response

The response structure is the same as the POST trigger response.
{
  "success": true,
  "webhook_id": "wh_xxxxxxxxxxxxxxxxxxxxxx",
  "claw_token": "claw_xxxxxxxxxxxxxxxxxxxxxx",
  "chat_token": "chat_xxxxxxxxxxxxxxxxxxxxxx"
}

3. Error Responses

HTTP StatusBusiness CodeScenario
404100004002The webhook_id does not exist or has been deleted.
403100004003The webhook is disabled.
500100009000Failed to start the claw session. Check the error field for details.

Disabled Webhook

{
  "success": false,
  "error": "[code=100004003] webhook is disabled"
}

Deleted or Non-existent Webhook

{
  "success": false,
  "error": "[code=100004002] webhook not found"
}

4. cURL Examples

POST Example

The entire request body is used as the prompt.
curl -X POST 'https://www.anygen.io/v1/openapi/anyclaw/webhook/wh_xxxxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{"event":"pull_request.merged","pr":128}'

GET Example

The text query parameter is used as the prompt.
curl 'https://www.anygen.io/v1/openapi/anyclaw/webhook/wh_xxxxxxxxxxxxxxxxxxxxxx?text=hello'