Forlena CRM API

Endpoint Examples

Every current V1 endpoint below includes copy-paste curl and JavaScript snippets.

Before running snippets, set your key:

bash
export FORLENA_API_KEY="fc_your_api_key_here"
GET

List Deals

/deals?limit=10&offset=0

List deals with pagination.

bash
curl -X GET "https://forlena.com/api/v1/crm/deals?limit=10&offset=0" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/deals?limit=10&offset=0", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
POST

Create Deal

/deals

Create a deal in your organization.

bash
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"
}'
javascript
const res = 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"
}),
});

const json = await res.json();
console.log(res.status, json);
GET

Get Deal

/deals/DEAL_ID

Get one deal with stakeholders and recent activities.

bash
curl -X GET "https://forlena.com/api/v1/crm/deals/DEAL_ID" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/deals/DEAL_ID", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
PATCH

Update Deal

/deals/DEAL_ID

Update selected fields on a deal.

bash
curl -X PATCH "https://forlena.com/api/v1/crm/deals/DEAL_ID" \
  -H "Authorization: Bearer $FORLENA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Pilot - Acme Corp (Updated)",
  "lifecycle_stage": "qualified",
  "notes": "Champion identified. Security review in progress."
}'
javascript
const res = await fetch("https://forlena.com/api/v1/crm/deals/DEAL_ID", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "title": "Pilot - Acme Corp (Updated)",
  "lifecycle_stage": "qualified",
  "notes": "Champion identified. Security review in progress."
}),
});

const json = await res.json();
console.log(res.status, json);
DELETE

Delete Deal

/deals/DEAL_ID

Delete a deal.

bash
curl -X DELETE "https://forlena.com/api/v1/crm/deals/DEAL_ID" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/deals/DEAL_ID", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
POST

Analyze Deal (AI)

/deals/DEAL_ID/analyze

Run IMPACT AI analysis for a deal.

bash
curl -X POST "https://forlena.com/api/v1/crm/deals/DEAL_ID/analyze" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/deals/DEAL_ID/analyze", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
POST

Predict Deal (AI)

/deals/DEAL_ID/predict

Run win-probability prediction for a deal.

bash
curl -X POST "https://forlena.com/api/v1/crm/deals/DEAL_ID/predict" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/deals/DEAL_ID/predict", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
GET

List Contacts

/contacts?limit=10&offset=0&q=kim

List contacts (stakeholders) with optional search.

bash
curl -X GET "https://forlena.com/api/v1/crm/contacts?limit=10&offset=0&q=kim" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/contacts?limit=10&offset=0&q=kim", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
POST

Create Contact

/contacts

Create a contact linked to a deal.

bash
curl -X POST "https://forlena.com/api/v1/crm/contacts" \
  -H "Authorization: Bearer $FORLENA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "deal_id": "DEAL_ID",
  "name": "Jane Kim",
  "email": "jane.kim@acme.com",
  "title": "Head of Procurement",
  "role_type": "economic_buyer"
}'
javascript
const res = await fetch("https://forlena.com/api/v1/crm/contacts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "deal_id": "DEAL_ID",
  "name": "Jane Kim",
  "email": "jane.kim@acme.com",
  "title": "Head of Procurement",
  "role_type": "economic_buyer"
}),
});

const json = await res.json();
console.log(res.status, json);
GET

Get Contact

/contacts/CONTACT_ID

Get one contact with linked deal info.

bash
curl -X GET "https://forlena.com/api/v1/crm/contacts/CONTACT_ID" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/contacts/CONTACT_ID", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
PATCH

Update Contact

/contacts/CONTACT_ID

Update contact profile and engagement metadata.

bash
curl -X PATCH "https://forlena.com/api/v1/crm/contacts/CONTACT_ID" \
  -H "Authorization: Bearer $FORLENA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "VP Procurement",
  "influence_level": "high",
  "engagement_level": "medium",
  "sentiment": "positive"
}'
javascript
const res = await fetch("https://forlena.com/api/v1/crm/contacts/CONTACT_ID", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "title": "VP Procurement",
  "influence_level": "high",
  "engagement_level": "medium",
  "sentiment": "positive"
}),
});

const json = await res.json();
console.log(res.status, json);
GET

List Pipeline Stages

/pipeline/stages

List stages for your default pipeline.

bash
curl -X GET "https://forlena.com/api/v1/crm/pipeline/stages" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/pipeline/stages", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
GET

Pipeline Health

/pipeline/health

Get pipeline health summary metrics.

bash
curl -X GET "https://forlena.com/api/v1/crm/pipeline/health" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/pipeline/health", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
GET

Search Deals + Contacts

/search?q=acme

Search both deals and contacts.

bash
curl -X GET "https://forlena.com/api/v1/crm/search?q=acme" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/search?q=acme", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
GET

Daily Briefing (AI)

/briefing

Get daily pipeline briefing insights.

bash
curl -X GET "https://forlena.com/api/v1/crm/briefing" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/briefing", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
GET

Coaching (AI)

/coaching

Get coaching insights from recent win/loss patterns.

bash
curl -X GET "https://forlena.com/api/v1/crm/coaching" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/coaching", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
GET

Usage + Quota

/usage

Get current month API usage with total API quota and AI quota status.

bash
curl -X GET "https://forlena.com/api/v1/crm/usage" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/usage", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
GET

List Webhooks

/webhooks

List webhook endpoints in your organization.

bash
curl -X GET "https://forlena.com/api/v1/crm/webhooks" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/webhooks", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);
POST

Create Webhook

/webhooks

Create a webhook endpoint and subscribe to events.

bash
curl -X POST "https://forlena.com/api/v1/crm/webhooks" \
  -H "Authorization: Bearer $FORLENA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/forlena/webhook",
  "events": [
    "deal.created",
    "deal.updated",
    "analysis.completed"
  ]
}'
javascript
const res = await fetch("https://forlena.com/api/v1/crm/webhooks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "url": "https://example.com/forlena/webhook",
  "events": [
    "deal.created",
    "deal.updated",
    "analysis.completed"
  ]
}),
});

const json = await res.json();
console.log(res.status, json);
DELETE

Delete Webhook

/webhooks/WEBHOOK_ID

Delete a webhook endpoint.

bash
curl -X DELETE "https://forlena.com/api/v1/crm/webhooks/WEBHOOK_ID" \
  -H "Authorization: Bearer $FORLENA_API_KEY"
javascript
const res = await fetch("https://forlena.com/api/v1/crm/webhooks/WEBHOOK_ID", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.FORLENA_API_KEY}`,
  },
});

const json = await res.json();
console.log(res.status, json);