API v2.1 Documentation
Complete documentation for the v2.1 automation API to integrate functionalities with external services.
Obtenir votre clé API
Accédez à la page des paramètres pour générer ou récupérer votre clé API d'automatisation
Endpoint
/api/v2/identify-userSuccess Response
200{
"status": 200,
"data": {
"name": "Your organization name"
}
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Actions (POST)
Endpoints to send data to NextLead CRM
Contacts
Endpoint
/api/v2/receive/contact/new-contactRequest Body
{
"firstName": "First name",
"lastName": "Last name",
"email": "email@example.com",
"phone": "0123456789",
"establishmentId": "establishment_id (optional)",
"listId": "list_id (optional)",
"socials": [
{
"linkedin": "https://linkedin.com/in/profile",
"facebook": "https://facebook.com/profile",
"instagram": "@profile"
}
],
"nextlead_config": [
{
"lead_score": 85,
"conversion_status": "qualified",
"assigned_to": "user_id",
"add_to_list": "list_id"
}
],
"custom_fields": [
{
"selected_field1": "custom_field_type_id_1",
"value_1": "Value for field 1",
"selected_field2": "custom_field_type_id_2",
"value_2": "Value for field 2",
"selected_field3": "custom_field_type_id_3",
"value_3": "Value for field 3"
}
]
}Success Response
201{
"status": 201,
"data": {
"message": "Contact successfully added",
"contact": {
"id": "contact_id",
"firstName": "First name",
"lastName": "Last name",
"email": "email@example.com",
"phone": "0123456789",
"organizationId": "org_id",
"createdAt": "2024-01-01T12:00:00Z"
}
}
}Possible Errors
Invalid or missing data
Missing or invalid automation API key
Organization/List/Establishment not found
A contact with this email already exists
Error creating contact
Endpoint
/api/v2/receive/contact/edit-contactRequest Body
{
"mail": "email@example.com (to find the contact)",
"linkedin_find": "https://linkedin.com/in/profile (alternative to mail)",
"values_update": [
{
"firstName": "New first name",
"lastName": "New last name",
"phone": "0123456789",
"add_to_list": "list_id",
"assigned_to": "user_id",
"conversion_status": "qualified",
"lead_score": 90,
"selected_field1": "custom_field_type_id_1",
"value_1": "Updated value for field 1",
"selected_field2": "custom_field_type_id_2",
"value_2": "Updated value for field 2",
"selected_field3": "custom_field_type_id_3",
"value_3": "Updated value for field 3"
}
]
}Success Response
200{
"status": 200,
"data": {
"message": "Contact successfully updated",
"contact": {
"id": "contact_id",
"firstName": "New first name",
"lastName": "New last name",
"updatedAt": "2024-01-01T12:00:00Z"
}
}
}Possible Errors
Contact email or LinkedIn URL required
Missing or invalid automation API key
Contact not found with provided criteria
Internal server error
Endpoint
/api/v2/receive/contact/delete-contactRequest Body
{
"email": "email@example.com (priority)",
"linkedin": "https://linkedin.com/in/profile (if no email)"
}Success Response
200{
"status": 200,
"data": {
"message": "Contact successfully deleted",
"contact": {
"id": "deleted_contact_id",
"email": "email@example.com"
},
"success": true
}
}Possible Errors
Missing or invalid contact email address or LinkedIn account
Missing or invalid automation API key
No contact found with this email/LinkedIn
Internal server error
Endpoint
/api/v2/receive/contact/find-contactRequest Body
{
"email": "email@example.com (optional)",
"linkedin_url": "https://linkedin.com/in/profile (optional)"
}Success Response
200{
"status": 200,
"data": [
{
"found": true,
"id": "contact_id",
"type": "LEAD",
"civility": "Mr.",
"first_name": "John",
"last_name": "Doe",
"birth_date": "1990-01-01T00:00:00.000Z",
"sector": "Technology",
"activity": "Developer",
"status": "ACTIVE",
"lead_score": 85,
"phone": "0123456789",
"mobile": "0987654321",
"phone_pro": "0112233445",
"email": "john.doe@example.com",
"email2": "john.doe.pro@example.com",
"email_verified": true,
"comment": "Qualified contact",
"linkedin": "https://linkedin.com/in/johndoe",
"facebook": "https://facebook.com/johndoe",
"instagram": "@johndoe",
"twitter": "@johndoe",
"otherSocials": "Other networks",
"firstTouch": "2024-01-01T10:00:00.000Z",
"lastTouch": "2024-01-15T14:30:00.000Z"
}
]
}Possible Errors
Missing contact email or LinkedIn URL
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/receive/contact/get-conversionSuccess Response
200{
"status": 200,
"data": [
{
"id": "tag_id",
"name": "Qualified",
"color": "#28a745",
"type": "CONVERSION_STATUS",
"organizationId": "org_id"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/receive/contact/get-teamSuccess Response
200{
"status": 200,
"data": [
{
"id": "user_id",
"name": "John Doe",
"email": "john@example.com",
"organizationId": "org_id"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/receive/contact/get-custom-fieldsQuery Parameters
{
"customFieldSetId": "group_id (optional) - get fields from specific group only"
}Success Response
200{
"status": 200,
"data": [
{
"id": "custom_field_type_id_1",
"name": "Structure Size",
"type": "string",
"groupId": "custom_field_set_id",
"groupName": "Structure Information"
},
{
"id": "custom_field_type_id_2",
"name": "Budget",
"type": "number",
"groupId": "custom_field_set_id",
"groupName": "Structure Information"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Structures
Endpoint
/api/v2/receive/structure/new-structureRequest Body
{
"name": "Structure name",
"siret": "12345678901234 (optional)",
"address1": "123 example street",
"city": "City",
"zipCode": "75000",
"website": "https://www.example.com",
"phone": "0123456789",
"email": "contact@example.com",
"comment": "Structure comment"
}Success Response
201{
"status": 201,
"data": {
"message": "Structure successfully created",
"data": {
"id": "structure_id",
"type": "ESTABLISHMENT",
"organizationId": "org_id",
"establishment": {
"id": "establishment_id",
"name": "Structure name",
"siret": "12345678901234",
"organizationId": "org_id"
},
"address1": "123 example street",
"city": "City",
"zipCode": "75000",
"website": "https://www.example.com",
"phone": "0123456789",
"email": "contact@example.com",
"comment": "Structure comment"
}
}
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/receive/structure/edit-structureRequest Body
{
"id": "structure_id",
"name": "New structure name",
"email": "new@example.com",
"phone": "0123456789",
"address1": "123 example street",
"city": "City",
"zipCode": "75000",
"website": "https://www.example.com"
}Success Response
200{
"status": 200,
"data": {
"message": "Structure successfully updated",
"structure": {
"id": "structure_id",
"name": "New structure name",
"email": "new@example.com",
"updatedAt": "2024-01-01T12:00:00Z"
}
}
}Possible Errors
Invalid or missing data
Missing or invalid automation API key
Structure not found
Internal server error
Endpoint
/api/v2/receive/structure/delete-structureRequest Body
{
"id": "structure_id"
}Success Response
200{
"status": 200,
"data": {
"message": "Structure successfully deleted",
"deletedAt": "2024-01-01T12:00:00Z"
}
}Possible Errors
Missing structure ID
Missing or invalid automation API key
Structure not found
Internal server error
Endpoint
/api/v2/receive/structure/get-structuresSuccess Response
200{
"status": 200,
"data": [
{
"id": "structure_id",
"name": "Structure name",
"email": "email@example.com",
"createdAt": "2024-01-01T12:00:00Z"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Sales
Endpoint
/api/v2/receive/sales/create-saleRequest Body
{
"name": "Sale name (required)",
"column": "stage_id (required)",
"description": "Sale description (optional)",
"value": "1000.50 (optional)",
"success_rate": "85 (optional, 0-100)",
"priority": "LOW|NORMAL|HIGH (optional, default: LOW)",
"closeDate": "2024-12-31 (optional)",
"assignedToId": "user_id (optional)",
"contact": "email@example.com (optional)",
"contactId": "contact_id (optional)"
}Success Response
201{
"status": 201,
"data": {
"message": "Vente créée avec succès",
"salesDeal": {
"id": "sale_id",
"name": "Sale name",
"priority": "LOW",
"stageId": "stage_id",
"organizationId": "org_id",
"createdAt": "2024-01-01T12:00:00Z"
}
}
}Possible Errors
Le paramètre 'column' est obligatoire
Le paramètre 'name' est obligatoire
La priorité doit être 'LOW', 'NORMAL' ou 'HIGH'
Le taux de succès doit être un nombre entre 0 et 100
Missing or invalid automation API key
Organization not found
Erreur lors de la création de la vente
Endpoint
/api/v2/receive/sales/update-saleRequest Body
{
"contact_email": "email@example.com (required)",
"name": "New sale name (optional)",
"description": "New description (optional)",
"column": "new_stage_id (optional)",
"value": "1500.75 (optional)",
"priority": "HIGH (optional)",
"success_rate": "90 (optional, 0-100)"
}Success Response
200{
"status": 200,
"data": {
"message": "Vente mise à jour avec succès",
"salesDeal": {
"id": "sale_id",
"name": "Updated sale name",
"updatedAt": "2024-01-01T12:00:00Z"
}
}
}Possible Errors
Le paramètre 'contact_email' est obligatoire
La priorité doit être 'LOW', 'NORMAL' ou 'HIGH'
Le taux de succès doit être un nombre entre 0 et 100
Missing or invalid automation API key
Contact non trouvé avec cet email
Aucune vente trouvée pour ce contact
Internal server error
Endpoint
/api/v2/receive/sales/delete-saleRequest Body
{
"contact_email": "email@example.com (required)",
"name": "Sale name (optional - if not provided, deletes the most recent sale)"
}Success Response
200{
"status": 200,
"data": {
"message": "Vente supprimée avec succès",
"deletedSalesDeal": {
"id": "deleted_sale_id",
"name": "Sale name",
"contactEmail": "email@example.com"
}
}
}Possible Errors
Le paramètre 'contact_email' est obligatoire
Missing or invalid automation API key
Contact non trouvé avec cet email
Aucune vente trouvée pour ce contact
Internal server error
Endpoint
/api/v2/receive/sales/get-columnsSuccess Response
200{
"status": 200,
"data": [
{
"id": "stage_id",
"name": "Qualification",
"order": 1,
"organizationId": "org_id"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Actions
Endpoint
/api/v2/receive/actions/create-actionRequest Body
{
"title": "Action title (optional)",
"column": "stage_id (required)",
"note": "Action description (optional)",
"date": "2024-12-31 (optional)",
"assigned_to": "user_id (optional)",
"assign_contact": "email@example.com (optional)"
}Success Response
201{
"status": 201,
"data": {
"message": "Action ajoutée avec succès",
"project": {
"id": "action_id",
"title": "Action title",
"stageId": "stage_id",
"organizationId": "org_id",
"taskType": "OTHER",
"createdAt": "2024-01-01T12:00:00Z"
}
}
}Possible Errors
Le paramètre 'column' est obligatoire
Missing or invalid automation API key
Organization not found
Erreur lors de la création de l'action
Endpoint
/api/v2/receive/actions/update-actionRequest Body
{
"contact_email": "email@example.com (required)",
"title": "New action title (optional)",
"column": "new_stage_id (optional)",
"note": "New description (optional)",
"date": "2024-12-31 (optional)",
"assigned_to": "user_id (optional)"
}Success Response
200{
"status": 200,
"data": {
"message": "Action mise à jour avec succès",
"project": {
"id": "action_id",
"title": "Updated action title",
"updatedAt": "2024-01-01T12:00:00Z"
}
}
}Possible Errors
Le paramètre 'contact_email' est obligatoire
Format de date invalide
Missing or invalid automation API key
Contact non trouvé avec cet email
Aucune action trouvée pour ce contact
Internal server error
Endpoint
/api/v2/receive/actions/delete-actionRequest Body
{
"contact_email": "email@example.com (required)"
}Success Response
200{
"status": 200,
"data": {
"message": "Activité supprimée avec succès",
"deletedProject": {
"id": "deleted_action_id",
"title": "Action title",
"contactEmail": "email@example.com"
}
}
}Possible Errors
Le paramètre 'contact_email' est obligatoire
Missing or invalid automation API key
Contact non trouvé avec cet email
Aucune activité trouvée pour ce contact
Internal server error
Endpoint
/api/v2/receive/actions/get-columnsSuccess Response
200{
"status": 200,
"data": [
{
"id": "stage_id",
"name": "To Do",
"order": 1,
"organizationId": "org_id"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Lists
Endpoint
/api/v2/receive/lists/get-listsSuccess Response
200{
"status": 200,
"data": [
{
"id": "list_id",
"name": "Newsletter (NEWSLETTER)",
"type": "NEWSLETTER",
"title": "List title",
"description": "List description",
"imageUrl": "https://example.com/image.jpg",
"linkCGU": "https://example.com/terms",
"isTPE": true,
"ctaText": "Subscribe now",
"displayFields": [
"email",
"firstName",
"lastName"
],
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-15T14:30:00Z"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Forms
Endpoint
/api/v2/receive/forms/get-formQuery Parameters
{
"listId": "list_id (required)"
}Success Response
200{
"status": 200,
"data": {
"id": "list_id",
"name": "Newsletter form",
"type": "AUDIENCE",
"fields": [
{
"id": "field_id",
"label": "Email",
"name": "email",
"type": "EMAIL",
"placeholder": "Enter your email",
"helpText": "We'll never share your email",
"defaultValue": null,
"config": {},
"validations": {},
"order": 0,
"column": null,
"width": null,
"isVisible": true,
"isRequired": true,
"mapsToContactField": "email",
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z",
"options": [],
"dependsOnFields": []
},
{
"id": "field_id_2",
"label": "Interest",
"name": "interest",
"type": "SELECT",
"placeholder": "",
"helpText": null,
"defaultValue": null,
"config": {
"options": [
{
"id": "option_id",
"label": "Tech",
"value": "tech"
},
{
"id": "option_id_2",
"label": "Marketing",
"value": "marketing"
}
]
},
"validations": {},
"order": 1,
"column": null,
"width": null,
"isVisible": true,
"isRequired": true,
"mapsToContactField": null,
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z",
"options": [
{
"id": "option_id",
"label": "Tech",
"value": "tech",
"order": 0,
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
},
{
"id": "option_id_2",
"label": "Marketing",
"value": "marketing",
"order": 1,
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
}
],
"dependsOnFields": []
}
],
"template": {
"id": "template_id",
"name": "Template for Newsletter form",
"type": "SINGLE_COLUMN",
"title": "Subscribe to our newsletter",
"description": "Stay updated with our latest news",
"submissionName": null,
"successMessage": "Thank you for subscribing!",
"successTitle": "Success",
"successImageUrl": null,
"color": "#3b82f6",
"submitButtonColor": "#1e40af",
"imageUrl": "https://example.com/image.jpg",
"imagePosition": "LEFT",
"paginationMode": "SCROLLABLE",
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
},
"imageUrl": "https://example.com/image.jpg"
}
}Possible Errors
The 'listId' parameter is required
Missing or invalid automation API key
Organization not found
Form not found
Internal server error
Endpoint
/api/v2/receive/forms/create-formRequest Body
{
"name": "Newsletter form (required)",
"title": "Subscribe to our newsletter (optional)",
"description": "Stay updated with our latest news (optional)",
"templateType": "SINGLE_COLUMN|DOUBLE_COLUMN (optional, default: SINGLE_COLUMN)",
"successMessage": "Thank you for subscribing! (optional)",
"successTitle": "Success (optional)",
"color": "#3b82f6 (optional)",
"submitButtonColor": "#1e40af (optional)",
"fields": [
{
"type": "TEXT|TEXTAREA|EMAIL|TEL|NUMBER|CHECKBOX|BOOLEAN|RADIO|SELECT|MULTI_SELECT|DATE|TIME|DATETIME|HIDDEN|FILE|RATING|FIRSTNAME|LASTNAME (required)",
"label": "Email (required)",
"isRequired": "true|false (optional, default: false)",
"placeholder": "Enter your email (optional)",
"helpText": "We'll never share your email (optional)",
"defaultValue": "default@example.com (optional)",
"options": [
{
"label": "Option label (required for SELECT/RADIO/MULTI_SELECT/CHECKBOX)",
"value": "option_value (required for SELECT/RADIO/MULTI_SELECT/CHECKBOX)"
}
],
"config": "{} (optional) - Additional configuration (accept, maxSize, min, max, step, rows, maxLength, levels, symbolType)",
"validations": "{} (optional) - Validation rules (required, minLength, maxLength, pattern, min, max, customMessage)",
"mapsToContactField": "firstName|lastName|email|phone (optional)"
}
]
}Success Response
201{
"status": 201,
"data": {
"message": "Formulaire créé avec succès",
"data": {
"id": "list_id",
"name": "Newsletter form",
"type": "AUDIENCE",
"fields": [
{
"id": "field_id",
"listId": "list_id",
"label": "Email",
"name": "email",
"type": "EMAIL",
"placeholder": "Enter your email",
"helpText": "We'll never share your email",
"defaultValue": null,
"config": {},
"validations": {},
"order": 0,
"column": null,
"width": null,
"isVisible": true,
"isRequired": true,
"mapsToContactField": "email",
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
},
{
"id": "field_id_2",
"listId": "list_id",
"label": "Interest",
"name": "interest",
"type": "SELECT",
"placeholder": null,
"helpText": null,
"defaultValue": null,
"config": {
"options": [
{
"id": "option_id",
"label": "Tech",
"value": "tech"
},
{
"id": "option_id_2",
"label": "Marketing",
"value": "marketing"
}
]
},
"validations": {},
"order": 1,
"column": null,
"width": null,
"isVisible": true,
"isRequired": true,
"mapsToContactField": null,
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
}
],
"template": {
"id": "template_id",
"name": "Template for Newsletter form",
"type": "SINGLE_COLUMN",
"title": "Subscribe to our newsletter",
"description": "Stay updated with our latest news",
"submissionName": null,
"successMessage": "Thank you for subscribing!",
"successTitle": "Success",
"successImageUrl": null,
"color": "#3b82f6",
"submitButtonColor": "#1e40af",
"imageUrl": null,
"imagePosition": "LEFT",
"paginationMode": "SCROLLABLE",
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
}
}
}
}Possible Errors
The 'name' parameter is required
The 'templateType' parameter must be 'SINGLE_COLUMN' or 'DOUBLE_COLUMN'
The field at index X has an invalid type
The field at index X must have a valid 'label'
The 'fields' parameter must be an array
The field at index X has invalid 'options' (must be an array)
The option at index X of the field at index Y must have valid 'label' and 'value'
Missing or invalid automation API key
Organization not found
Internal server error
Webhooks (GET)
Endpoints to retrieve data from NextLead CRM
Endpoint
/api/v2/polling/email/added-to-listSuccess Response
200{
"status": 200,
"data": {
"id": "contact_id",
"contactData": {
"email": "contact@example.com",
"firstName": "John",
"lastName": "Doe"
},
"createdAt": "2024-01-01T12:00:00Z"
}
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/polling/email/deleted-from-listSuccess Response
200{
"status": 200,
"data": {
"id": "contact_id",
"contactData": {
"email": "contact@example.com",
"firstName": "John",
"lastName": "Doe"
},
"createdAt": "2024-01-01T12:00:00Z"
}
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Contacts
Endpoint
/api/v2/polling/contact/user-createdQuery Parameters
{
"comment": "text (optional) - filter by comment",
"lead_score": "85 (optional) - contacts with higher score",
"list_id": "list_id (optional, multiple) - filter by list"
}Success Response
200{
"status": 200,
"data": [
{
"id": "zapier_record_id",
"type": "LEAD",
"civility": "Mr.",
"first_name": "John",
"last_name": "Doe",
"birth_date": "1990-01-01T00:00:00.000Z",
"sector": "Technology",
"activity": "Developer",
"status": "ACTIVE",
"conversion_status": "Qualified",
"lead_score": 85,
"phone": "0123456789",
"mobile": "0987654321",
"phone_pro": "0112233445",
"email": "john@example.com",
"email2": "john.pro@example.com",
"email_verified": true,
"comment": "Contact qualified via form",
"source": "Website",
"listIds": [
"list_1",
"list_2"
],
"linkedin": "https://linkedin.com/in/john",
"facebook": "https://facebook.com/john",
"instagram": "@john",
"twitter": "@john",
"website": "https://john.dev",
"otherSocials": "GitHub: johndoe",
"firstTouch": "2024-01-01T10:00:00.000Z",
"lastTouch": "2024-01-15T14:30:00.000Z"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/polling/contact/user-editedSuccess Response
200{
"status": 200,
"data": [
{
"id": "contact_id",
"email": "contact@example.com",
"firstName": "John",
"lastName": "Doe",
"updated_at": "2024-01-01T12:00:00Z"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/polling/contact/user-deletedSuccess Response
200{
"status": 200,
"data": [
{
"id": "contact_id",
"email": "contact@example.com",
"firstName": "John",
"lastName": "Doe",
"deleted_at": "2024-01-01T12:00:00Z"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Structures
Endpoint
/api/v2/polling/structures/structure-createdSuccess Response
200{
"status": 200,
"data": [
{
"id": "structure_id",
"name": "Structure name",
"created_at": "2024-01-01T12:00:00Z"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/polling/structures/structure-editedSuccess Response
200{
"status": 200,
"data": [
{
"id": "structure_id",
"name": "Structure name",
"updated_at": "2024-01-01T12:00:00Z"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error
Endpoint
/api/v2/polling/structures/structure-deletedSuccess Response
200{
"status": 200,
"data": [
{
"id": "structure_id",
"name": "Structure name",
"deleted_at": "2024-01-01T12:00:00Z"
}
]
}Possible Errors
Missing or invalid automation API key
Organization not found
Internal server error