> For the complete documentation index, see [llms.txt](https://popin.gitbook.io/popin-developer-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://popin.gitbook.io/popin-developer-hub/popin-insta-call-api-documentation.md).

# Popin Insta Call API Documentation

This documentation covers the **Popin Insta Call APIs** for:<br>

* Capturing users
* Creating video call links
* Retrieving available slots
* Scheduling video calls

***

### 🔐 Authentication

All API requests require the following headers:

#### 🔑 How to Generate API Key

1. Log in to your **Popin Dashboard**
2. Go to **Settings → Developers**
3. Select **Popin API**
4. Click **Generate API Key**

#### 📋 Example Headers

```http
X-API-KEY: {{apiKey}}
X-TOKEN: {{sellerToken}}
Accept: application/json
```

***

### 📥 1. Capture User API

#### 📌 Endpoint

```
POST https://widget01.popin.to/api/v1/external/capture
```

#### 🎯 Purpose

Captures and registers a customer. Returns:

* A unique `customer_id`
* A join URL for a Popin video call

#### 📝 Required Fields (in Body)

| Field     | Type   | Description      |
| --------- | ------ | ---------------- |
| name      | string | Customer name    |
| mobile    | string | Mobile number    |
| email     | string | Email address    |
| group     | string | Group identifier |
| pin\_code | string | PIN/ZIP code     |

#### 🔁 Optional Fields

*No optional fields defined explicitly.*

#### 📦 Example Request

```json
{
  "name": "Vijith",
  "mobile": "9544510895",
  "email": "vijith@springr.in",
  "group": "QA101",
  "pin_code": "221007"
}
```

#### ✅ Successful Response

```json
{
  "status": 1,
  "customer_id": "MzE1",
  "url": "https://live.popin.to/8131-a157",
  "message": "User captured successfully"
}
```

***

### 📅 2. Get Available Slots API

#### 📌 Endpoint

```
GET https://widget01.popin.to/api/v1/external/slots
```

#### 🎯 Purpose

Fetches a list of **available 15-minute time slots** for scheduling a call.

> ⚠️ No request body is required.

#### 📦 Sample Response (Partial)

```json
{
  "availability": [
    {
      "date": "Wed, 24 Sep 2025",
      "slots": [
        "01:00 PM",
        "01:15 PM",
        "01:30 PM",
        "10:45 PM"
      ]
    },
    {
      "date": "Thu, 25 Sep 2025",
      "slots": [
        "10:00 AM",
        "10:15 AM",
        "10:45 PM"
      ]
    }
  ],
  "slotDiff": 15,
  "timezone": "Asia/Kolkata"
}
```

#### 🔍 Response Fields

| Field        | Type    | Description                                 |
| ------------ | ------- | ------------------------------------------- |
| availability | array   | Dates with available time slots             |
| slotDiff     | integer | Time difference between each slot (minutes) |
| timezone     | string  | Timezone of the slots                       |

#### ⏰ Scheduling Format

To schedule a call, combine the **date and time** into a **single string** using this format:

```
Thu, 25 Sep 2025 03:15 PM
```

Use this exact format in the **Schedule API**.

***

### 📆 3. Schedule a Call API

#### 📌 Endpoint

```
POST https://widget01.popin.to/api/v1/external/schedule
```

#### 🎯 Purpose

Schedules a Popin video call using:

* A valid `customer_id` (from Capture API)
* A valid time slot (from Slots API)

#### 📝 Required Fields (in Body)

| Field        | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| customer\_id | string | ID returned by Capture API        |
| time         | string | Date and time in specified format |

#### 📦 Example Request

```json
{
  "customer_id": "MzE1",
  "time": "Fri, 19 Sep 2025 07:30 PM"
}
```

#### ✅ Successful Response

```json
{
  "status": 1,
  "schedule": {
    "data": {
      "name": "Vijith",
      "time": "Wed, Sep 24 | 10:30 PM",
      "timezone": "Asia/Kolkata"
    }
  },
  "data": "+919544510895"
}
```

***

### ✅ Summary of Endpoints

| Function            | Method | Endpoint                                             |
| ------------------- | ------ | ---------------------------------------------------- |
| Capture User        | POST   | `https://widget01.popin.to/api/v1/external/capture`  |
| Get Available Slots | GET    | `https://widget01.popin.to/api/v1/external/slots`    |
| Schedule a Call     | POST   | `https://widget01.popin.to/api/v1/external/schedule` |
