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

# Add Connector

> Add one or more connector accounts to an existing team via API

## Overview

The Add Connector endpoint allows you to programmatically add one or more connector accounts to your team in a single request by providing a list of LinkedIn profile URLs. This enables automated team management and efficient bulk connector operations.

## Endpoint Configuration

* **URL**: [https://bee.theswarm.com/team/add-connector](https://bee.theswarm.com/team/add-connector)
* **HTTP Method**: POST
* **Content Type**: application/json
* **Authentication**: API key ([How to get an API key?](/docs/getting-started/quickstart#get-your-api-key))

### Additional Header for Partner Accounts

If you are a partner managing multiple teams, include the target team ID:

```json theme={null}
x-authenticate-team: CHILD_TEAM_ID
```

**Behavior**:

* `With team header`: Connectors added to specified child team
* `Without team header`: Connectors added to parent team associated with API key

## Request Format

### Request Body Structure

```json theme={null}
{
  "linkedin_usernames": ["john-doe", "jane-smith"],
  "group": "employees"
}
```

### Parameter Details

| Parameter            | Type             | Required | Description                                                                                                                                         |
| -------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `linkedin_usernames` | array of strings | Yes      | One or more LinkedIn usernames or full profile URLs to add as connectors. A single-item array is valid.                                             |
| `group`              | string           | No       | Assigns all connectors in the request to a member group. Accepted values: `employees`, `investors`, `customers`, `portfolio`, `advisors`, `others`. |

#### `linkedin_usernames`

An array of LinkedIn usernames. Both the short username format and full profile URLs are accepted:

```json theme={null}
// Username only
"linkedin_usernames": ["john-doe"]

// Full profile URL also accepted
"linkedin_usernames": ["https://linkedin.com/in/john-doe"]

// Multiple connectors in one request
"linkedin_usernames": ["john-doe", "jane-smith", "alex-johnson"]
```

#### `group` (Optional)

Categorizes the added connectors within your team. All connectors in a single request receive the same group assignment.

| Value       | Use for                                          |
| ----------- | ------------------------------------------------ |
| `employees` | Current or former employees of your organization |
| `investors` | Investors in your organization                   |
| `customers` | Customers                                        |
| `portfolio` | Portfolio companies                              |
| `advisors`  | Advisors                                         |
| `others`    | Any other relationship type                      |

If omitted, connectors are added without a group assignment.

## Response Codes and Behavior

### HTTP 202 Accepted (Success)

The connector addition process has been successfully initiated. The mapping process is asynchronous and typically completes within seconds, though it may take up to a few minutes depending on the number of connections.

**Important**: If a connector with a provided LinkedIn username already exists in the team, that entry is skipped — no duplicate is created — but the overall response remains 202.

### HTTP 404 Not Found

One or more of the provided LinkedIn usernames were not found in the system.

### HTTP 400 Bad Request

Invalid request format or missing required parameters.

## Code Examples

### Add Multiple Connectors

```bash theme={null}
curl -X POST https://bee.theswarm.com/team/add-connector \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "linkedin_usernames": ["john-doe", "jane-smith", "alex-johnson"]
  }'
```

### Add Connectors with a Group

```bash theme={null}
curl -X POST https://bee.theswarm.com/team/add-connector \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "linkedin_usernames": ["john-doe", "jane-smith"],
    "group": "employees"
  }'
```

### Add a Single Connector

```bash theme={null}
curl -X POST https://bee.theswarm.com/team/add-connector \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "linkedin_usernames": ["john-doe"]
  }'
```

### Partner Request (Child Team)

```bash theme={null}
curl -X POST https://bee.theswarm.com/team/add-connector \
  -H "x-api-key: YOUR_PARTNER_API_KEY" \
  -H "x-authenticate-team: child-team-id-123" \
  -H "Content-Type: application/json" \
  -d '{
    "linkedin_usernames": ["jane-smith", "john-doe"]
  }'
```

## Partner Team Management

Partners can use this endpoint to manage connectors across multiple child teams. For detailed information on team creation and management, see Team Management documentation.

**Team Targeting Logic**:

* Include `x-authenticate-team` header: Connectors added to specified child team
* Omit `x-authenticate-team` header: Connectors added to parent team

## Processing Details

### Asynchronous Operation

The connector mapping happens in the background after a successful 202 response. Processing typically completes within seconds but may take up to a few minutes for profiles with extensive connection networks.

### Idempotent Behavior

Duplicate requests for existing connectors return 202 without creating duplicates. This makes the endpoint safe for retry scenarios and batch operations.

### LinkedIn Username Format

Both short usernames and full profile URLs are accepted:

* `"john-doe"` — username only
* `"https://linkedin.com/in/john-doe"` — full profile URL

## Troubleshooting Guide

### HTTP 404 Not Found Error

**Cause**: One or more LinkedIn usernames were not found in the system\
**Solution**: Verify each LinkedIn username exists and is correctly formatted

### Slow Processing

**Cause**: Profiles have extensive connection networks\
**Solution**: This is normal behavior; wait for processing to complete

## Support Contact

For additional support regarding technical issues, contact the Swarm team at [support@theswarm.com](mailto:support@theswarm.com).
