> ## Documentation Index
> Fetch the complete documentation index at: https://api.smartlead.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get SmartServers for a Campaign

> Check which SmartServer (dedicated IP) is attached to a campaign

> [!NOTE]
>
> **SmartServers API**: Dedicated IP infrastructure feature. Contact [support@smartlead.ai](mailto:support@smartlead.ai) for access.

## Overview

Returns the dedicated IP attached to a campaign. Call it before starting a campaign to confirm that the right server is in place.

> [!WARNING]
>
> When a campaign has more than one server attached (a Multi SmartInfra, or several Single SmartInfra servers), this endpoint currently returns only one of them. Use `campaignCount` and `campaigns` from [List SmartServers](/api-reference/smart-servers/list-servers) to see every server a campaign uses.

## Path Parameters

**campaign\_id** `string` *required*

Campaign ID

## Query Parameters

**api\_key** `string` *required*

Your SmartLead API key

```bash cURL theme={null}
curl -X GET "https://smartservers.smartlead.ai/api/v1/smart-server/all/campaign/5614?api_key=YOUR_KEY"
```

```python Python theme={null}
import requests

response = requests.get(
    "https://smartservers.smartlead.ai/api/v1/smart-server/all/campaign/5614",
    params={"api_key": "YOUR_API_KEY"}
)

servers = response.json()["data"]
if not servers:
    print("No SmartServer attached to this campaign")
else:
    print(servers[0]["id"], servers[0]["ip"])
```

```javascript JavaScript theme={null}
const API_KEY = 'YOUR_API_KEY';

const response = await fetch(
  `https://smartservers.smartlead.ai/api/v1/smart-server/all/campaign/5614?api_key=${API_KEY}`
);

const { data } = await response.json();
console.log(data.length ? data[0].ip : 'No SmartServer attached to this campaign');
```

## Response Fields

**data** `array`

The attached server, or an empty array when the campaign has no server or does not belong to you

**server**

**id** `number`

Server ID

**ip** `string`

Dedicated IP address

**alias\_name** `string`

Display name of the server

**client\_id** `number | null`

Client the server belongs to, if any

**campaign\_details** `array`

`campaign_id`, `campaign_name`, `mapping_created_at` and `auto_rotate_servers` for the requested campaign

## Response Codes

**200** `Success`

Server returned, or an empty `data` array when nothing is attached

**401** `Unauthorized`

Invalid or missing API key. Check your authentication.

**403** `Forbidden`

The attached server does not belong to you

**404** `Not Found`

The attached server no longer exists

```json 200 - Server Attached theme={null}
{
  "statusCode": 200,
  "success": true,
  "message": "Fetched the details of the smart server",
  "data": [
    {
      "id": 907,
      "ip": "203.0.113.24",
      "alias_name": "outreach-us-1",
      "client_id": 31,
      "createdAt": "2026-08-14T09:21:07.000Z",
      "bounce_rate": null,
      "campaign_details": [
        {
          "campaign_id": 5614,
          "campaign_name": "Q4 Outbound - US",
          "mapping_created_at": "2026-09-02T11:45:00.000Z",
          "auto_rotate_servers": false
        }
      ]
    }
  ]
}
```

```json 200 - Nothing Attached theme={null}
{
  "statusCode": 200,
  "success": true,
  "message": "Fetched the details of the smart server",
  "data": []
}
```

```json Error - Unauthorized theme={null}
{
  "statusCode": 401,
  "success": false,
  "message": "Unauthorized",
  "error": "Invalid API Key"
}
```

## Related Endpoints

* [List SmartServers](/api-reference/smart-servers/list-servers)
* [Assign SmartInfra to Campaigns](/api-reference/smart-servers/assign-campaigns)
* [Unassign SmartServers from Campaign](/api-reference/smart-servers/unassign-campaign)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.