v1

latestOpenAPI 3.1.02026-07-13143194365.4 KB
auth

Exchange CDP Auth Token for Grove API Key

Exchange a CDP Auth Token for a Grove API Key. This endpoint supports both first-time signup and returning user login.

This is the primary signup/login endpoint. The identity used here becomes the account's PRIMARY identity, which is used as the JWT subject and cannot be changed.

To add additional (secondary) identities after signup, use POST /v1/account/identities/verify.

What this endpoint does

Given a valid CDP Auth Token, the server:

  • Verifies the token with CDP
  • Resolves a user identity (email or phone)
  • Finds or creates the corresponding Grove account (identity becomes PRIMARY)
  • Returns a Grove API key (deterministic, long-lived JWT)

This endpoint is idempotent. Repeating the request returns the same account and API key.

Possible outcomes

CaseResultis_new_account
New userCreates account and server wallet, returns new API keytrue
Returning userFinds existing account, returns existing API keyfalse
Invalid token401 Unauthorized
Token missing identity400 Bad Request

Request flow

  1. User authenticates on the client via the CDP SDK (email, SMS, or social)
  2. Client sends the CDP Auth Token to this endpoint
  3. Server validates the token using the CDP SDK
  4. Server extracts a stable identity from the token
  5. Server maps the identity to a Grove account
    • Creates one if it does not exist
    • Reuses it if it does
  6. Server returns the Grove API key

Identity normalization

  • Email: lowercased and trimmed
    • User@Example.comuser@example.com
  • SMS: spaces and dashes removed
    • +1 555-123-4567+15551234567

Notes

  • The CDP SDK creates an EOA wallet, which is stored as the earning wallet
  • Grove creates a developer-managed server wallet for agent and automation use cases
  • The returned API key is deterministic and long-lived
post/v1/auth/exchange-cdp-token

Request body

tokenstring required
networkstring nullable
earning_addressstring nullable

Legacy compatibility field for caller-provided earning/EOA address. Canonical earning address is the Smart Account address. Server-side extraction from CDP token takes priority over this field.

evm_eoa_addressstring nullable

EOA owner of the CDP Smart Account (has exportable private key). Server-side extraction from CDP token takes priority over this field.

referral_codestring nullable

Referral code from an existing user. Only applied on new account creation.

Example request

{
  "earning_address": "0x1234567890abcdef1234567890abcdef12345678",
  "evm_eoa_address": "0x1234567890abcdef1234567890abcdef12345678"
}

Response

Successful Response

account_idstring required
api_keystring required
identity_typestring required
identity_valuestring required
tipping_addressstring nullable required
earning_addressstring nullable
eoa_owner_addressstring nullable
smart_account_addressstring nullable

ERC-4337 Smart Account address (for gas sponsorship)

is_new_accountboolean required
wallet_setup_status'ok' | 'server_failed' | 'unknown'

Outcome of server-side tipping Smart Account deployment during this login.

  • ok: deployed or nothing to do
  • server_failed: deploy attempted but failed
  • unknown: deploy not attempted (non-SA/non-EVM)

Earnings Smart Account deploy status is reported separately by GET /wallets/deployment-status.

referral_codestring nullable
referred_by_account_idstring nullable
can_add_referralboolean
onchain_addressstring nullable required
client_addressstring nullable required
earnings_addressstring nullable required