Get a list of LinkedIn accounts
Retrieve a list of the connected LinkedIn accounts, providing details about each account's status, user information, and subscription level.
Request
Endpoint
GET https://api.woodpecker.co/rest/v2/linkedin_accounts
Headers
x-api-key: {YOUR_API_KEY}
For details on how to authenticate your requests, please see the authentication guide.
Parameters
Parameter | Required | Description |
---|---|---|
status | No | Filter accounts by their session_status . Available statuses (case-sensitive): CONNECTED , DISCONNECTED , REQUIRES_CHECKPOINT |
Request sample
Some sample request
- cURL
- Python
- Java
- Node.js
- PHP
curl --request GET \
--url "https://api.woodpecker.co/rest/v2/linkedin_accounts" \
--header "x-api-key: {YOUR_API_KEY}"
import requests
def getLinkedinAccounts():
url = "https://api.woodpecker.co/rest/v2/linkedin_accounts"
headers = {
"x-api-key": "{YOUR_API_KEY}"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print("GET successful:", response.json())
else:
print("GET failed with status:", response.status_code)
if __name__ == "__main__":
getLinkedinAccounts()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class WoodpeckerApiClient {
private static final String API_KEY = "{YOUR_API_KEY}";
public static void main(String[] args) {
getLinkedinAccounts();
}
public static void getLinkedinAccounts() {
try {
String url = "https://api.woodpecker.co/rest/v2/linkedin_accounts";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(url))
.header("x-api-key", API_KEY)
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) {
System.out.println("GET response: " + response.body());
} else {
System.err.println("GET request failed: " + response.statusCode());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
const axios = require("axios");
async function getLinkedinAccounts() {
const url = "https://api.woodpecker.co/rest/v2/linkedin_accounts";
const headers = {
"x-api-key": "{YOUR_API_KEY}"
};
try {
const response = await axios.get(url, { headers: headers });
if (response.status === 200) {
console.log("GET successful:", response.data);
} else {
console.error("GET failed with status:", response.status);
}
} catch (error) {
console.error("Request error:", error.response?.status || error.message);
}
}
getLinkedinAccounts();
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
$client = new Client([
'base_uri' => 'https://api.woodpecker.co/rest/v2/',
'headers' => [
'x-api-key' => getenv('WOODPECKER_API_KEY'),
],
]);
try {
$response = $client->get('linkedin_accounts');
echo $response->getStatusCode(), "\n";
echo $response->getBody(), "\n";
} catch (RequestException $e) {
echo "Error: ", $e->getMessage(), "\n";
if ($e->hasResponse()) {
echo $e->getResponse()->getBody(), "\n";
}
}
Response
Response examples
- 200
- 400
- 401
- 404
- 500
Successful response. The below example showcases 2 different LinkedIn accounts. If you don't have any accounts connected, or they don't match the requested filters, linkedin_accounts
will be an empty array.
{
"linkedin_accounts": [
{
"id": 111111,
"username": "jim@dundermifflin.com",
"session_status": "CONNECTED",
"full_name": "Jim Halpert",
"linkedin_url": "https://www.linkedin.com/in/jim-halpert-123abc",
"level": "SALES_NAVIGATOR"
},
{
"id": 111112,
"username": "jimothy@dundermifflin.com",
"session_status": "DISCONNECTED",
"full_name": "Jimothy Halpert",
"linkedin_url": "https://www.linkedin.com/in/jimothy-halpert-321xyz",
"level": "CLASSIC"
}
]
}
Body schema
Field | Type | Description |
---|---|---|
linkedin_accounts | array[object] | An array of connected LinkedIn accounts |
└─[].id | integer | Unique identifier of a LinkedIn account in Woodpecker |
└─[].username | string | Username used to connect the account |
└─[].session_status | string | Current connection status of the account. Available values: CONNECTED , DISCONNECTED , REQUIRES_CHECKPOINT (connection in progress, requires user aciton) |
└─[].full_name | string | Full name associated with the LinkedIn account |
└─[].linkedin_url | string | LinkedIn profile URL of the account |
└─[].level | string | Subscription level of the account. Relates to sending limits. Available values: CLASSIC , SALES_NAVIGATOR , UNKNOWN |
Please review the request parameters
{
"title": "Bad Request",
"status": 400,
"detail": "Value of status is incorrect.",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
An issue with authorization. Please review the authorization guide
{
"title": "Unauthorized",
"status": 401,
"detail": "Invalid api key",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Please review the request URL.
{
"title": "Not Found",
"status": 404,
"detail": "Requested resource does not exist",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Unknown error, please try again later
{
"title": "Internal server error",
"status": 500,
"detail": "An unexpected error has occurred. Please try again later.",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |