Verify a key

Check that an API key is valid and see its environment and scopes.

GET{BASE_URL}/ping

Confirms that a key is accepted, and reports what it can do. Needs a valid key but no scope. Use it when you deploy a new key, and as a credentials check in your own health monitoring.

Response

data.okbooleanrequired
Always true on a 200.
data.principalstringrequired
Whose key it is: PARTNER for your API key, or TECHNOLOGY_PROVIDER for a Technology Provider's key.
data.environmentstringrequired
SANDBOX or PRODUCTION.
data.scopesstring[]required
The key's scopes: any of REGISTRATION, UPDATE, INVENTORY, PAYMENT.
data.keyPrefixstringrequired
The key's public prefix, such as lok_sbx_ab3kq7mz.

A Technology Provider's key gets a different shape — the provider instead of scopes, and a partner's connection when it sends X-Localoy-Partner-Id. See Verifying a key.

Status codes#

StatusCodeMeaning
200—The key is valid.
401open_network_key_invalidThe key is missing, malformed, unknown, revoked or expired.
429—Rate limited.
curl "$LOCALOY_BASE_URL/ping" \
  -H "Authorization: Bearer $LOCALOY_API_KEY"
Response · 200
{
  "success": true,
  "data": {
    "ok": true,
    "principal": "PARTNER",
    "environment": "SANDBOX",
    "scopes": ["REGISTRATION", "UPDATE", "INVENTORY"],
    "keyPrefix": "lok_sbx_ab3kq7mz"
  }
}