curl -X POST 'https://api.weir.ai/external/validate/key' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json'
{
"data": {
"valid": true,
"clientId": "cli_123456789",
"permissions": ["read", "write"],
"expiresAt": "2025-01-22T00:00:00Z"
},
"message": "API key is valid",
"status": "success"
}
Validate an API key for external access
curl -X POST 'https://api.weir.ai/external/validate/key' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json'
{
"data": {
"valid": true,
"clientId": "cli_123456789",
"permissions": ["read", "write"],
"expiresAt": "2025-01-22T00:00:00Z"
},
"message": "API key is valid",
"status": "success"
}
curl -X POST 'https://api.weir.ai/external/validate/key' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json'
{
"data": {
"valid": true,
"clientId": "cli_123456789",
"permissions": ["read", "write"],
"expiresAt": "2025-01-22T00:00:00Z"
},
"message": "API key is valid",
"status": "success"
}
const validateApiKey = async (apiKey) => {
const response = await fetch('https://api.weir.ai/external/validate/key', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
};
Was this page helpful?