Skip to main content

Get Your API Key

Before you can use the PostSyncer API, you need to generate an API key.
1

Sign In

Visit app.postsyncer.com and sign in to your account.
2

Generate API Key

Go to Settings → API Integration and click “Create”. Copy the key immediately as it won’t be shown again.

Your First API Request

Let’s start by listing your workspaces to verify your API key is working.
curl -X GET "https://postsyncer.com/api/v1/workspaces" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
{
  { 
    "id": 12,
    "name": "abdulmejidshemsuawel",
    "slug": "abdulmejidshemsuawel",
    "type": "PERSONAL",
    "logo": null,
    "timezone": "Africa/Addis_Ababa",
    "language": "en",
    "accounts": [
      {
          "id": 136,
          "platform": "twitter",
          "username": "heyabdulmejid",
          "name": "Abdul",
          "avatar": "https://pbs.twimg.com/profile_images/1878383928995684352/3Xw5HTsk_400x400.jpg"
      }
    ]
  }
}

Create Your First Post

Now let’s create a simple text post across your connected accounts.
curl -X POST "https://postsyncer.com/api/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 12,
    "labels": [5],
    "content": [
      {
        "text": "Post Once. Publish everywhere",
        "media": [
          "https://postsyncer.com/images/og/banner.png?v2"
        ]
      }
    ],
    "schedule_type": "schedule",
    "schedule_for": {
      "date": "2025-07-04",
      "time": "23:00",
      "timezone": "Africa/Addis_Ababa"
    }, 
    "accounts": [
      {
        "id": 136,
        "settings": {
          "for_super_followers_only": false,
          "reply_settings": "everyone",
          "quote_tweet_id": 1940147562003963969,
          "reply": {
            "in_reply_to_tweet_id": null
          },
          "community_id": null,
          "share_with_followers": true,
          "text": null
        }
      },
      {
        "id": 95,
        "settings": {
          "board_id": 871517034080685367
        }
      }
    ]
  }'
{ 
  "id": 123,
  "workspace_id": 12,
  "labels": [5],
  "content": [
    {
      "text": "Pinterest publish",
      "media": [
        "https://cdn.pixabay.com/photo/2015/09/16/08/55/online-942406_1280.jpg"
      ]
    },
    {
      "text": "ACVA",
      "media": []
    }
  ],
  "schedule_type": "schedule",
  "schedule_for": {
    "date": "2025-07-04",
    "time": "23:00",
    "timezone": "Africa/Addis_Ababa"
  },
  "repeatable": true,
  "repeatable_times": 2,
  "repeatable_gap": 2,
  "repeatable_gap_unit": "days",
  "status": "scheduled",
  "created_at": "2024-01-15T10:30:00Z",
  "accounts": [
    {
      "id": 136,
      "name": "Twitter Account",
      "status": "scheduled",
      "settings": {
        "for_super_followers_only": false,
        "reply_settings": "everyone",
        "quote_tweet_id": 1940147562003963969,
        "reply": {
          "in_reply_to_tweet_id": null
        },
        "community_id": null,
        "share_with_followers": true,
        "text": null
      }
    },
    {
      "id": 95,
      "name": "Pinterest Account",
      "status": "scheduled",
      "settings": {
        "board_id": 871517034080685367
      }
    }
  ] 
}

List Your Posts

Retrieve all your posts to see what you’ve created.
curl -X GET "https://postsyncer.com/api/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

SDK Examples

JavaScript/Node.js

const axios = require('axios');

const apiKey = 'YOUR_API_KEY';
const baseURL = 'https://postsyncer.com/api/v1';

const api = axios.create({
  baseURL,
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  }
});

// Create a post
const createPost = async () => {
  try {
    const response = await api.post('/posts', {
      workspace_id: 12,
      labels: [5],
      content: [
        {
          text: 'Hello from Node.js!',
          media: []
        }
      ],
      schedule_type: 'schedule',
      schedule_for: {
        date: '2025-07-04',
        time: '23:00',
        timezone: 'Africa/Addis_Ababa'
      },
      repeatable: true,
      repeatable_times: 2,
      repeatable_gap: 2,
      repeatable_gap_unit: 'days',
      accounts: [
        {
          id: 136,
          settings: {
            for_super_followers_only: false,
            reply_settings: 'everyone',
            quote_tweet_id: null,
            reply: {
              in_reply_to_tweet_id: null
            },
            community_id: null,
            share_with_followers: true,
            text: null
          }
        }
      ]
    });
    console.log('Post created:', response.data);
  } catch (error) {
    console.error('Error:', error.response.data);
  }
};

createPost();

Python

import requests
import json
from datetime import datetime, timedelta

api_key = 'YOUR_API_KEY'
base_url = 'https://postsyncer.com/api/v1'

headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

# Create a post
def create_post():
    data = {
        'workspace_id': 12,
        'labels': [5],
        'content': [
            {
                'text': 'Hello from Python!',
                'media': []
            }
        ],
        'schedule_type': 'schedule',
        'schedule_for': {
            'date': '2025-07-04',
            'time': '23:00',
            'timezone': 'Africa/Addis_Ababa'
        }, 
        'accounts': [
            {
                'id': 136,
                'settings': {
                    'for_super_followers_only': False,
                    'reply_settings': 'everyone',
                    'quote_tweet_id': None,
                    'reply': {
                        'in_reply_to_tweet_id': None
                    },
                    'community_id': None,
                    'share_with_followers': true,
                    'text': None
                }
            }
        ]
    }
    
    response = requests.post(f'{base_url}/posts', headers=headers, json=data)
    print('Post created:', response.json())

create_post()

PHP

<?php

$api_key = 'YOUR_API_KEY';
$base_url = 'https://postsyncer.com/api/v1';

$headers = [
    'Authorization: Bearer ' . $api_key,
    'Content-Type: application/json'
];

// Create a post
function createPost() {
    global $base_url, $headers;
    
    $data = [
        'workspace_id' => 12,
        'labels' => [5],
        'content' => [
            [
                'text' => 'Hello from PHP!',
                'media' => []
            ]
        ],
        'schedule_type' => 'schedule',
        'schedule_for' => [
            'date' => '2025-07-04',
            'time' => '23:00',
            'timezone' => 'Africa/Addis_Ababa'
        ], 
        'accounts' => [
            [
                'id' => 136,
                'settings' => [
                    'for_super_followers_only' => false,
                    'reply_settings' => 'everyone',
                    'quote_tweet_id' => null,
                    'reply' => [
                        'in_reply_to_tweet_id' => null
                    ],
                    'community_id' => null,
                    'share_with_followers': true,
                    'text' => null
                ]
            ]
        ]
    ];
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $base_url . '/posts');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $response = curl_exec($ch);
    curl_close($ch);
    
    echo 'Post created: ' . $response;
}

createPost();
?>

Next Steps

Now that you’ve made your first API calls, explore these resources: