import requests
url = "https://platform.ankra.app/chat/plans/{plan_id}/approve"
payload = { "acknowledged_step_orders": [123] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({acknowledged_step_orders: [123]})
};
fetch('https://platform.ankra.app/chat/plans/{plan_id}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/chat/plans/{plan_id}/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"acknowledged_step_orders": [
123
]
}
'"<string>"{
"error_code": "PLAN_ACKNOWLEDGEMENT_REQUIRED",
"payload": {
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unacknowledged_steps": [
{
"step_order": 123,
"tool_name": "<string>",
"description": "<string>",
"risk_level": "<string>",
"reversible": true,
"reason": "irreversible"
}
]
},
"detail": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Approve an AI chat plan and execute its steps (browser session)
Approves an AI plan and executes its steps, streaming progress as server-sent events. Requires ai.execute. High-risk and irreversible steps must be named in acknowledged_step_orders, or the call answers 400 listing them; a plan created before the current plan format answers 410 and has to be proposed again.
import requests
url = "https://platform.ankra.app/chat/plans/{plan_id}/approve"
payload = { "acknowledged_step_orders": [123] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({acknowledged_step_orders: [123]})
};
fetch('https://platform.ankra.app/chat/plans/{plan_id}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/chat/plans/{plan_id}/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"acknowledged_step_orders": [
123
]
}
'"<string>"{
"error_code": "PLAN_ACKNOWLEDGEMENT_REQUIRED",
"payload": {
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unacknowledged_steps": [
{
"step_order": 123,
"tool_name": "<string>",
"description": "<string>",
"risk_level": "<string>",
"reversible": true,
"reason": "irreversible"
}
]
},
"detail": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
step_order values the user explicitly acknowledged. Every step listed in the plan proposal's acknowledgement_required_step_orders (irreversible or high-risk) must appear here, or the approval is refused with 400 PLAN_ACKNOWLEDGEMENT_REQUIRED.
Response
Server-sent event stream of the approval outcome (plan_complete on a session-bound guided run, plan_step_result / plan_complete otherwise, plan_error on a refusal).
The response is of type string.