Assigns a team member (agent) to a specific contact within a WhatsApp channel.
Endpoint
POST /api/contacts/assign
Base URL
https://api.rampwin.com
Description
This API assigns a team member to a contact using the contact’s phone number under a specific integration (channel).
It helps in routing conversations to the appropriate agent.
When to Use
Use this API when you want to:
- Assign chats to support agents
- Route leads to sales representatives
- Manage conversation ownership
Authentication
- API Key
Headers
| Header | Type | Required | Description |
|---|---|---|---|
| x-api-key | string | Yes | Your Rampwin API key |
| Content-Type | string | Yes | application/json |
Request Body
{
"integration_id": "CHANNEL_ID",
"team_member_email": "[email protected]",
"phone_number": "919999999999"
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| integration_id | string | Yes | WhatsApp channel ID |
| team_member_email | string | Yes | Email of the team member (agent) |
| phone_number | string | Yes | Contact’s phone number (with country code) |
Example Request
curl --location 'https://api.rampwin.com/api/contacts/assign' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"integration_id": "YOUR_CHANNEL_ID",
"team_member_email": "[email protected]",
"phone_number": "YOUR_PHONE_NUMBER"
}'
Response
Success (200)
{
"success": true,
"message": "Team member assigned successfully"
}
Error (400)
{
"success": false,
"message": "Invalid team member or contact not found"
}
Common Errors
| Error | Description |
|---|---|
| Invalid team member | Email not found in system |
| Contact not found | Phone number does not exist |
| Missing parameters | Required fields not provided |
| Unauthorized | Invalid API key |
