Skip to main content

Get API Key

developer
GET/v1/keys/:id

Returns 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

Incident Responder

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.

Security Engineer

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.

SOC Analyst

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

NameTypeRequiredDescription
domainstringRequiredAPI key ID (key_* format) as URL path parameterExample: key_m1abc123def456

Response Fields

FieldTypeDescription
key_idstringUnique key identifier
namestringKey name
prefixstringKey prefix (edns_live_ or edns_test_)
hintstringLast 4 characters for identification
environmentstringKey environment: live or test
permissionsarrayGranted permission scopes
rate_limit_overridenumber|nullCustom rate limit
ip_allowlistarrayIP restrictions
expires_atstring|nullKey expiration date (ISO 8601)
last_used_atstring|nullLast activity timestamp
created_atstringCreation timestamp
revoked_atstring|nullRevocation timestamp (null if active)

Code Examples

cURL
curl "https://api.edgedns.dev/v1/keys/:id" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=key_m1abc123def456"
JavaScript
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);
Python
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.

Try This Endpoint

Test the Get API Key endpoint live in the playground.