API key API

Get API key info

GET/v1/api-key-info

Who the caller is: the organization and, for an API key, the key itself (name, prefix, scopes, expiry). Answers for any valid key whatever its scopes, so an integration can check what it was given. Never returns the key.

Returns

200 with the fields below.

authstringrequired

How the request was authenticated: `api_key`, `session` (a signed-in user) or `service`.

rolestringrequired

The caller's role in that organization, such as `owner`, `admin` or `member`.

organizationstring

The organization the request acts for.

keyobject

Details of the API key used. Null when the request did not use an API key.

11 properties
idstringrequired

The key's id.

namestringrequired

The name you gave the key.

prefixstringrequired

The first characters of the key, so you can recognize it. The full key is never returned.

full_accessbooleanrequired

True for a key with no scope restriction. Such a key can use every route.

expiredbooleanrequired

True when the key has passed its expiry time.

scopesarray<string>

The scopes the key is limited to. Null when `full_access` is true.

allowed_ipsarray<string>

IP addresses or ranges the key may be used from. Null when unrestricted.

expires_atstring

ISO 8601 time the key expires. Null when it does not expire.

last_used_atstring

ISO 8601 time the key was last used. Null if it never has been.

created_atstring

ISO 8601 time the key was created.

revoked_atstring

ISO 8601 time the key was revoked. Null while it is active.

curl "https://api.dialgem.com/v1/api-key-info" \
  -H "X-API-Key: $DIALGEM_API_KEY"
Response 200
{
  "auth": "string",
  "organization": "string",
  "role": "string",
  "key": {
    "id": "string",
    "name": "Example",
    "prefix": "string",
    "full_access": false,
    "scopes": [
      "string"
    ],
    "allowed_ips": [
      "string"
    ],
    "expires_at": "string",
    "expired": false,
    "last_used_at": "string",
    "created_at": "string",
    "revoked_at": "string"
  }
}