Verify a key
Check that an API key is valid and see its environment and scopes.
GET
{BASE_URL}/pingConfirms 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
trueon a200. data.principalstringrequired- Whose key it is:
PARTNERfor your API key, orTECHNOLOGY_PROVIDERfor a Technology Provider's key. data.environmentstringrequiredSANDBOXorPRODUCTION.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#
| Status | Code | Meaning |
|---|---|---|
200 | — | The key is valid. |
401 | open_network_key_invalid | The 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"
}
}