Approve and execute an OAuth tool intent
Only an organization owner in a signed-in session may approve.
POST
Only an organization owner in a signed-in session may approve. Claims a pending, unexpired request once, then executes its exact calls with the original OAuth authority. Repeating a decision returns the existing receipt. Execution is never retried automatically; a failed receipt can mean some actions completed, and must be reconciled before another request is created.
apiKeyheader
x-api-key<token>id*stringMatch
^apr_[0-9a-hjkmnp-tv-z]{16,24}$ApprovalRequest
application/json- response
id*ApprovalRequestIdMatch
^apr_[0-9a-hjkmnp-tv-z]{16,24}$organizationId*OrganizationIdMatch
^org_[0-9a-hjkmnp-tv-z]{16,24}$namespaceId*|nullclientId*stringrequestedBy*UserIdMatch
^user_[0-9a-hjkmnp-tv-z]{16,24}$intent*stringcalls*array<>Items
1 <= items <= 20status*stringValue in
"pending""executing""executed""rejected""failed""expired"expiresAt*stringcreatedAt*stringdecidedAt*string|nulldecidedBy*|nullreason*string|nullresults*array<any>|nullerror*string|nullapprovalUrl*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.approvalRequests.approve({
"id": "example"
});Example Response
{
"id": "string",
"organizationId": "string",
"namespaceId": "string",
"clientId": "string",
"requestedBy": "string",
"intent": "string",
"calls": [
{
"toolName": "string",
"arguments": {
"property1": "string",
"property2": "string"
}
}
],
"status": "pending",
"expiresAt": "string",
"createdAt": "string",
"decidedAt": "string",
"decidedBy": "string",
"reason": "string",
"results": [],
"error": "string",
"approvalUrl": "string"
}