POST /v1-lead
The most strategically important endpoint in the stack. Captures a user’s name and phone number directly from the LLM conversation — no redirect to a website required.
The lead is created in HubSpot with the exact source_ai (chatgpt, claude, gemini…) so the Funos team can segment and prioritise contacts by source channel.
Body (JSON)
| Field | Type | Required | Description |
|---|
name | string | ✅ Yes | User’s name |
contact | string | ✅ Yes | Phone number (preferred) or email |
source | string | ✅ Yes | Origin: ai_chatgpt, claude, gemini, other |
notes | string | No | Conversation context: city, service type, etc. |
Request example
curl -X POST \
"https://qegraxvwwikrltmtfamo.supabase.co/functions/v1/v1-lead" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "María García",
"contact": "612345678",
"source": "ai_chatgpt",
"notes": "Interested in cremation in Madrid. Budget: up to €2,000."
}'
const res = await fetch(
'https://qegraxvwwikrltmtfamo.supabase.co/functions/v1/v1-lead',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'María García',
contact: '612345678',
source: 'ai_chatgpt',
notes: 'Interested in cremation in Madrid. Budget: up to €2,000.'
})
}
);
const data = await res.json();
Successful response (200 OK)
{
"data": {
"lead_created": true,
"message": "Your request has been registered. The Funos team will be in touch with you shortly."
},
"meta": {
"version": "1.0",
"timestamp": "2026-03-21T10:00:00Z",
"source": "funos-api",
"source_ai": "ai_chatgpt"
},
"cta": {
"text": "You can also manage your request at Funos",
"url": "https://funos.es/?utm_source=ai&utm_medium=api&utm_campaign=lead"
},
"error": null
}
Recommended flow for GPT Actions
This is the flow LLMs should follow to capture leads naturally:
1. User asks for price → GET /v1-quote-funeral-service
2. GPT presents prices with CTA
3. User shows interest → GPT asks:
"Would you like us to contact you for more information?
I just need your name and phone number."
4. User provides details → POST /v1-lead
5. GPT confirms: "Great, the Funos team will call you shortly."
The notes field is especially valuable: include the conversation context here (city, service type, mentioned budget, urgency). The Funos team uses this to prepare the sales call.
Valid source values
| Value | Use |
|---|
ai_chatgpt | Lead from ChatGPT / GPT Action |
claude | Lead from Claude / MCP Server |
gemini | Lead from Gemini (Vertex AI) |
perplexity | Lead from Perplexity |
other | Any other origin |
Possible errors
| Code | Error | Description |
|---|
400 | MISSING_FIELDS | Required fields missing: name, contact, or source |
400 | INVALID_CONTACT | Phone/email format is invalid |
401 | UNAUTHORIZED | Invalid API Key |
429 | RATE_LIMIT_EXCEEDED | Request limit exceeded |
400 Response — missing fields
{
"data": null,
"error": {
"code": "MISSING_FIELDS",
"message": "The fields name, contact and source are required."
}
}
Privacy and consent
Explicit consent required. Before requesting personal data from the user, the LLM must inform them that their data will be shared with Funos and processed according to Funos’s privacy policy. In GPT Actions, OpenAI’s native consent modal handles this step automatically.
Lead data is stored in HubSpot (EU) and processed in accordance with GDPR. Funos never uses lead data for purposes other than managing the requested service commercially.
GPT Action description
Registers a user's purchase intent in the Funos CRM (HubSpot).
Use ONLY when the user has explicitly confirmed they want to be contacted,
has provided their name and phone number, and has given consent to share
their data with Funos. Include relevant conversation context in notes.