Skip to main content

Add an approval

Attaches a signed approval to an existing intent. The approval proves the user has authorized the swap and allows it to proceed. After intent creation, you must attach the approval before execution.

info

Learn sample codes of the approval signed data generation.

HTTP request

POST /v1/intents/{intent_id}/approvals/

Request

Header parameters

Requires authentication.

Query parameters

NameTypeRequiredDescription
intent_idStringRequiredIntent ID for approval.

Body parameters

The request body depends on the approval mechanism. It includes the approval type and the signed data generated by the user.

NameTypeRequiredDescription
approval_typeStringRequiredOptions between permit2, cosign, htlc depends on the network.
signed_dataStringRequiredSigned data generated by the user via connected wallet. It must be base64 string for cosign approval type.
Sample request for Permit2 (EVM)
application/json
{
"approval_type": "permit2",
"signed_data": "0x..."
}
Sample request for HTLC (Bitcoin)
application/json
{
"approval_type": "htlc",
"signed_data": "cHNid..."
}
Sample request for Cosign (Solana)
application/json
{
"approval_type": "cosign",
"signed_data": "eyJ0cmFuc2FjdGlvbi..."
}

Response

Successful response

NameTypeDescription
intent_idStringIntent ID for approval.
Sample response for Permit2 (EVM)
application/json
{
"intent_id": "528d72ae-61cd-4fbc-9940-48ce4104abbb"
}
Sample response for HTLC (Bitcoin)
application/json
{
"intent_id": "0a47fbd6-056a-4e4d-a1e3-9b9a1bf947e5"
}
Sample response for Cosign (Solana)
application/json
{
"intent_id": "0a47fbd6-056a-4e4d-a1e3-9b9a1bf947e5"
}

Error response

Check the error response schema.