Saltar al contenido principal
POST
/
leads
curl --request POST \
  --url https://api.getnexor.ai/api/public/leads \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "phone": "+1234567890",
  "workflow_id": "uuid-of-workflow",
  "campaign_id": "uuid-of-campaign"
}
'
{
  "success": true,
  "lead": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "phone": "+1234567890",
    "source": "api",
    "company": null,
    "title": null,
    "metadata": {},
    "created_at": "2026-02-10T12:00:00Z"
  },
  "workflow_run": {
    "id": "uuid",
    "job_id": "job-123",
    "workflow": {
      "id": "uuid",
      "name": "Sales Outreach"
    },
    "cadence": {
      "stepIndex": 0,
      "channel": "call",
      "attemptNumber": 1,
      "maxAttempts": 3,
      "totalSteps": 5
    }
  }
}
Mapeo automático de metadataCualquier clave en el cuerpo de la solicitud que no sea una columna principal del lead (first_name, last_name, email, phone, workflow_id, campaign_id, force_first_message) será automáticamente mapeada al objeto metadata. Esto significa que puedes pasar campos extra al nivel superior sin envolverlos explícitamente en metadata.Por ejemplo, enviar { "first_name": "Tony", "edad": 35, "broker": "Tony" } es equivalente a { "first_name": "Tony", "metadata": { "edad": 35, "broker": "Tony" } }.Si proporcionas tanto claves extra de nivel superior como un objeto metadata, se fusionarán, con los valores explícitos de metadata teniendo precedencia.

Autorizaciones

X-API-Key
string
header
requerido

API key for authentication. Keys are prefixed with nxr_live_.

Cuerpo

application/json
first_name
string
requerido

Lead's first name

Ejemplo:

"John"

last_name
string

Lead's last name

Ejemplo:

"Doe"

email
string<email>

Lead's email address

Ejemplo:

"john@example.com"

phone
string

Lead's phone number (required if assigning to a workflow with call steps)

Ejemplo:

"+1234567890"

metadata
object

Arbitrary key-value data specific to your organization. Use this to store any custom information about the lead (e.g., age, salary range, assigned broker, lead status, notes). There is no enforced schema — send any keys and values you need. Values can be strings, numbers, or booleans.

Ejemplo:
{
"edad": 35,
"rango_sueldo": "$2000-$4000",
"broker_asociado": "Juan Perez",
"estado_lead": "interesado",
"notas_asociadas": "Prefiere contacto por WhatsApp"
}
workflow_id
string<uuid>

Workflow ID to assign the lead to. Use GET /workflows to list available workflows.

Ejemplo:

"123e4567-e89b-12d3-a456-426614174000"

campaign_id
string<uuid>

Campaign ID to tag the lead with (optional). Use GET /campaigns to list available campaigns.

Ejemplo:

"123e4567-e89b-12d3-a456-426614174001"

force_first_message
object

Override the first outreach with a custom message. Requires workflow_id. The rest of the cadence sequence continues normally from the second touchpoint.

Respuesta

Lead(s) created successfully

success
boolean
requerido
Ejemplo:

true

lead
object
requerido
workflow_run
object
warning
string

Warning message if lead was created but workflow assignment failed

Última modificación el 18 de junio de 2026