# How to Integrate ConnectiveOne with eSputnik

ConnectiveOne supports integration with the eSputnik platform for sending contacts and further work with them in marketing campaigns.

---

## Prerequisites

- Active eSputnik account
- Access to eSputnik settings to obtain API keys

---

## Configuration

### Step 1: Getting Keys in eSputnik

#### API KEY

1. Go to eSputnik settings (through profile menu)
2. Select **API Keys**
3. Create a key with necessary permissions
4. Copy API KEY

#### APP UUID

1. Go to eSputnik settings (through profile menu)
2. Select **Telegram Bot**
3. Create a bot with the Telegram bot token you will use for integration
4. Copy Application ID — this is APP UUID

### Step 2: Configuration in ConnectiveOne

1. Go to **Bot Settings** → select the needed bot
2. Scroll to the **eSputnik** section
3. Add **API KEY** and **APP UUID**
4. Save settings

---

## Usage

### Sending Contacts via Action

After successful integration configuration, an action for sending contacts to eSputnik `esputnik__push_contact` becomes available in scenarios.

**Usage:**

1. Get user's `chat_id`
2. Call the `esputnik__push_contact` action
3. Contact will be automatically added to eSputnik

The action doesn't require configuration but requires `chat_id` presence in state.

### Sending Contacts via API Endpoint

You can use API to send all clients from the "Clients" module to the eSputnik database.

#### Endpoint

```
POST https://engine-{{instance_name}}.connectiveone.io/kw/esputnik/push-contacts
```

#### Request Parameters

| Parameter | Type | Required | Description |
|-----------|------|:--------:|-------------|
| `bot_id` | integer | ✅ | Your bot identifier |
| `token` | string | ✅ | Token for internal API authorization |
| `delay` | integer | ❌ | Delay between sending contact batches in seconds (for example, 2 for 2 seconds) |

> 💡 **Note:** To obtain token, contact the support team.

#### Example Request

```bash
curl -X POST \
  https://engine.yourinstance.connectiveone.io/kw/esputnik/push-contacts \
  -H "Content-Type: application/json" \
  -d '{
    "bot_id": 43,
    "token": "Paste your token",
    "delay": 2
  }'
```

#### Response Format

**Successful response:**

```json
{
  "status": "success",
  "results": [200, 200, 200],
  "total_contacts": 150,
  "sent_contacts": 150
}
```

---

## Limitations

- Contacts must have a valid phone or email
- Phone must be in format 380XXXXXXXXX (Ukrainian numbers)
- Email must match basic validation format
- Maximum batch size: 2999 contacts
- Delay between batches is configured through the `delay` parameter

---

## Related Articles

- [What are integrations](/en/integrations/explanation/what-are-integrations.md)

