Skip to main content
GET
/
api
/
v1
/
auth
/
keys
/
default
Get Default API Key
curl --request GET \
  --url https://api.mor.org/api/v1/auth/keys/default \
  --header 'Authorization: <authorization>'
{
  "id": 123,
  "key_prefix": "<string>",
  "name": "<string>",
  "created_at": "<string>",
  "is_active": true,
  "is_default": true,
  "encrypted_key": "<string>",
  "encryption_version": 123
}
Get the user’s default API key. If no default is set, returns the first (oldest) active API key. This respects user preference for default key selection and is the recommended way to get the user’s preferred API key.

Headers

Authorization
string
required
Bearer token (JWT) from OAuth2 login

Response

id
integer
Unique identifier for the API key
key_prefix
string
First few characters of the API key (e.g., “sk-1234”)
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 (true if explicitly set)
encrypted_key
string
Encrypted version of the full key (not shown to user)
encryption_version
integer
Version of encryption used
Intelligent Fallback: If no default key is explicitly set, this endpoint automatically falls back to the first (oldest) active API key. This ensures users always get a usable key even if they haven’t set a default.
Setting a Default: Use the PUT /api/v1/auth/keys/{key_id}/default endpoint to explicitly set a default key. This is useful if you have multiple API keys and want to designate one as your primary key.
Check the is_default field to determine whether the returned key is an explicitly set default (true) or a fallback to the first key (false).