Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b5x1ufsjyvu9RJFUUb
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
# The approval API over HTTP
|
|
|
|
POST /api/chat (carol: Book VX205)
|
|
-> 200 {"status":"AWAITING_APPROVAL","answer":null,"approvalId":"4dbe1483","calls":[{"key":"call_1","name":"bookFlight","arguments":"{\"flightNumber\":\"VX205\"}"}]}
|
|
ledger: []
|
|
|
|
GET /api/approvals
|
|
-> 200 [{"id":"4dbe1483","conversationId":"c1","requestedBy":"carol","calls":[{"key":"call_1","name":"bookFlight","arguments":"{\"flightNumber\":\"VX205\"}"}]}]
|
|
|
|
POST /api/approvals/4dbe1483/decisions X-Approver: mallory (allow call_1)
|
|
-> 403 {"error":"'mallory' may not approve"}
|
|
ledger: []
|
|
|
|
POST /api/approvals/4dbe1483/decisions X-Approver: alice (no decisions)
|
|
-> 400 {"error":"Every tool call of the reply needs a decision; missing: [call_1]"}
|
|
still pending: true
|
|
|
|
POST /api/approvals/4dbe1483/decisions X-Approver: alice (allow call_1)
|
|
-> 200 {"status":"DONE","answer":"Booked VX205. Reference BK-5.","approvalId":null,"calls":[]}
|
|
ledger: [bookFlight VX205]
|
|
|
|
POST /api/approvals/4dbe1483/decisions X-Approver: bob (the same pause again)
|
|
-> 409 {"error":"approval 4dbe1483 was already resolved"}
|
|
ledger: [bookFlight VX205]
|
|
|
|
POST /api/approvals/nope0000/decisions X-Approver: alice
|
|
-> 404 {"error":"no such approval nope0000"}
|