v1
latestOpenAPI 3.1.02026-07-13143194365.4 KBauth
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
| Case | Result | is_new_account |
|---|---|---|
| New user | Creates account and server wallet, returns new API key | true |
| Returning user | Finds existing account, returns existing API key | false |
| Invalid token | 401 Unauthorized | — |
| Token missing identity | 400 Bad Request | — |
Request flow
- User authenticates on the client via the CDP SDK (email, SMS, or social)
- Client sends the CDP Auth Token to this endpoint
- Server validates the token using the CDP SDK
- Server extracts a stable identity from the token
- Server maps the identity to a Grove account
- Creates one if it does not exist
- Reuses it if it does
- Server returns the Grove API key
Identity normalization
- Email: lowercased and trimmed
- User@Example.com → user@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
Example request
{
"earning_address": "0x1234567890abcdef1234567890abcdef12345678",
"evm_eoa_address": "0x1234567890abcdef1234567890abcdef12345678"
}Response
Successful Response