Skip to main content
POST

Authorizations

Authorization
string
header
required

A JWT signed using the developer's own JWT private key (in the case of JWT authentication), or an end user JWT signed by CDP, encoded in base64. This is used for End User Account APIs.

Headers

X-Wallet-Auth
string
required

A JWT signed using your Wallet Secret, encoded in base64. Refer to the Generate Wallet Token section of our Authentication docs for more details on how to generate your Wallet Token.

Path Parameters

userId
string
required

The ID of the end user.

Pattern: ^[a-zA-Z0-9-]{1,100}$
Example:

"e051beeb-7163-4527-a5b6-35e301529ff2"

address
string
required

The address of the EVM Smart Account to adjust the borrow position for.

Pattern: ^0x[0-9a-fA-F]{40}$

Query Parameters

projectID
string

The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
Example:

"8e03978e-40d5-43e8-bc93-6894a57f9324"

Body

application/json

A request to adjust an existing borrow position for an end user's smart account on the specified borrow product. The request can supply collateral, withdraw collateral, repay debt, and/or borrow more of the loan asset, broadcasting a user operation to apply the changes onchain. A single request must not combine addCollateralAmount with removeCollateralAmount or repayLoanAmount, and must not combine borrowLoanAmount with repayLoanAmount or removeCollateralAmount. Otherwise any subset of the four amount fields may be supplied; at least one is required.

borrowProductId
string
required

The globally unique ID of the borrow product, which is a UUID prefixed with the string bp_.

Pattern: ^bp_[a-f0-9-]{36}$
Example:

"bp_07fb56c0-9afe-5440-8ff2-5b0e115458df"

walletSecretId
string
required

The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth header.

Pattern: ^[a-zA-Z0-9-]{1,100}$
Example:

"e051beeb-7163-4527-a5b6-35e301529ff2"

useCdpPaymaster
boolean
required

Whether to use the CDP Paymaster for the user operation. When true, paymasterUrl must not be set.

Example:

false

addCollateralAmount
string

The amount of collateral to add to the position, as a decimal string in standard unit denomination of the collateral token (i.e. "1" for 1 cbBTC). Must not be combined with removeCollateralAmount or repayLoanAmount.

Pattern: ^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$
Example:

"1"

removeCollateralAmount
string

The amount of collateral to withdraw from the position, as a decimal string in standard unit denomination of the collateral token (i.e. "1" for 1 cbBTC). Must not be combined with addCollateralAmount or borrowLoanAmount.

Pattern: ^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$
Example:

"1"

repayLoanAmount
string

The amount of the loan token to repay, as a decimal string in standard unit denomination of the loan token (i.e. "100" for 100 USDC). Must not be combined with borrowLoanAmount or addCollateralAmount.

Pattern: ^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$
Example:

"100"

borrowLoanAmount
string

The amount of the loan token to borrow, as a decimal string in standard unit denomination of the loan token (i.e. "100" for 100 USDC). Must not be combined with repayLoanAmount or removeCollateralAmount.

Pattern: ^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$
Example:

"100"

paymasterUrl
string<uri>

Paymaster URL to use for the user operation. Must not be set when useCdpPaymaster is true. If useCdpPaymaster is false and no paymasterUrl is set, the smart account must have sufficient funds to cover network fees.

Required string length: 11 - 2048
Pattern: ^https?://.*$
Example:

"https://api.developer.coinbase.com/rpc/v1/base/AbCdEf123456"

paymasterContext
object

Optional paymaster metadata forwarded to the configured paymaster service. Valid only when a paymaster is configured via useCdpPaymaster: true or a paymasterUrl.

Example:

Response

Successfully broadcast the user operation to adjust the borrow position.

A smart account operation response.

network
enum<string>
required

The network the user operation is for.

Available options:
base-sepolia,
base,
arbitrum,
optimism,
zora,
polygon,
bnb,
avalanche,
ethereum,
ethereum-sepolia
Example:

"base"

userOpHash
string
required

The hash of the user operation. This is not the transaction hash, as a transaction consists of multiple user operations. The user operation hash is the hash of this particular user operation which gets signed by the owner of the Smart Account.

Pattern: ^0x[0-9a-fA-F]{64}$
Example:

"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"

calls
object[]
required

The list of calls in the user operation.

Example:
status
enum<string>
required

The status of the user operation.

Available options:
pending,
signed,
broadcast,
complete,
dropped,
failed
Example:

"pending"

transactionHash
string

The hash of the transaction that included this particular user operation. This gets set after the user operation is broadcasted and the transaction is included in a block.

Pattern: ^0x[0-9a-fA-F]{64}$|^$
Example:

"0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"

receipts
object[]

The list of receipts associated with the user operation.

Example:
expiresAt
string<date-time>

The timestamp at which the prepared user operation expires.

Example:

"2025-03-25T12:00:00Z"