Skip to main content

Standard Interface

sendMessage

This method allows you to send a message to a person.


try {
  const messageWorkflow = await linkedapi.account.messaging.sendMessage({
    personUrl: "https://www.linkedin.com/in/john-doe",
    text: "Hi! I'd love to connect and discuss potential opportunities.",
  });
    
  const result = await messageWorkflow.result();
  
  const data = result.data;
  const errors = result.errors;
} catch {}

# Python SDK is coming soon!
#
# You can always use Account API or Data API directly
# https://linkedapi.io/docs/
// Go SDK is coming soon!
//
// You can always use Account API or Data API directly
// https://linkedapi.io/docs/

Parameters

  • personUrlpublic or hashed LinkedIn URL of the person you want to send a message to.
  • text – message text, must be up to 1900 characters.

Data

Promise<WorkflowHandler<void>>workflow handler that resolves when the message is successfully sent.

Errors

Possible error types for this method:

  • personNotFound – provided URL is not an existing LinkedIn person.
  • messagingNotAllowed – sending a message to the person is not allowed. This could happen for several reasons:
    • You are not connected to the person.
    • LinkedIn has restricted your ability to send messages to the person, for example, due to reaching message limits or the person’s privacy settings.