Exchange a long-lived API key for a short-lived JWT access token (15 minutes).
This provides enhanced security by minimizing API key exposure.
Permissions and Scope:
- All permissions, scopes, and home access are automatically determined by the API key
- No need to specify permissions in the request body
- The generated token will have all permissions associated with the API key
Rate Limits:
- Production: 10/min, 100/hour, 1000/day per API key
- Test/Development: 30/min, 100/hour, 500/day per API key
Security Features:
- Tokens expire automatically after 15 minutes
- IP-based monitoring and abuse detection
- Comprehensive audit logging
Usage Pattern:
- Exchange API key for access token at secure endpoint
- Use access token for API calls (never use API key directly)
- Re-exchange when token expires (every 15 minutes)
This follows OAuth 2.0 Token Exchange (RFC 8693) patterns.
Security
Bearer
Token exchange request parameters
POST
curl -i -X POST \
https://data.logmycare.co.uk/openapi/auth/token/exchange \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-H 'User-Agent: string' \
-H 'X-Forwarded-For: string' \
-d '{
"grant_type": "api_key_exchange",
"api_key": "sk_live_abcd1234..."
}'Token exchange successful
Granted permissions/scope
Example:
[ "residents:read", "careplans:read" ]
Response
{ "access_token": "eyJhbGciOiJIUzI1NiI...", "token_type": "Bearer", "expires_in": 900, "scope": [ "residents:read", "careplans:read" ], "issued_token_type": "urn:ietf:params:oauth:token-type:jwt" }