Get API Key
developer/v1/keys/:idReturns comprehensive metadata and configuration for a specific API key identified by its key ID. Shows name, environment, full permission scopes, IP allowlist, rate limit override, usage statistics (last_used_at), and expiration status — without ever exposing the actual key value. Essential for security investigations, access reviews, and permission verification.
What It Does
Fetches complete details for an API key by its ID, scoped to the authenticated organization. Returns all configuration fields including permissions, IP allowlist, rate limit override, environment, expiration, and usage metadata (last_used_at, created_at, revoked_at). The key hash and salt are never returned — only management metadata is exposed.
Why It's Useful
Deep-dive into individual key configuration for security investigations, access reviews, and troubleshooting. During incident response, quickly verify what permissions a potentially compromised key has and what IP restrictions limit its use. For compliance, document per-key access controls as evidence for SOC 2 CC6.1 and ISO 27001 A.9.4 audits.
Use Cases
Security Incident Investigation
A key may have been exposed in a code repository. Immediately check its permissions scope, IP allowlist, last usage time, and environment to assess the blast radius before deciding on revocation.
Rapid risk assessment of exposed keys — determine if the key has dangerous permissions or was recently used from unexpected locations.
Permission Verification
Before granting a key access to a new application, verify its current permissions follow least-privilege principles and its IP allowlist matches the expected deployment network.
Prevent privilege creep by verifying permissions before expanding key usage.
Usage Forensics
Review key last_used_at timestamps and environment during security audit to identify dormant keys or keys used outside expected patterns.
Detect anomalous key usage patterns that may indicate compromise or misuse.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Required | API key ID (key_* format) as URL path parameterExample: key_m1abc123def456 |
Response Fields
| Field | Type | Description |
|---|---|---|
key_id | string | Unique key identifier |
name | string | Key name |
prefix | string | Key prefix (edns_live_ or edns_test_) |
hint | string | Last 4 characters for identification |
environment | string | Key environment: live or test |
permissions | array | Granted permission scopes |
rate_limit_override | number|null | Custom rate limit |
ip_allowlist | array | IP restrictions |
expires_at | string|null | Key expiration date (ISO 8601) |
last_used_at | string|null | Last activity timestamp |
created_at | string | Creation timestamp |
revoked_at | string|null | Revocation timestamp (null if active) |
Code Examples
curl "https://api.edgedns.dev/v1/keys/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "domain=key_m1abc123def456"const response = await fetch(
'https://api.edgedns.dev/v1/keys/:id?domain=key_m1abc123def456',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(data);import requests
response = requests.get(
'https://api.edgedns.dev/v1/keys/:id',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'domain': 'key_m1abc123def456'
}
)
data = response.json()
print(data)Read the full Get API Key guide
Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.
Read the guide →Related Endpoints
External References
Learn more about the standards and protocols behind this endpoint.