GET /whoami
Verify your API key and retrieve tenant information.
Request
GET /tenant/whoami
Headers
| Header | Required | Description |
|---|---|---|
| X-API-Key | Yes | Your API key |
Response
{
"apiKeyId": "abc123xyz"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| apiKeyId | string | The ID of the API key used for this request |
Examples
cURL
curl -X GET "https://api.votito.com/tenant/whoami" \
-H "X-API-Key: vtt_your_api_key"
JavaScript
const verifyApiKey = async () => {
const response = await fetch('https://api.votito.com/tenant/whoami', {
headers: { 'X-API-Key': process.env.VOTITO_API_KEY }
});
if (!response.ok) {
throw new Error('Invalid API key');
}
return response.json();
};
Use Cases
Verify API Key
Use this endpoint to verify that your API key is valid and properly configured:
try {
const { tenantId } = await verifyApiKey();
console.log(`Connected to tenant: ${tenantId}`);
} catch (error) {
console.error('API key verification failed');
}
Health Checks
Include this endpoint in your monitoring to detect API key issues early:
const healthCheck = async () => {
const start = Date.now();
await verifyApiKey();
return { status: 'healthy', latencyMs: Date.now() - start };
};