1. Generate API Key
Your organization admin can create keys directly in Forlena CRM: Admin -> Developer -> Create API Key. You only see the plaintext key once, so store it safely.
text
Authorization: Bearer fc_your_api_key_hereForlena CRM API
Use this guide to authenticate, create your first deal, run AI once, and confirm usage/quota.
Your organization admin can create keys directly in Forlena CRM: Admin -> Developer -> Create API Key. You only see the plaintext key once, so store it safely.
Authorization: Bearer fc_your_api_key_hereAvoid hardcoding API keys in scripts or source code.
export FORLENA_API_KEY="fc_your_api_key_here"curl -X POST "https://forlena.com/api/v1/crm/deals" \
-H "Authorization: Bearer $FORLENA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Pilot - Acme Corp",
"company_name": "Acme Corp",
"value": 24000,
"currency": "USD"
}'const createDeal = await fetch("https://forlena.com/api/v1/crm/deals", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
title: "Pilot - Acme Corp",
company_name: "Acme Corp",
value: 24000,
currency: "USD",
}),
});
console.log(await createDeal.json());curl -X GET "https://forlena.com/api/v1/crm/deals?limit=10&offset=0" \
-H "Authorization: Bearer $FORLENA_API_KEY"const listDeals = await fetch(
"https://forlena.com/api/v1/crm/deals?limit=10&offset=0",
{ headers: { Authorization: `Bearer ${process.env.FORLENA_API_KEY}` } }
);
console.log(await listDeals.json());Replace DEAL_ID with a real deal UUID from step 4.
curl -X POST "https://forlena.com/api/v1/crm/deals/DEAL_ID/analyze" \
-H "Authorization: Bearer $FORLENA_API_KEY"const analyzeDeal = await fetch(
"https://forlena.com/api/v1/crm/deals/DEAL_ID/analyze",
{
method: "POST",
headers: { Authorization: `Bearer ${process.env.FORLENA_API_KEY}` },
}
);
console.log(await analyzeDeal.json());curl -X GET "https://forlena.com/api/v1/crm/usage" \
-H "Authorization: Bearer $FORLENA_API_KEY"const usage = await fetch("https://forlena.com/api/v1/crm/usage", {
headers: { Authorization: `Bearer ${process.env.FORLENA_API_KEY}` },
});
console.log(await usage.json());Quota headers are exposed for both total API quota and AI quota:X-API-Quota-LimitX-API-Quota-UsedX-API-Quota-RemainingX-API-Quota-ResetX-AI-Quota-LimitX-AI-Quota-UsedX-AI-Quota-RemainingX-AI-Quota-Reset
Admin usage alerts are shown in the Developer dashboard (80% and 95%). No automatic quota alert emails are sent.