Code examples

The same call in cURL, Node.js and Python.

Adding a lead, three ways:

cURL
curl -X POST "https://api.crm.thevisionsage.com/v1/api/leads" \
  -H "Authorization: Bearer vsa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Priya Sharma",
  "phone": "9876500001"
}'
Node.js
const res = await fetch('https://api.crm.thevisionsage.com/v1/api/leads', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer vsa_YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Priya Sharma', phone: '9876500001' }),
})
const { success, data } = await res.json()
Python
import requests

res = requests.post(
    "https://api.crm.thevisionsage.com/v1/api/leads",
    headers={"Authorization": "Bearer vsa_YOUR_API_KEY"},
    json={"name": "Priya Sharma", "phone": "9876500001"},
)
print(res.json())

Something missing or unclear? Tell us and we will fix this page.