Cancel agent approval
curl --request POST \
--url https://api.truthlocks.com/v1/approvals/{approvalID}/cancel \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reason": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.truthlocks.com/v1/approvals/{approvalID}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/approvals/{approvalID}/cancel"
payload = { "reason": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/approvals/{approvalID}/cancel"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>",
"requested_by": "<string>",
"status": "pending",
"expires_at": "2023-11-07T05:31:56Z",
"required_approvals": 5,
"current_approvals": 5,
"decisions": [
{
"reviewer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"decision": "approved",
"reason": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "<string>",
"resource": "<string>",
"scope": "<string>",
"justification": "<string>",
"decision_reason": "<string>",
"risk_level": "low",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"decided_at": "2023-11-07T05:31:56Z",
"decided_by": "<string>",
"approval_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Agent approvals (MAIP)
Cancel agent approval
Only the authenticated original requester may cancel a pending, unexpired request. Human users and the same original API key can cancel their own requests. Cancellation preserves the record and earlier reviews.
POST
/
v1
/
approvals
/
{approvalID}
/
cancel
Cancel agent approval
curl --request POST \
--url https://api.truthlocks.com/v1/approvals/{approvalID}/cancel \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reason": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.truthlocks.com/v1/approvals/{approvalID}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/approvals/{approvalID}/cancel"
payload = { "reason": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/approvals/{approvalID}/cancel"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>",
"requested_by": "<string>",
"status": "pending",
"expires_at": "2023-11-07T05:31:56Z",
"required_approvals": 5,
"current_approvals": 5,
"decisions": [
{
"reviewer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"decision": "approved",
"reason": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "<string>",
"resource": "<string>",
"scope": "<string>",
"justification": "<string>",
"decision_reason": "<string>",
"risk_level": "low",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"decided_at": "2023-11-07T05:31:56Z",
"decided_by": "<string>",
"approval_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Only the authenticated original requester may cancel a pending, unexpired request. Human users and the same original API key can cancel their own requests. Cancellation preserves the record and earlier reviews.
See independent agent reviews for the authorization and execution boundaries.
Authorizations
apiKeybearerAuth
Path Parameters
UUID returned when the approval request was created.
Body
application/json
Reason for the decision; nonblank and at most 2000 UTF-8 bytes.
Minimum string length:
1Response
Recorded result
Authenticated requester: human user UUID or api_key:; never a caller-supplied reviewer.
Available options:
pending, approved, rejected, expired, cancelled Required range:
1 <= x <= 10Required range:
0 <= x <= 10Immutable individual reviews. The queue response leaves this empty; get the request for its complete review history.
Show child attributes
Show child attributes
Available options:
low, medium, high, critical Final reviewer or requester cancelling the request; absent while pending.
Alias of id for compatibility.

