{
  "info": {
    "name": "Trakor CRM \u2014 Lead Intake API",
    "_postman_id": "a71c9e10-2222-4c33-9f44-crmleads000001",
    "description": "Create and update CRM leads from any external system (website form, Google/Meta ads, IndiaMART, your ERP).\n\nSetup:\n1. In the app go to CRM \u2192 Webhooks and create a webhook. Copy its token.\n2. Set the collection variables `host` (e.g. https://dc.innosate.com) and `token`.\n\nNotes:\n- No API key header is needed \u2014 the token in the URL authorises the call.\n- A submission whose phone or email matches an existing lead UPDATES that lead instead of creating a duplicate.\n- Any field that is not recognised is stored as a new custom lead field automatically.\n- Files are attached as links. Either post public links directly, or upload the file first with the `lead-upload` request and post the returned links back as `attachments`.\n\nFetch/update requests (7-9) use the organisation API key from Settings \u2192 API keys in the `X-API-KEY` header, set in the `apiKey` variable.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "host",
      "value": "https://dc.innosate.com",
      "type": "string"
    },
    {
      "key": "token",
      "value": "REPLACE_WITH_WEBHOOK_TOKEN",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "REPLACE_WITH_ORG_API_KEY",
      "type": "string"
    },
    {
      "key": "lead_id",
      "value": "REPLACE_WITH_LEAD_ID",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "1 \u2014 Create lead (POST JSON, recommended)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{host}}/api/public/v1/lead-intake/{{token}}",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "lead-intake",
            "{{token}}"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Ravi Sharma\",\n  \"company\": \"Sharma Industries\",\n  \"phone\": \"+919876543210\",\n  \"email\": \"ravi@sharmaind.com\",\n  \"address\": \"12, MIDC Road, Bhosari\",\n  \"city\": \"Pune\",\n  \"state\": \"Maharashtra\",\n  \"pincode\": \"411026\",\n  \"source\": \"Google Ads\",\n  \"expected_value\": 250000,\n  \"expected_close_date\": \"2026-09-15\",\n  \"notes\": \"Needs 500 QR labels per month, wants a quote.\",\n  \"product_interest\": \"QR labelling\",\n  \"company_size\": \"50-100\",\n  \"attachments\": [\n    { \"name\": \"Requirement.pdf\", \"url\": \"https://files.example.com/leads/requirement.pdf\" },\n    { \"name\": \"GST certificate\", \"url\": \"https://files.example.com/leads/gst.jpg\" },\n    \"https://files.example.com/leads/site-photo.jpg\"\n  ]\n}"
        },
        "description": "Fields: name (or full_name / customer_name), company, phone (mobile / whatsapp), email, address, city, state, pincode, source (utm_source / lead_source), expected_value, expected_close_date (YYYY-MM-DD), notes (message / requirement), attachments.\n\nResponse:\n{ \"ok\": true, \"lead_id\": \"\u2026\", \"duplicate\": false, \"action\": \"created\", \"captured_fields\": [...], \"custom_fields\": [...], \"new_fields_created\": [...], \"attachments\": [...], \"ignored\": [] }"
      }
    },
    {
      "name": "2 \u2014 Create lead (GET query string)",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{host}}/api/public/v1/lead-intake/{{token}}?name=Ravi Sharma&phone=9876543210&email=ravi@sharmaind.com&city=Pune&pincode=411026&source=Google Ads&expected_value=250000&notes=Needs 500 QR labels&attachments=https://files.example.com/leads/requirement.pdf,https://files.example.com/leads/gst.jpg",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "lead-intake",
            "{{token}}"
          ],
          "query": [
            {
              "key": "name",
              "value": "Ravi Sharma"
            },
            {
              "key": "phone",
              "value": "9876543210"
            },
            {
              "key": "email",
              "value": "ravi@sharmaind.com"
            },
            {
              "key": "city",
              "value": "Pune"
            },
            {
              "key": "pincode",
              "value": "411026"
            },
            {
              "key": "source",
              "value": "Google Ads"
            },
            {
              "key": "expected_value",
              "value": "250000"
            },
            {
              "key": "notes",
              "value": "Needs 500 QR labels"
            },
            {
              "key": "attachments",
              "value": "https://files.example.com/leads/requirement.pdf,https://files.example.com/leads/gst.jpg"
            }
          ]
        },
        "description": "Handy for systems that can only call a URL. Multiple attachment links can be comma separated."
      }
    },
    {
      "name": "3 \u2014 Create lead (POST form-urlencoded)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "url": {
          "raw": "{{host}}/api/public/v1/lead-intake/{{token}}",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "lead-intake",
            "{{token}}"
          ]
        },
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "name",
              "value": "Meera Rao",
              "type": "text"
            },
            {
              "key": "phone",
              "value": "9845012345",
              "type": "text"
            },
            {
              "key": "email",
              "value": "meera@rangoli.example",
              "type": "text"
            },
            {
              "key": "message",
              "value": "Please share pricing for 1000 labels",
              "type": "text"
            },
            {
              "key": "attachment_1",
              "value": "https://files.example.com/leads/quote.pdf",
              "type": "text"
            },
            {
              "key": "attachment_2",
              "value": "https://files.example.com/leads/photo.jpg",
              "type": "text"
            }
          ]
        },
        "description": "What a plain HTML <form method=\"POST\"> sends. Numbered keys attachment_1, attachment_2, file_1\u2026 are all accepted."
      }
    },
    {
      "name": "4 \u2014 Upload files, then attach to a lead",
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{host}}/api/public/v1/lead-upload/{{token}}",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "lead-upload",
            "{{token}}"
          ]
        },
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "files",
              "type": "file",
              "src": []
            },
            {
              "key": "files",
              "type": "file",
              "src": []
            }
          ]
        },
        "description": "multipart/form-data, field name `files` (up to 10 files, 10 MB each: pdf, doc(x), xls(x), csv, txt, png, jpg, webp, gif, heic, zip).\n\nReturns signed links. Post those links back to /lead-intake/{{token}} as `attachments` (request 1)."
      }
    },
    {
      "name": "5 \u2014 Update existing lead (same phone = no duplicate)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{host}}/api/public/v1/lead-intake/{{token}}",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "lead-intake",
            "{{token}}"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"phone\": \"+919876543210\",\n  \"notes\": \"Follow-up enquiry: wants samples first.\",\n  \"expected_value\": 350000,\n  \"attachments\": [\"https://files.example.com/leads/revised-spec.pdf\"]\n}"
        },
        "description": "Matching on phone (or email) updates the existing lead and appends the new enquiry to its submission history \u2014 the response has \"duplicate\": true, \"action\": \"updated\"."
      }
    },
    {
      "name": "6 \u2014 Signed webhook call (when signature is required)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "X-Signature",
            "value": "sha256=HMAC_SHA256(signing_secret, timestamp + '.' + rawBody)"
          },
          {
            "key": "X-Timestamp",
            "value": "{{$timestamp}}"
          }
        ],
        "url": {
          "raw": "{{host}}/api/public/v1/lead-intake/{{token}}",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "lead-intake",
            "{{token}}"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Signed Lead\",\n  \"phone\": \"9999900000\"\n}"
        },
        "description": "Only needed if 'Require signature' is switched on for the webhook. The header names and signing secret are shown on the webhook card in CRM \u2192 Webhooks."
      }
    },
    {
      "name": "Error check \u2014 invalid token",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{host}}/api/public/v1/lead-intake/bad-token",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "lead-intake",
            "bad-token"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{ \"name\": \"Test\" }"
        },
        "description": "Expected: 401 { \"error\": \"Invalid intake token\" }."
      }
    },
    {
      "name": "7 \u2014 List / search leads (GET)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-API-KEY",
            "value": "{{apiKey}}"
          }
        ],
        "url": {
          "raw": "{{host}}/api/public/v1/leads?limit=20&offset=0",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "leads"
          ],
          "query": [
            {
              "key": "limit",
              "value": "20"
            },
            {
              "key": "offset",
              "value": "0"
            },
            {
              "key": "q",
              "value": "Ravi",
              "disabled": true
            },
            {
              "key": "stage",
              "value": "Qualified",
              "disabled": true
            },
            {
              "key": "phone",
              "value": "9876543210",
              "disabled": true
            },
            {
              "key": "email",
              "value": "ravi@sharmaind.com",
              "disabled": true
            },
            {
              "key": "updated_since",
              "value": "2026-08-01T00:00:00Z",
              "disabled": true
            }
          ]
        },
        "description": "Returns { data, count, limit, offset } ordered by last update. Use updated_since to poll only changes."
      }
    },
    {
      "name": "8 \u2014 Fetch lead details (GET)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-API-KEY",
            "value": "{{apiKey}}"
          }
        ],
        "url": {
          "raw": "{{host}}/api/public/v1/leads/{{lead_id}}",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "leads",
            "{{lead_id}}"
          ]
        },
        "description": "Full lead record including attachments, custom_fields and the last 50 timeline activities."
      }
    },
    {
      "name": "9 \u2014 Update lead details (PATCH)",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "X-API-KEY",
            "value": "{{apiKey}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{host}}/api/public/v1/leads/{{lead_id}}",
          "host": [
            "{{host}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "leads",
            "{{lead_id}}"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"stage\": \"Negotiation\",\n  \"expected_value\": 350000,\n  \"notes\": \"Quote revised after site visit\",\n  \"custom_fields\": {\n    \"product_interest\": \"QR labelling + POS\"\n  }\n}"
        },
        "description": "Send only the fields to change (PUT works the same). custom_fields is merged. A stage change is written to the lead timeline."
      }
    }
  ]
}