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

# Send Connection Request

> Send a LinkedIn connection request to a profile

Send a connection request to a LinkedIn profile. Optionally include a connection note (only works for premium LinkedIn accounts).

## Request

<ParamField header="X-API-Key" type="string" required>
  Your API key
</ParamField>

<ParamField body="senderId" type="string" required>
  The LinkedIn sender account ID to use. Get available senders from the [List Senders](/api-reference/endpoint/get-senders) endpoint.
</ParamField>

<ParamField body="recipientLinkedinUrl" type="string" required>
  The LinkedIn profile URL of the person to connect with (e.g., `https://www.linkedin.com/in/john-doe`)
</ParamField>

<ParamField body="message" type="string">
  Optional connection note (max 300 characters). Note: Connection notes only work for premium LinkedIn accounts.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the connection request was sent successfully
</ResponseField>

<ResponseField name="requestId" type="string">
  Unique identifier for the connection request
</ResponseField>

<ResponseField name="recipientLinkedinUrl" type="string">
  The LinkedIn URL of the recipient
</ResponseField>

<ResponseField name="status" type="string">
  Request status: `sent` or `already_connected`
</ResponseField>

<ResponseField name="timestamp" type="string">
  ISO 8601 timestamp when the request was sent
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.sendpilot.ai/v1/inbox/connect \
    -H "X-API-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "senderId": "sender_abc123",
      "recipientLinkedinUrl": "https://www.linkedin.com/in/john-doe",
      "message": "Hi John, I came across your profile and would love to connect!"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.sendpilot.ai/v1/inbox/connect', {
    method: 'POST',
    headers: {
      'X-API-Key': process.env.SENDPILOT_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      senderId: 'sender_abc123',
      recipientLinkedinUrl: 'https://www.linkedin.com/in/john-doe',
      message: 'Hi John, I came across your profile and would love to connect!'
    })
  });
  const result = await response.json();
  ```

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

  response = requests.post(
      'https://api.sendpilot.ai/v1/inbox/connect',
      headers={
          'X-API-Key': 'YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'senderId': 'sender_abc123',
          'recipientLinkedinUrl': 'https://www.linkedin.com/in/john-doe',
          'message': 'Hi John, I came across your profile and would love to connect!'
      }
  )
  result = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Request Sent theme={null}
  {
    "success": true,
    "requestId": "conn_xyz789",
    "recipientLinkedinUrl": "https://www.linkedin.com/in/john-doe",
    "status": "sent",
    "timestamp": "2024-02-24T15:30:00.000Z"
  }
  ```

  ```json 200 - Already Connected theme={null}
  {
    "success": true,
    "requestId": "conn_xyz789",
    "recipientLinkedinUrl": "https://www.linkedin.com/in/john-doe",
    "status": "already_connected",
    "timestamp": "2024-02-24T15:30:00.000Z"
  }
  ```

  ```json 400 theme={null}
  {
    "statusCode": 400,
    "error": "Bad Request",
    "code": "SENDER_NOT_ACTIVE",
    "message": "LinkedIn sender 'sender_abc123' is not active. Current status: disconnected"
  }
  ```

  ```json 404 theme={null}
  {
    "statusCode": 404,
    "error": "Not Found",
    "code": "SENDER_NOT_FOUND",
    "message": "LinkedIn sender with ID 'sender_abc123' not found in this workspace"
  }
  ```

  ```json 429 theme={null}
  {
    "statusCode": 429,
    "error": "Too Many Requests",
    "code": "DAILY_LIMIT_EXCEEDED",
    "message": "LinkedIn sender 'sender_abc123' has reached its daily connection request limit. Resets at midnight UTC."
  }
  ```
</ResponseExample>

<Note>
  When a connection request is sent, a `connection.sent` webhook event will be triggered. When the connection is accepted, a `connection.accepted` webhook event will be triggered.
</Note>

<Warning>
  Connection notes are only supported for LinkedIn Premium accounts. For free accounts, the connection request will be sent without a note.
</Warning>

<Tip>
  LinkedIn has daily limits on connection requests. Check the sender's remaining capacity using the [List Senders](/api-reference/endpoint/get-senders) endpoint.
</Tip>


## OpenAPI

````yaml POST /v1/inbox/connect
openapi: 3.0.0
info:
  title: SendPilot External API
  description: >
    The SendPilot API enables you to programmatically manage LinkedIn outreach
    campaigns,

    add leads, update lead statuses, send messages, and receive real-time
    webhook notifications.
  version: 1.0.0
  contact:
    name: SendPilot Support
    email: support@sendpilot.ai
    url: https://sendpilot.ai
servers:
  - url: https://api.sendpilot.ai
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Credits
    description: Credits and quota management
  - name: Campaigns
    description: Campaign management endpoints
  - name: Leads
    description: Lead management endpoints
  - name: Lead Database
    description: Lead Database search endpoints
  - name: Lead Extractor
    description: Lead extraction campaign endpoints
  - name: Inbox
    description: Direct messaging endpoints
paths:
  /v1/inbox/connect:
    post:
      tags:
        - Inbox
      summary: Send connection request
      description: >
        Send a LinkedIn connection request to a profile. Optionally include a
        connection note

        (only works for premium LinkedIn accounts). LinkedIn has daily limits on
        connection requests.
      operationId: sendConnectionRequest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendConnectionRequest'
      responses:
        '200':
          description: Connection request sent (or already connected)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    SendConnectionRequest:
      type: object
      properties:
        senderId:
          type: string
          description: The LinkedIn sender account ID to use
        recipientLinkedinUrl:
          type: string
          description: The LinkedIn profile URL of the person to connect with
        message:
          type: string
          description: Optional connection note. Only works for premium LinkedIn accounts.
          maxLength: 300
      required:
        - senderId
        - recipientLinkedinUrl
    SendConnectionResponse:
      type: object
      properties:
        success:
          type: boolean
        requestId:
          type: string
          description: Unique identifier for the connection request
        recipientLinkedinUrl:
          type: string
        status:
          type: string
          enum:
            - sent
            - already_connected
        timestamp:
          type: string
          format: date-time
      required:
        - success
        - requestId
        - recipientLinkedinUrl
        - status
        - timestamp
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        error:
          type: string
        code:
          type: string
        message:
          type: string
      required:
        - statusCode
        - message
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````