Try repository routing
Evaluates a draft routing config for one code-host repository and subject family against a sample event, in the state the hook router builds (event, subject, currentMessage, history, optional pullRequest; the provider and repository are bound here), on the evaluation agent's serving daemon (the saved host, else the first member with a connected one). Settles targets as the router does: every matched rule's member, Otherwise's every member or none, and every member when the evaluation is unavailable. Writes nothing and never stores the sample. Paused, Needs review, and unsupported configurations return not_applied without a model call; 503 when no host daemon is connected.
Authorization
bearerAuth In: header
Path Parameters
Value in
- "github"
- "gitlab"
- "gitea"
^[1-9]\d{0,18}$Value in
- "issues"
- "pull_request"
- "merge_request"
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/orgs/string/decision-routing/github/string/issues/preview" \ -H "Content-Type: application/json" \ -d '{ "config": { "decisionId": "string", "rules": [ { "id": "string", "when": { "type": "choice", "thresholds": { "property1": 0, "property2": 0 } }, "action": { "type": "agent", "agentId": "string" } } ], "enabled": true, "otherwise": { "type": "default_agent" } }, "state": { "event": { "name": "string" }, "subject": {}, "currentMessage": { "sender": { "id": "string" }, "text": "string" } } }'{ "mode": "live", "evaluation": { "status": "answered", "answer": { "type": "boolean", "value": true, "probability": 0 }, "model": "string", "usage": { "inputTokens": 0, "outputTokens": 0 } }, "chain": [ { "stepId": "string", "decisionId": "string", "evaluation": { "status": "answered", "answer": { "type": "boolean", "value": true, "probability": 0 }, "model": "string", "usage": { "inputTokens": 0, "outputTokens": 0 } } } ], "detail": { "seq": 0, "at": "string", "messageId": "string", "title": "string", "decisionId": "string", "outcome": "triggered", "reason": "string", "answer": { "type": "boolean", "value": true, "probability": 0 }, "matchedKeys": [ "string" ], "latencyMs": 0, "requestedModel": "string", "actualModel": "string", "usage": { "inputTokens": 0, "outputTokens": 0 }, "detailsExpired": true, "snapshot": { "decisionId": "string", "providerId": "string", "model": "string", "question": { "type": "choice", "instructions": "string", "criteria": { "property1": "string", "property2": "string" } }, "condition": { "type": "choice", "thresholds": { "property1": 0, "property2": 0 } }, "sessionMode": "string" }, "input": { "agent": { "name": "string", "description": "string" }, "currentMessage": { "id": "string", "sender": { "id": "string" }, "text": "string", "quote": { "sender": "string", "text": "string" }, "threadId": "string", "time": "string", "truncated": true }, "history": [ { "id": "string", "sender": { "id": "string" }, "text": "string", "quote": { "sender": "string", "text": "string" }, "threadId": "string", "time": "string", "truncated": true } ], "historyOmitted": 0, "context": { "partial": true, "reasons": [ "string" ], "omittedMessages": 0 } }, "fullAnswer": { "type": "boolean", "value": true, "probability": 0 }, "chain": [ { "stepId": "string", "decisionId": "string", "evaluation": { "status": "answered", "answer": { "type": "boolean", "value": true, "probability": 0 }, "model": "string", "usage": { "inputTokens": 0, "outputTokens": 0 } } } ], "steps": [ { "stepId": "string", "decisionId": "string", "providerId": "string", "model": "string", "question": { "type": "choice", "instructions": "string", "criteria": { "property1": "string", "property2": "string" } }, "condition": { "type": "choice", "thresholds": { "property1": 0, "property2": 0 } }, "rawRequest": { "text": "string", "truncated": true }, "rawResponse": { "text": "string", "truncated": true } } ], "rawRequest": { "text": "string", "truncated": true }, "rawResponse": { "text": "string", "truncated": true }, "evidence": { "snapshotSeq": 0, "suppliedBackground": 0 } }, "consumer": { "type": "code_host_routing", "outcome": "activate", "notAppliedReason": "paused", "reason": "string", "matchedRuleIds": [ "string" ], "matchedKeys": [ "string" ], "usedOtherwise": true, "targets": [ { "agentId": "string", "name": "string" } ] }}