Changes and improvements to identity endpoints from v1 to v2
This guide covers the changes to identity endpoints between v1 and v2. Both versions provide full identity management capabilities with different API patterns.
GET /v1/identities.getIdentity → POST /v2/identities.getIdentity
Purpose: Retrieve identity data by ID or external ID.Key Changes: GET with query parameters → POST with request body, response format enhanced.
v1 vs v2: Get Identity Request
Copy
Ask AI
# v1: GET with query parameterscurl -X GET "https://api.unkey.dev/v1/identities.getIdentity?externalId=user_123" \ -H "Authorization: Bearer <your-root-key>"# Alternative v1: Using identityIdcurl -X GET "https://api.unkey.dev/v1/identities.getIdentity?identityId=identity_123" \ -H "Authorization: Bearer <your-root-key>"# v2: POST with request body (accepts both ID types)curl -X POST https://api.unkey.com/v2/identities.getIdentity \ -H "Authorization: Bearer <your-root-key>" \ -H "Content-Type: application/json" \ -d '{"identity": "user_123"}'