Skip to main content
The Send Message endpoint creates an async task to send a LinkedIn direct message to a connection. You provide the recipient’s person URN and the message text; the API handles delivery through your team’s oldest admin member’s LinkedIn account.

Endpoint

POST https://api.outx.ai/linkedin-agent/send-message

Request Body

recipient_urn
string
required
The LinkedIn person URN of the message recipient (e.g., "urn:li:person:ACoAABCDEFG")
message
string
required
The message text to send. Maximum 10,000 characters. Must not be empty or whitespace-only.
Don’t have a recipient URN? Use the Fetch Profile endpoint to look up a profile by slug — the response includes a profile_urn field you can use here. You can also get URNs from the Search Profiles endpoint.
The message is sent from your team’s oldest admin member’s LinkedIn account. You can only send messages to people who are 1st-degree connections of that account. Make sure this team member has an active Chrome extension session.

Response

The endpoint returns immediately with a task ID:
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": "Send message task created successfully"
}

Polling for Results

Poll the Get Task Status endpoint to confirm the message was sent:
GET https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=550e8400-e29b-41d4-a716-446655440000

Completed Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "completed",
    "task_input": {
      "task_type": "agent_send_message",
      "recipient_urn": "urn:li:person:ACoAABCDEFG",
      "message": "Hi Jane, great connecting with you! I'd love to chat about..."
    },
    "task_output": {
      "sent": true
    }
  }
}

Code Examples

# Send the message
curl -X POST \
  "https://api.outx.ai/linkedin-agent/send-message" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "recipient_urn": "urn:li:person:ACoAABCDEFG",
    "message": "Hi Jane, great connecting with you! I'd love to chat about your work at TechCorp."
  }'

# Check the result
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
400Missing or invalid 'recipient_urn'The recipient_urn field is missing or not a string
400Missing or invalid 'message'The message field is missing, empty, or not a string
400Message text is too long (max 10000 characters)The message exceeds the 10,000 character limit
401Missing API Key / Invalid API KeyAPI key is missing or invalid
403Plugin installation required...No team member has an active Chrome extension. See Authentication
404No admin user found in the teamYour team has no admin members

FAQ

The message is sent from your team’s oldest admin member’s LinkedIn account (sorted by when they joined the team). This is the team member whose Chrome extension session executes the action. Make sure this team member is aware that messages will be sent from their account via the API.
LinkedIn messaging via the API works the same as manual messaging — you can only send direct messages to 1st-degree connections of the account sending the message. Attempting to message a non-connection will result in a task failure.
The recipient_urn is a LinkedIn person URN in the format urn:li:person:XXXXXXXXXXX. You can obtain it from the profile_urn field in the Fetch Profile response, or from the results of the Search Profiles endpoint.
OutX does not rate-limit these requests for you. Each message is executed as a real LinkedIn message send. Sending many messages in quick succession can trigger LinkedIn’s spam detection. Space out messages by at least 30–60 seconds and avoid sending the same message to many people in a short time window. See Rate Limits for safe usage guidelines.
Yes, messages are capped at 10,000 characters. Requests with messages exceeding this limit will return a 400 error.

Learn More