CRM and Leads

Custom Lead Fields

Sets the names of the lead fields. Fields are flat (lead_field01, lead_field02, etc).

POSThttps://api.zapzapapi.com/api/v1/{instanceId}/instance/updateFieldsMap

Authentication with the x-api-key and x-api-secret headers.

Parameters

NameTypeInRequiredDescription
lead_field01textbodyNoField 01
lead_field02textbodyNoField 02
lead_field03textbodyNoField 03
lead_field04textbodyNoField 04
lead_field05textbodyNoField 05

Request example

curl

curl -X POST "https://api.zapzapapi.com/api/v1/{instanceId}/instance/updateFieldsMap" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"lead_field01":"nome","lead_field02":"email"}'

Node.js

const res = await fetch("https://api.zapzapapi.com/api/v1/{instanceId}/instance/updateFieldsMap", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "x-api-secret": "YOUR_API_SECRET",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "lead_field01": "nome",
    "lead_field02": "email"
  }),
});
console.log(await res.json());

Python

import requests

res = requests.post(
    "https://api.zapzapapi.com/api/v1/{instanceId}/instance/updateFieldsMap",
    headers={"x-api-key": "YOUR_API_KEY", "x-api-secret": "YOUR_API_SECRET"},
    json={"lead_field01":"nome","lead_field02":"email"},
)
print(res.json())

Response example

JSON

{
  "id": "raa287d88df6336",
  "name": "minha-instancia",
  "fieldsMap": {
    "lead_field01": "nome",
    "lead_field02": "email",
    "lead_field03": "telefone"
  }
}

Values are illustrative; the fields follow the real response format.

Other endpoints in this category

See the full reference

Get your API keys

Create your account, connect a number in minutes and start using the API. R$15 per active number/month, with a welcome credit when you create the account, subject to the current campaign.