Agents
Cancel a turn that has not started
Retracts a queued turn before it starts. A turn stays queued while
the agent works on its earlier turns. Idempotent: a turn that has
already finished answers 200 with cancelled: false. A turn that
has started returns 400; stop it with
POST /v1/sessions/{id}/stop instead. 409 means the cancel’s
outcome is not known yet; retry it.
Retries: safe without an Idempotency-Key: a repeat converges on the same cancelled state.
POST
/
v1
/
agents
/
{id}
/
turns
/
{sessionId}
/
cancel
Cancel a turn that has not started
curl --request POST \
--url https://api.lusor.ai/v1/agents/{id}/turns/{sessionId}/cancel \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.lusor.ai/v1/agents/{id}/turns/{sessionId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/agents/{id}/turns/{sessionId}/cancel"
payload = { "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"sessionId": "<string>",
"status": "<string>",
"cancelled": true,
"invocationId": "<string>",
"invocationCancelled": true
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
ApiKeyBearerAuth
Path Parameters
Was this page helpful?
⌘I
Cancel a turn that has not started
curl --request POST \
--url https://api.lusor.ai/v1/agents/{id}/turns/{sessionId}/cancel \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.lusor.ai/v1/agents/{id}/turns/{sessionId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/agents/{id}/turns/{sessionId}/cancel"
payload = { "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"sessionId": "<string>",
"status": "<string>",
"cancelled": true,
"invocationId": "<string>",
"invocationCancelled": true
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}
