POST
/
api
/
v2
/
linkedin
/
scheduleLinkedInAction
curl --request POST \
  --url https://api.buena.ai/api/v2/linkedin/scheduleLinkedInAction \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "actionType": "<string>",
  "profileUrl": "<string>",
  "message": "<string>",
  "participantName": "<string>",
  "threadId": "<string>",
  "voiceSettings": {
    "voiceId": "<string>",
    "voiceText": "<string>",
    "voiceParams": {
      "stability": 123,
      "clarity": 123,
      "use_speaker_boost": true
    }
  }
}'
{
  "success": true,
  "message": "sendConnectionRequest action scheduled successfully with delay of 75000 ms."
}

Schedule LinkedIn Action

Schedule various LinkedIn actions including connection requests, messages, and data retrieval operations. The system automatically handles timing delays and rate limiting to ensure safe automation.

Requires the linkedin:schedule permission and an active LinkedIn integration in your account.

Request

x-api-key
string
required

Your API key with linkedin:schedule permission

Content-Type
string
required

Must be application/json

Body Parameters

actionType
string
required

Type of LinkedIn action to perform. See action types for available options.

profileUrl
string

LinkedIn profile URL. Required for actions targeting specific profiles. Format: https://linkedin.com/in/username

message
string

Message content for connection requests or direct messages. Required for messaging actions.

participantName
string

Name of conversation participant. Required for conversation-specific actions.

threadId
string

LinkedIn thread identifier. Required for thread-specific actions.

voiceSettings
object

Voice message configuration. Required for sendVoiceMessage action type.

LinkedIn integration settings (timezone, account details) are automatically detected from your connected LinkedIn account. No additional configuration required.

Action Types

Examples

Send Connection Request

curl -X POST "https://api.buena.ai/api/v2/linkedin/scheduleLinkedInAction" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionType": "sendConnectionRequest",
    "profileUrl": "https://linkedin.com/in/johndoe",
    "message": "Hi John, I'd love to connect and discuss potential collaboration opportunities!"
  }'

Send First Message

curl -X POST "https://api.buena.ai/api/v2/linkedin/scheduleLinkedInAction" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionType": "sendFirstMessage",
    "profileUrl": "https://linkedin.com/in/janedoe",
    "message": "Hi Jane, thank you for connecting! I noticed your expertise in AI and would love to discuss potential synergies."
  }'

Send Voice Message

curl -X POST "https://api.buena.ai/api/v2/linkedin/scheduleLinkedInAction" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionType": "sendVoiceMessage",
    "profileUrl": "https://linkedin.com/in/johndoe",
    "message": "Hi John! I wanted to reach out personally about an exciting opportunity.",
    "voiceSettings": {
      "voiceId": "voice_abc123",
      "voiceText": "Hi John! I hope you're having a great week. I came across your profile and was really impressed by your experience in AI. I wanted to reach out personally about an exciting opportunity that I think could be a perfect fit for your background. Would love to chat more about it!",
      "voiceParams": {
        "stability": 0.6,
        "clarity": 0.8,
        "use_speaker_boost": true
      }
    }
  }'

Get Accepted Connections

curl -X POST "https://api.buena.ai/api/v2/linkedin/scheduleLinkedInAction" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionType": "getAcceptedConnections"
  }'

Response

success
boolean

Always true for successful requests

message
string

Confirmation message indicating the action was scheduled successfully, including delay information

{
  "success": true,
  "message": "sendConnectionRequest action scheduled successfully with delay of 75000 ms."
}

Smart Scheduling

The system automatically applies intelligent delays to ensure safe automation:

Advanced Use Cases

1. Automated Outreach Campaign

async function runOutreachCampaign(prospects) {
  for (const prospect of prospects) {
    try {
      const response = await fetch(
        "https://api.buena.ai/api/v2/linkedin/scheduleLinkedInAction",
        {
          method: "POST",
          headers: {
            "x-api-key": process.env.BUENA_API_KEY,
            "Content-Type": "application/json",
          },
          body: JSON.stringify({
            actionType: "sendConnectionRequest",
            profileUrl: prospect.linkedinUrl,
            message: personalizeMessage(prospect),
          }),
        }
      );

      const result = await response.json();

      if (result.success) {
        console.log(`✅ Scheduled connection request for ${prospect.name}`);
        await logActivity(prospect.id, "connection_scheduled");
      } else {
        console.error(
          `❌ Failed to schedule for ${prospect.name}:`,
          result.message
        );
      }

      // Small delay between scheduling requests
      await new Promise((resolve) => setTimeout(resolve, 1000));
    } catch (error) {
      console.error(`Error scheduling for ${prospect.name}:`, error);
    }
  }
}

function personalizeMessage(prospect) {
  return `Hi ${prospect.firstName}, I noticed your work at ${prospect.company} and would love to connect to discuss ${prospect.industry} trends!`;
}

2. Follow-up Message Sequence

import asyncio
import requests
from datetime import datetime, timedelta

class LinkedInSequence:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = 'https://api.buena.ai/api/v2'

    async def schedule_followup_sequence(self, profile_url, sequence_config):
        """Schedule a series of follow-up messages"""

        for step in sequence_config['steps']:
            response = requests.post(
                f'{self.base_url}/linkedin/scheduleLinkedInAction',
                headers={
                    'x-api-key': self.api_key,
                    'Content-Type': 'application/json'
                },
                json={
                    'actionType': step['action_type'],
                    'profileUrl': profile_url,
                    'message': step['message']
                }
            )

            if response.status_code == 200:
                result = response.json()
                print(f"✅ Scheduled {step['action_type']}")
            else:
                print(f"❌ Failed to schedule {step['action_type']}: {response.text}")

            # Wait between scheduling requests
            await asyncio.sleep(2)

# Example usage
sequence = LinkedInSequence('your-api-key')

campaign_config = {
    'steps': [
        {
            'action_type': 'sendConnectionRequest',
            'message': 'Hi! I'd love to connect.'
        },
        {
            'action_type': 'sendFirstMessage',
            'message': 'Thanks for connecting! How's your week going?'
        }
    ]
}

await sequence.schedule_followup_sequence(
    'https://linkedin.com/in/prospect',
    campaign_config
)

3. Connection Acceptance Monitoring

async function monitorConnections() {
  const response = await fetch(
    "https://api.buena.ai/api/v2/linkedin/scheduleLinkedInAction",
    {
      method: "POST",
      headers: {
        "x-api-key": process.env.BUENA_API_KEY,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        actionType: "getAcceptedConnections",
      }),
    }
  );

  const result = await response.json();

  if (result.success) {
    console.log("✅ Connection monitoring scheduled");

    // Schedule follow-up messages for new connections
    // This would typically be handled by a webhook or polling system
  }

  return result;
}

// Run daily to check for new connections
setInterval(monitorConnections, 24 * 60 * 60 * 1000);

Error Responses

Permission Denied (403)

{
  "error": true,
  "code": "PERMISSION_DENIED",
  "message": "Insufficient permissions for LinkedIn scheduling",
  "version": "2.0",
  "timestamp": "2024-01-20T15:30:00Z",
  "permissionHelp": {
    "required": "linkedin:schedule",
    "available": ["linkedin:read"],
    "documentation": "https://docs.buena.ai/authentication"
  }
}

LinkedIn Not Connected (400)

{
  "error": true,
  "code": "LINKEDIN_NOT_CONNECTED",
  "message": "LinkedIn account not connected",
  "version": "2.0",
  "timestamp": "2024-01-20T15:30:00Z",
  "details": {
    "action": "Connect your LinkedIn account in the dashboard",
    "dashboardUrl": "https://app.buena.ai/integrations/linkedin"
  }
}

Invalid Profile URL (400)

{
  "error": true,
  "code": "INVALID_LINKEDIN_URL",
  "message": "Invalid LinkedIn profile URL format",
  "version": "2.0",
  "timestamp": "2024-01-20T15:30:00Z",
  "details": {
    "providedUrl": "https://example.com/profile",
    "expectedFormat": "https://linkedin.com/in/username"
  }
}

Rate Limited (429)

{
  "error": true,
  "code": "RATE_LIMIT_EXCEEDED",
  "message": "LinkedIn action rate limit exceeded",
  "version": "2.0",
  "timestamp": "2024-01-20T15:30:00Z",
  "retryAfter": 300,
  "details": {
    "dailyLimit": 100,
    "used": 100,
    "resetTime": "2024-01-21T00:00:00Z"
  }
}

Best Practices

Next Steps