List API Keys

GET /v1/keys/api

List API keys belonging to the calling user. API keys authenticate requests to the management API via the X-API-KEY header — distinct from agent auth tokens, which are presented by tunnel-server agents at handshake.

Account scope & lifecycle: API keys belong to your active account and act as their creator — each inherits the creator's role permissions in that account, resolved live per request. A key created by a member is tied to that member's account membership: when they are removed from (or leave) the account, their keys for it are revoked automatically (requests return 401). An account owner/admin can also revoke any key bound to the account. Use switch account to manage keys in a different account.

Returned keys are masked — the response shows only the first/last few characters of each api_key. The full secret is only visible once at creation time. If a key has been lost, delete it and create a new one rather than trying to recover the value.

Response (200 OK)

items array
Keys ordered by created_at DESC (newest first).
items[].id int64
Numeric ID. Use in DELETE /v1/keys/api/{id}.
items[].user_id int64
Owner user ID — always the calling user.
items[].api_key string
Masked key value (e.g. et_sk_a1b2...f6e7). The full value cannot be retrieved here — recreate the key if you've lost it.
items[].description string
Free-form label. Useful for "this key is used by X service".
items[].allowed_ips string
Optional comma-separated CIDR allow-list. Empty = no IP restriction.
items[].expires_at datetime | null
Expiry timestamp. null for non-expiring keys.
items[].created_at, last_used_at datetime
RFC 3339 UTC timestamps. last_used_at may be the zero time on never-used keys.

Errors

401 Unauthorized
Missing or invalid auth.
Request
curl "https://api.ngris.com/v1/keys/api" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") keys = client.api_keys.list_api_keys() for k in keys["items"]: print(f"#{k['id']} {k['description']} (last used: {k['last_used_at']})")
Response — 200 OK
{ "items": [ { "id": 42, "user_id": 1024, "api_key": "et_sk_a1b2...f6e7", "description": "CI/CD pipeline", "allowed_ips": "10.0.0.0/8", "expires_at": "2027-04-29T00:00:00Z", "created_at": "2026-04-29T12:00:00Z", "last_used_at": "2026-04-29T12:34:56Z" } ] }
On this page
List API Keys
Iris