Authorization

The authorization system handles session key registration and JWT token generation using EIP-712 signature verification. Once you have a JWT token, include it as a Bearer token in all subsequent API requests.

Authorization Flow

spinner

Authorize Session Key

Submit a session key for authorization with EIP-712 signature verification. Returns a JWT token for authenticated API access.

POST /v1/authorize

Headers

Header
Required
Description

Content-Type

Yes

application/json

x-authorization-signature

Yes

EIP-712 signature of the authorization message

Request Body

Field
Type
Required
Description

smartAccountAddress

string

Yes

Smart account address (0x-prefixed)

privateKey

string

Yes

Session key private key

serializedSessionKey

string

Yes

Serialized session key permission data

eoaAddress

string

Yes

Owner EOA wallet address (0x-prefixed)

chainId

number

Yes

Blockchain network ID (positive integer)

nonce

number

Yes

Replay protection nonce (non-negative integer)

EIP-712 Signature Details

The authorization message must be signed using EIP-712 typed data with the following structure:

Domain:

Types:

The signature must be produced by the EOA that owns the smart account. The server recovers the signer address and verifies it matches eoaAddress.

Example Request

Response (201 Created)

Error Responses

Status
Condition

400

Missing x-authorization-signature header or request body validation failed

401

Invalid EIP-712 signature (recovered address doesn't match eoaAddress)

500

Internal server error


Using Your Token

After authorization, store the JWT token and include it in all API requests as a Bearer token in the Authorization header.

If your token is invalid or your balance is insufficient, you will receive:

Status
Meaning

401

Token is invalid or expired -- re-authorize to get a new token

402

Insufficient balance -- deposit USDC to your smart account

Last updated