New Ory Agent Security is now live! Claim your complimentary test drive. Get Started!

Skip to main content

Import API Key

POST 

/v2alpha1/admin/importedApiKeys

Imports an external API key into the system. Allows importing keys from legacy systems or external providers. The raw key is hashed and stored securely (HMAC). Imported keys support token derivation (JWT/Macaroon) like issued keys.

POST /v2alpha1/admin/importedApiKeys
{
"raw_key": "imported-key-EXAMPLE-not-a-real-secret",
"name": "Example imported key",
"actor_id": "user_123"
}
SDK ReferenceTypeScript
adminImportApiKey(importApiKeyRequest)
ParametersTypeRequiredDescription
importApiKeyRequestImportApiKeyRequestrequiredExample: { "raw_key": "imported-key-EXAMPLE-not-a-real-secret", "name": "Example imported key", "actor_id": "payment-processor", "scopes": ["read", "write"], "ttl": "8760h", // 1 year (also accepts: 31536000s) "metadata": {"source": "example-provider", "environment": "staging"} }
VariableType
dataImportedApiKey