/transaction/preparePrepare (generate user operation)Build an unsigned operation for the given calls on the UserOperation rail. transferredAssets are the asset(s) the gasless fee is charged against and they drive its percentage part. Sign the returned userOperationHash client-side, then call POST /transaction/submit.
- ugtpFee is { tokenAmount, expectedTokenAmount, feeToken } in base units: tokenAmount is the worst case to reserve against, expectedTokenAmount what the operation is expected to bill.
- authorizationRequired and authorizationNonce say when an EIP-7702 authorization must be attached on submit — the first operation of an account that has not adopted the delegate yet, and never a later one.
- The prepared operation is held server-side for a limited time (default 30 minutes). If it expires before submit, prepare again.
- 409 when the same operation was already materialized.
- Coded 422 when the simulated calldata reverts deterministically: SWAP_AMOUNT_TOO_SMALL when a route rejects the amount as below its minimum, or EXECUTION_SIMULATION_REVERTED with the raw revert reason.
- 404 for an unknown accountId. 400 when that account belongs to another network, or when EIP-7702 is not supported on the target network — there use /transaction/transfer or /swap/plain/prepare, which answer with the rail that does carry the operation.
- 429 when the rate limit is exceeded; check the Retry-After response header.
Authentication: X-API-Key
Input — request body
accountIdstring required- Account id from POST /account/create
networkIdstring required- Chain id
callsCall[] required- Each: { to, data?, value? } (hex)
transferredAssetsAsset[] required- Each: { address, amount } (base-unit hex); drives the percentage fee
feeTokenstring- Fee token address (omit for native-gas)
Input — example request
{
"accountId": "ugtp_account_R4LJbmiFqDsJ",
"networkId": "42161",
"calls": [
{
"to": "0x912ce59144191c1204e64559fe8253a0e49e6548",
"value": "0x0",
"data": "0xa9059cbb...transfer of 2148465421470024202 to 0xCa9d...3c60"
}
],
"transferredAssets": [
{
"address": "0x912ce59144191c1204e64559fe8253a0e49e6548",
"amount": "0x1dd0e1eaf2ee420a"
}
]
}Output — example response (201)
{
"operationId": "ugtp_operation_E6SnXDoAl9AQ",
"userOperation": {
"sender": "0x9b5fcd6f647a14ebf0f88b1c3e5a3d34b951fc6f",
"nonce": "0x2",
"initCode": "0x",
"callData": "0xb61d27f6000000000000000000000000912ce59144191c…228 bytes",
"accountGasLimits": "0x000000000000000000000000000084b800000000000000000000000000014393",
"preVerificationGas": "0xc208",
"gasFees": "0x00000000000000000000000000000000000000000000000000000000016eafe0",
"paymasterAndData": "0x49f26881b5ea4d3f3d451c7faa4bca1b4aebcd97…214 bytes",
"signature": "0x"
},
"userOperationHash": "0x1a4fece09e742c04398006ebdae6d03227aa7e822ba825e0c64b44fc78d12cb3",
"security": {
"verdict": "safe",
"reason": null,
"provider": "checkpoint"
},
"ugtpFee": {
"tokenAmount": "622595557466841530",
"feeToken": "0x912ce59144191c1204e64559fe8253a0e49e6548"
},
"accountType": "eoa_7702",
"authorizationRequired": false
}Output — every status this endpoint answers with
| Status | When |
|---|---|
201 | Prepared operation |
400 | Invalid request body, the referenced account belongs to a different network than the request targets, or (7702-mode projects only) EIP-7702 is not… |
401 | Missing or invalid credentials |
404 | The referenced accountId does not exist. |
409 | Duplicate user operation (same UserOp hash already materialized) |
422 | Unprocessable — either blocked by an unsafe security verdict (returns the prepared operation; enforcement is monitor-only by default), or the… |
429 | Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header |
500 | Internal server error |
503 | Self-funded native rail only, and always retryable — nothing is known to be wrong: code=SELF_FUNDED_ESTIMATE_UNAVAILABLE (the transfer could not be… |