List Connected Accounts
Retrieve a list of all social media profiles connected to your SchedPilot account. You will need the id from these objects to specify where your content should be published.
Endpoint
GET https://api.schedpilot.com/developers/v1/accounts
Headers
| Header | Value | Description |
|---|---|---|
X-API-KEY | smm_your_secret_key | Your unique API key generated in the dashboard. |
Content-Type | application/json | Standard JSON content type. |
Response Structure
The response returns an object containing an array of accounts. Each account object includes:
id: (Integer) The unique identifier for this specific connection.type: (String) The platform type (e.g.,twitter,facebook,linkedin,youtube).name: (String) The display name or handle of the profile.image: (String) The URL to the profile picture.
Example Request
curl -X GET [https://api.schedpilot.com/developers/v1/accounts](https://api.schedpilot.com/developers/v1/accounts) \
-H "X-API-KEY: smm_a1b2c3d4e5f6g7h8" \
-H "Content-Type: application/json"
Response Fields
| Field | Type | Description |
|---|---|---|
code | number | The HTTP-like status code (e.g., 200). |
accounts | array | A list of connected social media profile objects. |
accounts[].id | number | Primary Key. Use this ID in the POST /post endpoint. |
accounts[].type | string | The platform slug. Possible values: facebook, twitter, linkedin, instagram, threads, bluesky, pinterest, youtube, tiktok. |
accounts[].name | string | The display name, page name, or handle of the account. |
accounts[].image | string | A fully-qualified URL to the account's profile picture. |
Example Response
{
"code": 200,
"accounts": [
{
"id": 142,
"type": "twitter",
"name": "SchedPilot_App",
"image": "[https://pbs.twimg.com/profile_images/123/avatar.jpg](https://pbs.twimg.com/profile_images/123/avatar.jpg)"
},
{
"id": 88,
"type": "linkedin",
"name": "SchedPilot Official",
"image": "[https://media.licdn.com/dms/image/ABC/profile.jpg](https://media.licdn.com/dms/image/ABC/profile.jpg)"
}
]
}
Code Examples
- PHP
- Python
- Node.js
- Go
<?php
$apiKey = 'smm_your_secret_key';
$url = '[https://api.schedpilot.com/developers/v1/accounts](https://api.schedpilot.com/developers/v1/accounts)';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-KEY: ' . $apiKey,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch);
} else {
// Access the accounts array
print_r($data['accounts']);
}
curl_close($ch);
?>
import requests
api_key = "smm_your_secret_key"
url = "[https://api.schedpilot.com/developers/v1/accounts](https://api.schedpilot.com/developers/v1/accounts)"
headers = {
"X-API-KEY": api_key,
"Content-Type": "application/json"
}
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
accounts = response.json().get("accounts", [])
for account in accounts:
print(f"ID: {account['id']} | Type: {account['type']} | Name: {account['name']}")
except requests.exceptions.RequestException as e:
print(f"Error fetching accounts: {e}")
const axios = require('axios');
const apiKey = 'smm_your_secret_key';
const url = '[https://api.schedpilot.com/developers/v1/accounts](https://api.schedpilot.com/developers/v1/accounts)';
async function getAccounts() {
try {
const response = await axios.get(url, {
headers: {
'X-API-KEY': apiKey,
'Content-Type': 'application/json'
}
});
console.log(response.data.accounts);
} catch (error) {
console.error('API Error:', error.response ? error.response.data : error.message);
}
}
getAccounts();
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "[https://api.schedpilot.com/developers/v1/accounts](https://api.schedpilot.com/developers/v1/accounts)"
apiKey := "smm_your_secret_key"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("X-API-KEY", apiKey)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Printf("Request Failed: %s", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}