Submit the owner's signature and persist the grant
Changed onRecomputes the grant from the echoed prepare fields, verifies the signature recovers to the authenticated owner, re-checks the entity allocation inside the write, and stores the policy as pending. The install itself rides the first workflow operation on this wallet — nothing reaches the chain here.
This REPLACES the runner's previous grants. A wallet carries at most one usable grant: the send path resolves exactly one and refuses to execute when it finds more, so grants do not stack. Every other usable grant on this runner is revoked as part of this call, and the ones revoked come back in supersededPolicyIds. There is no flag to opt out, and clients do not need to revoke the previous grant first.
Replacement is scoped to the runner, not to a capability: submitting a grant for one capability revokes the runner's grant for any other.
The deferred batch that installs the new grant also uninstalls up to four prior validation entities (#717). The owner signs that batch once, at prepare. Replacing a grant does not leave the old entities installed until a separate uninstallValidation signature. DELETE of an already-applied grant is different: the controller cannot call uninstallValidation itself, so that response still carries onChainCleanup for the owner wallet.
When basePolicyId is sent, including an empty string, the runner's usable grant must still be that value or the call is 409 SESSION_POLICY_BASE_CHANGED. That code also covers a carried grant whose signed permissions no longer match a fresh merge: the remaining limit moved, the running set changed, or both. The grant id can be unchanged. Prepare again.
When a grant was carried, the stored grant is refused with 409 SESSION_POLICY_NOT_COVERING only when it covers less of an enabled task than the current grant did. Tasks listed in dropTaskIds are the ones this grant may leave uncovered. When there is no current grant, the stored grant must still cover every enabled task on this runner except those ids, or the call is 409 SESSION_POLICY_NOT_COVERING and nothing is stored. A missing prepare snapshot (restart, or the prepare was evicted) uses that same per-task check.
Request
- Base URLhttps://api.avaprotocol.org/api/v1
- AuthHTTP bearer
Request body
Example request
{
"budget": {
"erc20": [
{
"token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"amount": "500000000"
}
],
"native": {
"amount": "10000000000000000"
},
"removeActions": [
{
"target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
}
]
},
"chainId": 11155111,
"policyId": "01JG2FE5MDVKBPHEG0PEYSDKAC",
"allowedActions": [
{
"target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
}
],
"erc20SpendCap": {
"token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"amount": "500000000"
},
"erc20SpendCaps": [
{
"token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"amount": "500000000"
}
],
"nativeRecipients": [
"0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
],
"delegatedNativeRecipients": [
{
"recipient": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"delegate": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
}
],
"nativeSpendCap": {
"amount": "10000000000000000"
}
}Response
Grant stored; the gateway may now execute within it.
Example response
{
"id": "01JG2FE5MDVKBPHEG0PEYSDKAC",
"runner": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"chainId": 11155111,
"sessionSigner": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"budgetStartAmounts": [
{
"token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"amount": "500000000"
}
],
"budgetStartNative": {
"amount": "10000000000000000"
},
"allowedActions": [
{
"target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
}
],
"erc20SpendCap": {
"token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"amount": "500000000"
},
"erc20SpendCaps": [
{
"token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"amount": "500000000"
}
],
"nativeRecipients": [
"0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
],
"delegatedNativeRecipients": [
{
"recipient": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
"delegate": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
}
],
"nativeSpendCap": {
"amount": "10000000000000000"
},
"onChainCleanup": {
"target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
},
"supersededPolicyIds": [
"01JG2FE5MDVKBPHEG0PEYSDKAC"
]
}Changes
- info
added the new optional request property
- info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status
- info
- info
added the new optional request property
- info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status
- info