Get started with the Buena.ai API v2 in just a few steps. This guide will walk you through making your first API call and setting up LinkedIn automation.

Step 1: Get Your API Key

First, you’ll need to create an API key. You can either:

  1. Dashboard Method: Create one through your Buena.ai dashboard
  2. API Method: Use an existing key to create a new one via API

If you don’t have an existing API key, contact support@buena.ai to enable API access for your account.

Create API Key via API

curl -X POST "https://api.buena.ai/api/v2/keys" \
  -H "x-api-key: YOUR_EXISTING_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My First Integration",
    "permissions": ["linkedin:schedule", "linkedin:upload", "leads:read", "leads:write"],
    "expiresInDays": 365
  }'

Store your API key securely! It won’t be shown again after creation.

Step 2: Test Your Connection

Let’s verify your API key works with a health check:

curl -X GET "https://api.buena.ai/api/v2/health" \
  -H "x-api-key: YOUR_API_KEY"

Expected Response

{
  "version": "2.0",
  "status": "healthy",
  "authentication": "user",
  "user": {
    "id": "user_abc123",
    "email": "john@company.com",
    "role": "Premium"
  },
  "apiKey": {
    "name": "My First Integration",
    "permissions": [
      "linkedin:schedule",
      "linkedin:upload",
      "leads:read",
      "leads:write"
    ],
    "usageCount": 1
  },
  "timestamp": "2024-01-20T15:30:00Z"
}

Step 3: Schedule Your First LinkedIn Action

Now let’s schedule a LinkedIn connection request using the simplified API:

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

Notice the simplification! With user-specific API keys (format: bna_hexstring), you no longer need to specify linkedInIntegration settings. The API automatically detects your LinkedIn account details and timezone from the API key.

Expected Response

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

Step 4: Create Your First Lead

Let’s add a lead to your database:

curl -X POST "https://api.buena.ai/api/v2/leads" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "linkedinUrl": "https://linkedin.com/in/johndoe",
    "company": "Tech Corp",
    "title": "Software Engineer",
    "source": "linkedin",
    "notes": "Interested in automation solutions"
  }'

Step 5: Retrieve Your Leads

Now let’s fetch your leads:

curl -X GET "https://api.buena.ai/api/v2/leads?limit=10" \
  -H "x-api-key: YOUR_API_KEY"

Next Steps

Congratulations! You’ve successfully:

  • ✅ Created an API key
  • ✅ Made your first API call
  • ✅ Scheduled a LinkedIn action
  • ✅ Created and retrieved leads

What’s Next?

Rate Limits

Keep these limits in mind as you scale:

  • 60 requests per minute
  • 1,000 requests per hour
  • 10,000 requests per day

Rate limit headers are included in all responses to help you monitor usage.

Need Help?