The first step in using the Captain Data API (v4) to manage users is to synchronize your SaaS users with your Captain Data workspace.

Here’s a quick recap of the ways Captain Data can adapt to your needs:

  1. White Label – Fully branded solutions where Captain Data runs in the background, allowing your brand to take the spotlight.
  2. White Label — Stealth Mode – Run Captain Data’s API with rented LinkedIn accounts—no Chrome Extension required. Check out this article for more information: When to Sync Users vs. Use Rented LinkedIn Accounts
  3. Grey Label – Combine Captain Data’s Chrome Extension with shared accounts, utilizing our branded Captain Data connection flow.

When integrating your SaaS with Captain Data, it’s important to understand the distinction between Users and Integrations.

  • Users: Each user on your SaaS corresponds to a user in Captain Data. Think of a user as a license that enables automation for that individual.
  • Integrations: Integrations are the specific integrations (like LinkedIn) attached to a user, allowing them to run automations on specific platforms.

1. Create a User

To enable automation for a User, create the user by sending a POST request to the Create a User endpoint:

curl --request POST \
  --url https://api.captaindata.com/v4/users \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --data '{
  "full_name": "John Doe",
  "email": "[email protected]",
  "timezone": "Europe/Paris"
}'
email
string

The email of the user.

full_name
string

The user’s full name.

timezone
string

The user’s timezone.

The timezone field provisions a proxy IP matching that timezone/country. This needs to match the location where you log into your LinkedIn account to avoid restrictions.

When using a VPN, either: 1. Log out of your VPN before accessing social media, or 2. Ensure the “timezone” you send matches the country of the VPN IP address.

Save the User’s uid

Once the request is successful, Captain Data will return a User’s uid.

Save this as user_uid in your own user database - you’ll need it for:

  • Connecting integrations for this User
  • Launching actions, via the integration_users field

💡 When launching an action, always pass the User’s uid via the integration_users field. You do not need to pass the Integration’s UID.

2. Connect a User’s Integration

To run most automations, your users must be linked to the platform(s) they’ll act on, like LinkedIn. This section walks you through creating a user and connecting the necessary integrations using Captain Data’s API.

Once you have created a user, the next step is to attach an integration. This integration enables the user to automate specific platforms, like LinkedIn, through Captain Data.

Request Body

To create or update an integration, use the POST method for the Connect a User’s Integration endpoint. Here’s an example for a COOKIES integration type (like LinkedIn):

curl --request POST \
  --url https://api.captaindata.com/v4/users/{user_uid}/integrations/linkedin \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --data '{
  "account_name": "LinkedIn Account #1",
  "auth_data": {
    "cookies": {
      "li_at": "<li_at_token>",
      "li_a": "<li_a_token>"
    }
  }
}'
account_name
string

Name of the LinkedIn account, e.g. “LinkedIn Account #1”. It’s generally the User’s full_name or email.

auth_data.cookies
object

For COOKIES integration types, provide authentication cookies here.

Important note: If you’re connecting an account for LinkedIn Sales Navigator, you need to send both cookies. If you don’t include the li_a token, the connection may not work properly with LinkedIn Sales Navigator. Including the li_a token will also speed up account synchronization.

Supported Authentication Types

Captain Data supports the following integration types:

  • COOKIES
  • BASIC
  • OAUTH
  • APIKEY

Each type may require a slightly different request body. The example provided is for a COOKIES integration.

Save the Integration’s uid

Once the request is successful, Captain Data will return an Integration’s uid.

Save this uid in your own database model if you need to update or remove it later, for example.

Native LinkedIn Authentication

You can also authenticate LinkedIn accounts using email and password credentials. This method uses Captain Data’s native LinkedIn authentication system.

Here’s an example request using the Connect a LinkedIn Account (Username/Password) endpoint:

curl --request POST \
  --url https://api.captaindata.com/v4/users/{user_uid}/integrations/linkedin \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "auth_data": {
    "basic": {
      "username": "[email protected]",
      "password": "********"
    }
  }
}'