Base URL
https://api.base44.com/api/apps/69c5e66421adff9edba4b1e3/functions/agentEnrollWebhook
Authentication
All requests must include a shared secret key in the X-Webhook-Secret HTTP header. Contact the Evolution Travel AI team to receive your secret key before go-live.
POST /functions/agentEnrollWebhook HTTP/1.1 Content-Type: application/json X-Webhook-Secret: YOUR_SECRET_KEY
Endpoint
| Method | Path | Description |
|---|---|---|
POST | /functions/agentEnrollWebhook | Push a new agent enrollment from your back-office system |
Request Body Fields
Send a JSON body. Fields marked * are required.
| Field | Type | Description |
|---|---|---|
full_name* | string | Agent's full legal name (first and last) |
email* | string | Agent's email address — used as their login and unique identifier |
phone | string | Agent's phone number (any format) |
referred_by | string | Email address of the upline agent / sponsor who referred this new agent |
referral_code | string | The new agent's own unique referral code from your system |
agency_name | string | Business or agency name (if applicable) |
specialties | string[] | Array of travel specialties, e.g. ["Luxury", "Cruises", "Caribbean"] |
enrollment_date | string (ISO 8601) | Date agent enrolled in your system, e.g. "2026-05-09" |
plan | string | TravelOS subscription tier the agent purchased. Pass "starter" ($29/mo) or "pro" ($49/mo). Defaults to "starter" if omitted. |
Example Request
JSON payload:
{
"full_name": "Jane Smith",
"email": "jane.smith@example.com",
"phone": "+1 555-867-5309",
"referred_by": "john.doe@evolutiontravel.com",
"referral_code": "JANE2025",
"agency_name": "Smith Travel Group",
"specialties": ["Luxury", "Cruises", "Caribbean"],
"enrollment_date": "2026-05-09",
"plan": "pro"
}Full cURL example:
curl -X POST https://api.base44.com/api/apps/69c5e66421adff9edba4b1e3/functions/agentEnrollWebhook \
-H "Content-Type: application/json" \
-H "X-Webhook-Secret: YOUR_SECRET_KEY" \
-d '{
"full_name": "Jane Smith",
"email": "jane.smith@example.com",
"phone": "+1 555-867-5309",
"referred_by": "john.doe@evolutiontravel.com",
"referral_code": "JANE2025",
"agency_name": "Smith Travel Group",
"specialties": ["Luxury", "Cruises", "Caribbean"],
"enrollment_date": "2026-05-09",
"plan": "pro"
}'Response Codes
HTTP 201 Created
{
"success": true,
"lead_id": "abc123xyz",
"message": "Agent enrollment received and processed."
}HTTP 400 Bad Request
{
"error": "full_name and email are required"
}HTTP 409 Conflict
{
"success": false,
"message": "Lead with this email already exists",
"lead_id": "abc123xyz"
}What Happens After a Successful POST
- 1A Lead record is created in our CRM, marked as type agent_recruit and status converted.
- 2If the agent's email already exists in our user database (they've already registered), their profile is upgraded to role travel_agent and pre-filled with phone, agency_name, referral_code, referred_by, and specialties.
- 3A welcome email is automatically sent to the agent's email address with login instructions.
- 4The agent's upline/sponsor (referred_by) is linked in our system for downline tracking.
Additional Notes
Idempotency
If you POST the same email twice, the second call returns a 409 Conflict with the existing lead ID. We do not create duplicates.
Content-Type
Always include Content-Type: application/json in your request headers.
Secret Key Setup
Contact membership@myevolutiontravel.com to receive your X-Webhook-Secret before testing.