Validate current API key
client.auth.validate(RequestOptionsoptions?): AuthValidateResponse { active, scopes, subjectType, tokenType }
GET/v1/auth/validate
Returns metadata for the current API key, including the subject type and granted public scopes. Use this endpoint to confirm a key is active before making scoped API requests.
Required scope: None
Rate limit category: Read
Validate current API key
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const authValidateResponse = await client.auth.validate();
console.log(authValidateResponse.active);{
"active": true,
"scopes": [
"string"
],
"subjectType": "user",
"tokenType": "api_key"
}Returns Examples
{
"active": true,
"scopes": [
"string"
],
"subjectType": "user",
"tokenType": "api_key"
}