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)| Parameters | Type | Required | Description |
|---|---|---|---|
| importApiKeyRequest | ImportApiKeyRequest | required | Example: { "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"} } |
| Variable | Type |
|---|---|
| data | ImportedApiKey |