Skip to main content
The Fetch Connections endpoint creates an async task to retrieve the 1st-degree LinkedIn connections of your team’s account. All parameters are optional — you can fetch all connections with pagination, or narrow the results with a keyword search.

Endpoint

POST https://api.outx.ai/linkedin-agent/fetch-connections

Request Body

All fields are optional. Sending an empty body fetches the first page of all connections.
keyword
string
Filter connections by name (e.g., "John" returns connections whose name contains “John”)
sort_type
string
Sort order for results. Pass "RECENTLY_ADDED" to get your most recent connections first. Omit for default LinkedIn sort order.
start
number
Pagination offset — the index to start from. Defaults to 0. Use in combination with count to page through large connection lists.
count
number
Number of connections to return per request. Defaults to 40, maximum 100.
To paginate through all your connections, keep incrementing start by the value of count until total in the response is less than count (or 0), which means you’ve reached the end.

Response

The endpoint returns immediately with a task ID. Connections are fetched asynchronously.
success
boolean
Whether the task was created successfully
api_agent_task_id
string
UUID to poll for results via Get Task Status
message
string
Human-readable confirmation
{
  "success": true,
  "api_agent_task_id": "550e8400-e29b-41d4-a716-446655440000",
  "message": "Fetch connections task created successfully"
}

Polling for Results

After creating the task, poll the Get Task Status endpoint until the status is completed:
GET https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=550e8400-e29b-41d4-a716-446655440000

Completed Response

When the task finishes, task_output contains the cleaned list of connections:
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "completed",
    "task_input": {
      "count": 40,
      "start": 0,
      "keyword": "John",
      "sort_type": null,
      "task_type": "agent_fetch_connections"
    },
    "task_output": {
      "total": 2,
      "connections": [
        {
          "name": "John Smith",
          "headline": "VP of Engineering at Acme Corp",
          "last_name": "Smith",
          "entity_urn": "urn:li:fsd_profile:ACoAABCDEFGHIJKLMNOP",
          "first_name": "John",
          "profile_image_url": "https://media.licdn.com/dms/image/v2/...",
          "public_identifier": "john-smith-abc123"
        },
        {
          "name": "John Doe",
          "headline": "Founder at StartupXYZ",
          "last_name": "Doe",
          "entity_urn": "urn:li:fsd_profile:ACoAAHIJKLMNOPQRST",
          "first_name": "John",
          "profile_image_url": null,
          "public_identifier": "johndoe"
        }
      ]
    }
  }
}

Code Examples

# Fetch most recent 40 connections
curl -X POST \
  "https://api.outx.ai/linkedin-agent/fetch-connections" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{}'

# Search connections by keyword
curl -X POST \
  "https://api.outx.ai/linkedin-agent/fetch-connections" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"keyword": "John", "sort_type": "RECENTLY_ADDED", "count": 40}'

# Poll for results
curl -X GET \
  "https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=TASK_ID" \
  -H "x-api-key: YOUR_API_KEY"

Error Responses

StatusErrorDescription
400Invalid 'keyword': must be a stringThe keyword field was provided but is not a string
400Invalid 'sort_type': must be a stringThe sort_type field was provided but is not a string
401Missing API Key / Invalid API KeyAPI key is missing or invalid
403Plugin installation required...No team member has an active Chrome extension. See Authentication

FAQ

Each connection object includes: name (full name), first_name, last_name, headline (job title / description), public_identifier (LinkedIn profile slug), entity_urn (LinkedIn person URN), and profile_image_url (profile picture URL or null). The public_identifier can be passed to Fetch Profile and the entity_urn can be passed to Send Message.
Use start and count together. Start with start: 0, count: 100, then start: 100, count: 100, and so on. When the total in a response is less than your requested count, you have reached the last page. Each request creates a separate async task.
Passing "RECENTLY_ADDED" as sort_type returns connections in reverse chronological order — your most recently connected people appear first. Omitting sort_type uses LinkedIn’s default relevance-based sort.
The connections belong to the LinkedIn account running the Chrome extension — specifically your team’s oldest admin member’s account. This is the same account used for actions like Like Post, Comment on Post, and Send Message.
Yes. Pass the entity_urn from a connection object directly to the Send Message endpoint as the recipient_urn field. Since connections are 1st-degree, messaging them will always succeed.
Most connection fetch tasks complete within seconds to a minute, depending on when the Chrome extension picks up the task. We recommend polling every 5 seconds with a timeout of 2-3 minutes.

Learn More