Create Contact

Creates a new contact under a specific WhatsApp channel (integration).

Endpoint

POST /api/contacts

Base URL

https://api.rampwin.com

Description

Creates a contact with user details and custom attributes.
This contact can later be used for sending messages, templates, and campaigns.


Authentication

This API supports:

  • API Key

Headers

HeaderTypeRequiredDescription
acceptstringYesapplication/json, text/plain, /
content-typestringYesapplication/json;charset=UTF-8
x-api-keystringYesYour API key

Query Parameters

ParameterTypeRequiredDescription
integration_idstringYesChannel ID (WhatsApp integration ID)

Request Body

Core Fields

FieldTypeRequiredDescription
phone_numbernumberYesContact phone number
full_namestringYesFull name of contact
first_namestringNoFirst name
last_namestringNoLast name
emailstringNoEmail address
companystringNoCompany name
citystringNoCity
statestringNoState
zipcodestringNoZip code
addressstringNoAddress
remarksstringNoAdditional notes
integration_idstringYesChannel ID

Custom Attributes

You can pass additional dynamic fields such as:

  • plan_status
  • refund_status
  • service_request_id
  • recharge_amount
  • installationdate
  • referral_status
  • tags (array)
  • timezone

…and many more depending on your use case.


Example Request

curl --location 'https://api.rampwin.com/api/contacts?integration_id=YOUR_CHANNEL_ID' \
--header 'accept: application/json, text/plain, */*' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'content-type: application/json;charset=UTF-8' \
--data-raw '{
  "phone_number": 919876543210,
  "full_name": "John Doe",
  "first_name": "John",
  "last_name": "Doe",
  "email": "[email protected]",
  "city": "Mumbai",
  "state": "Maharashtra",
  "zipcode": "400001",
  "integration_id": "YOUR_CHANNEL_ID",
  "plan_status": "ACTIVE",
  "recharge_amount": 500,
  "timezone": "Asia/Kolkata",
  "tags": ["premium", "whatsapp_user"]
}'

Response

Success (200)

{
  "success": true,
  "message": "Contact created successfully",
  "data": {
    "_id": "contact_id",
    "phone_number": 919876543210,
    "full_name": "John Doe",
    "integration_id": "channel_id"
  }
}

Error (400)

{
  "success": false,
  "message": "Validation error or duplicate contact"
}

Notes

  • integration_id must match a valid WhatsApp channel
  • Phone number should include country code (e.g., 91 for India)
  • Single Bearer Token / x-api-key are required for authentication
  • You can store unlimited custom attributes for personalization
  • This contact can be directly used in template messaging APIs