Sign in to HeyRik
Open the HeyRik dashboard with the account that owns the agents and calls you want to manage.
Create your HeyRik API key, store it safely, authenticate your first request, and resolve common access errors.
A HeyRik API key authenticates your server to the HeyRik API. It is scoped to the account that created it, so requests only access that account's agents, phone numbers, calls, campaigns, and balance.
Keep it on your server. Never place it in browser code, a mobile application, screenshots, public repositories, or support messages.
Create the key from your HeyRik dashboard before making API requests.
Open the HeyRik dashboard with the account that owns the agents and calls you want to manage.
Go to the API section and choose API keys.
Give the key a recognizable name for the environment or service using it.
Save the generated key immediately in your secure environment configuration.
Use an environment variable so the key stays separate from application code.
HEYRIK_API_KEY=cg_live_xxxxxxxxxxxxconst apiKey = process.env.HEYRIK_API_KEY;
if (!apiKey) {
throw new Error("HEYRIK_API_KEY is not configured");
}Add local environment files to .gitignore. In production, use the encrypted secret or environment-variable system provided by your hosting platform.
HeyRik accepts either a Bearer token or the X-API-Key header. Choose one approach and use it consistently.
curl https://server.heyrik.com/api/v1/agents \
-H "Authorization: Bearer $HEYRIK_API_KEY"curl https://server.heyrik.com/api/v1/agents \
-H "X-API-Key: $HEYRIK_API_KEY"const response = await fetch("https://server.heyrik.com/api/v1/agents", {
headers: {
Authorization: `Bearer ${process.env.HEYRIK_API_KEY}`,
},
});
if (!response.ok) {
throw new Error(`HeyRik API error: ${response.status}`);
}
const { data: agents } = await response.json();List agents to confirm that the key is valid and connected to the expected account.
curl https://server.heyrik.com/api/v1/agents \
-H "Authorization: Bearer $HEYRIK_API_KEY"{
"data": [
{
"id": "agc_9f2a1c30",
"name": "Support Agent",
"language": "en-IN",
"created_at": "2026-07-24T06:11:44.201Z"
}
]
}Use the HTTP status and error code to find the likely cause.
missing_api_keyAdd Authorization: Bearer … or X-API-Key to the request.
invalid_api_keyCheck for missing characters, extra spaces, or a key that was replaced.
forbiddenThe key is valid but the requested action is not allowed for this account.
not_foundThe resource may belong to another account. Keys only see their own account’s data.
rate_limitedSlow down requests and retry with backoff.
Complete these checks before using the key in production.
Email info@heyrik.com and describe the error code. Never include the key itself.