---
agentTools:
  projectIndex: https://rampwin-api.readme.io/llms.txt
---

# Assign Team Member

Assigns a team member (agent) to a specific contact within a WhatsApp channel.

## Endpoint

`POST /api/contacts/assign`

**Base URL**

```bash 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

```json JSON
{
  "integration_id": "CHANNEL_ID",
  "team_member_email": "agent@example.com",
  "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 cURL
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": "agent@example.com",
  "phone_number": "YOUR_PHONE_NUMBER"
}'
```

***

## Response

### Success (200)

```json JSON
{
  "success": true,
  "message": "Team member assigned successfully"
}
```

***

### Error (400)

```json JSON
{
  "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              |