Delegations

Prepare a scoped session-key grant; returns the ONE digest the owner signs

POST/v1/delegations/prepare

Builds the exact Kernel v3.1 permission {call allowlist, expiry, optional rate limit} naming the Cofferline executor as session signer. The scope must fit inside the account's active policy (SPEC §10: delegation ≤ policy). The returned digest is the only thing the account owner ever signs — the permission installs on-chain atomically with the first delegated execution.

Request body

  • account string (required) — The Kernel v3.1 smart account granting scope
  • chain_id object (required)
  • calls object[] (required)
  • valid_after integer
  • valid_until integer (required)
  • rate_limit object

Responses

201Prepared grant with owner-signable digest

  • id string (required)
  • account string (required)
  • chain_id integer (required)
  • status "prepared" | "active" | "revoked" | "expired" (required)
  • permission_id string (required)
  • validation_id string (required)
  • enable_data string (required)
  • kernel_nonce integer (required)
  • digest string (required)
  • session_key string (required)
  • scope object
  • account_deployed boolean
  • valid_until string (required)
  • created_at string (required)
  • confirmed_at string,null (required)
  • revoked_at string,null (required)

403EXECUTION_DISABLED — wallet-specific platform switch
404No policy exists for the account
422Invalid scope or POLICY_VIOLATION
503Executor signer not configured

Example

curl -X POST https://api.cofferline.com/v1/delegations/prepare \
  -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" \
  -d '{"account":"…","chain_id":{},"calls":[{"target":"…","selector":"…","value_limit":"…"}],"valid_until":0}'

Activate a grant by proving the owner signed the enable digest

POST/v1/delegations/{id}/confirm

Verifies the signature against the account's on-chain ECDSA owner and the live Kernel nonce, then activates the delegation for the executor. The permission itself reaches the chain with the first delegated userOp.

Parameters

  • id in path, string (required)

Request body

  • enable_sig string (required)
  • owner string

Responses

200Delegation active

  • id string (required)
  • account string (required)
  • chain_id integer (required)
  • status "prepared" | "active" | "revoked" | "expired" (required)
  • permission_id string (required)
  • validation_id string (required)
  • enable_data string (required)
  • kernel_nonce integer (required)
  • digest string (required)
  • session_key string (required)
  • scope object
  • account_deployed boolean
  • valid_until string (required)
  • created_at string (required)
  • confirmed_at string,null (required)
  • revoked_at string,null (required)

400Signature does not recover to the account owner
404Unknown delegation or missing policy
409Counterfactual account mismatch, stale nonce, or wrong status
422POLICY_VIOLATION — the active policy no longer covers this grant

Example

curl -X POST https://api.cofferline.com/v1/delegations/{id}/confirm \
  -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" \
  -d '{"enable_sig":"…"}'

Fetch one delegation

GET/v1/delegations/{id}

Parameters

  • id in path, string (required)

Responses

200The delegation

  • id string (required)
  • account string (required)
  • chain_id integer (required)
  • status "prepared" | "active" | "revoked" | "expired" (required)
  • permission_id string (required)
  • validation_id string (required)
  • enable_data string (required)
  • kernel_nonce integer (required)
  • digest string (required)
  • session_key string (required)
  • scope object
  • account_deployed boolean
  • valid_until string (required)
  • created_at string (required)
  • confirmed_at string,null (required)
  • revoked_at string,null (required)

404Unknown delegation

Example

curl -X GET https://api.cofferline.com/v1/delegations/{id} \
  -H "authorization: Bearer $TOKEN"

Revoke a delegation; returns owner-calldata for on-chain finality

DELETE/v1/delegations/{id}

The executor stops honoring the grant immediately. On-chain removal is the owner's own transaction (returned here as calldata) — revocation never requires Cofferline.

Parameters

  • id in path, string (required)

Responses

200Revoked

  • id string (required)
  • status "revoked" (required)
  • revocation object (required)

403The delegation's wallet is outside the key's wallet scope (#289)
404Unknown delegation

Example

curl -X DELETE https://api.cofferline.com/v1/delegations/{id} \
  -H "authorization: Bearer $TOKEN"

Renew an active grant: identical scope, fresh expiry, ONE new owner signature

POST/v1/delegations/{id}/renew

Prepares a NEW grant with the same call allowlist and rate limit but a fresh valid_until (default: the original's duration, capped at 90 days). The old grant stays active until its natural expiry — no authority gap. The returned digest is signed and confirmed exactly like prepare. The scope is re-checked against the CURRENT policy (#18).

Parameters

  • id in path, string (required)

Request body

  • valid_until integer

Responses

201Renewal prepared with a fresh owner-signable digest

  • id string (required)
  • account string (required)
  • chain_id integer (required)
  • status "prepared" | "active" | "revoked" | "expired" (required)
  • permission_id string (required)
  • validation_id string (required)
  • enable_data string (required)
  • kernel_nonce integer (required)
  • digest string (required)
  • session_key string (required)
  • scope object
  • account_deployed boolean
  • valid_until string (required)
  • created_at string (required)
  • confirmed_at string,null (required)
  • revoked_at string,null (required)

403EXECUTION_DISABLED — wallet-specific platform switch
404Unknown delegation or missing policy
409Only active delegations renew
422POLICY_VIOLATION — the current policy no longer covers this scope
503Executor signer not configured

Example

curl -X POST https://api.cofferline.com/v1/delegations/{id}/renew \
  -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" \
  -d '{}'

List delegations (newest first)

GET/v1/delegations

Parameters

  • account in query, string
  • limit in query, integer

Responses

200Your delegations

Example

curl -X GET https://api.cofferline.com/v1/delegations \
  -H "authorization: Bearer $TOKEN"