Skip to main content
GET
/
api
/
v1
/
auth
/
keys
/
default
/
decrypted
Get Default API Key Decrypted
curl --request GET \
  --url https://api.mor.org/api/v1/auth/keys/default/decrypted \
  --header 'Authorization: <authorization>'
{
  "id": 123,
  "key": "<string>",
  "key_prefix": "<string>",
  "name": "<string>",
  "created_at": "<string>",
  "is_active": true,
  "is_default": true
}
Get the user’s default API key with the full decrypted key for auto-selection. This endpoint returns the full API key to enable seamless Chat/Test access. The key is decrypted using the user’s Cognito data for security. This is typically used by frontend applications for automatic authentication.

Headers

Authorization
string
required
Bearer token (JWT) from OAuth2 login

Response

id
integer
Unique identifier for the API key
key
string
The full decrypted API key (starts with “sk-”)
key_prefix
string
First few characters of the API key
name
string
Optional name for the API key
created_at
string
ISO 8601 timestamp of creation
is_active
boolean
Whether the key is currently active
is_default
boolean
Whether this is the default key
Security Sensitive: This endpoint returns the full, unencrypted API key. Only use this endpoint when absolutely necessary, such as for automatic authentication flows. Never expose the returned key in client-side code or logs.
Decryption Method: The API key is decrypted using your Cognito user identity as the decryption key. This ensures that only you can decrypt your own API keys, even if the encrypted data is compromised.
Frontend Integration: This endpoint is designed for frontend applications that need to automatically authenticate users for Chat/Test features without requiring them to manually copy-paste their API key.
If no default key is set, this endpoint will return the first (oldest) active API key, similar to the /api/v1/auth/keys/default endpoint.
Rate Limiting: This endpoint may have stricter rate limiting than other endpoints due to its security-sensitive nature. Implement appropriate caching in your application.