Skip to main content
GET
/
api
/
v1
/
auth
/
keys
/
first
Get First API Key
curl --request GET \
  --url https://api.mor.org/api/v1/auth/keys/first \
  --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 first (oldest) active API key for the current user. This is used for automatic API key selection on login. Returns the oldest active API key, which is typically the user’s primary 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 (always true for this endpoint)
is_default
boolean
Whether this is the default key
encrypted_key
string
Encrypted version of the full key (not shown to user)
encryption_version
integer
Version of encryption used
Automatic Selection: This endpoint is designed for automatic API key selection when users log in. It returns the oldest key, which is typically the user’s primary or first-created key.
Only active API keys are considered. If you have inactive keys, they will not be returned by this endpoint.
If you want to get the user’s preferred API key instead of just the oldest one, use the /api/v1/auth/keys/default endpoint which respects user preferences.