LateLate API

Quickstart


This guide walks you through everything you need to schedule your first post. By the end, you'll have:

  • Created a profile to organize your accounts
  • Connected a social media account
  • Scheduled a post to publish

Prerequisites: Make sure you have your API key ready.

Step 1: Create a Profile

Profiles group your social accounts together. For example, you might have a "Personal Brand" profile with your Twitter and LinkedIn, and a "Company" profile with your business accounts.

curl -X POST https://getlate.dev/api/v1/profiles \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My First Profile",
    "description": "Testing the Late API"
  }'
const response = await fetch('https://getlate.dev/api/v1/profiles', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'My First Profile',
    description: 'Testing the Late API'
  })
});

const { profile } = await response.json();
console.log('Profile created:', profile._id);
import requests

response = requests.post(
    'https://getlate.dev/api/v1/profiles',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'name': 'My First Profile',
        'description': 'Testing the Late API'
    }
)

profile = response.json()['profile']
print(f"Profile created: {profile['_id']}")

Response:

{
  "message": "Profile created successfully",
  "profile": {
    "_id": "prof_abc123",
    "name": "My First Profile",
    "description": "Testing the Late API",
    "createdAt": "2024-01-15T10:00:00.000Z"
  }
}

Save the _id value — you'll need it for the next steps.

Step 2: Connect a Social Account

Now connect a social media account to your profile. This uses OAuth, so it will redirect to the platform for authorization.

curl "https://getlate.dev/api/v1/connect/twitter?profileId=prof_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
  'https://getlate.dev/api/v1/connect/twitter?profileId=prof_abc123',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const { authUrl } = await response.json();
// Redirect user to this URL to authorize
window.location.href = authUrl;
import requests

response = requests.get(
    'https://getlate.dev/api/v1/connect/twitter',
    params={'profileId': 'prof_abc123'},
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)

auth_url = response.json()['authUrl']
print(f"Open this URL to authorize: {auth_url}")

This returns a URL. Open it in a browser to authorize Late to access your Twitter account. After authorization, you'll be redirected back and the account will be connected.

Available Platforms

Replace twitter with any of these:

PlatformAPI ValueGuide
Twitter/XtwitterTwitter Guide
InstagraminstagramInstagram Guide
Facebook PagesfacebookFacebook Guide
LinkedInlinkedinLinkedIn Guide
TikToktiktokTikTok Guide
YouTubeyoutubeYouTube Guide
PinterestpinterestPinterest Guide
RedditredditReddit Guide
BlueskyblueskyBluesky Guide
ThreadsthreadsThreads Guide
Google BusinessgooglebusinessGoogle Business Guide
TelegramtelegramTelegram Guide
SnapchatsnapchatSnapchat Guide

Step 3: Get Your Connected Accounts

After connecting, list your accounts to get the account ID:

curl "https://getlate.dev/api/v1/accounts" \
  -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://getlate.dev/api/v1/accounts', {
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

const { accounts } = await response.json();
console.log('Connected accounts:', accounts);
import requests

response = requests.get(
    'https://getlate.dev/api/v1/accounts',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)

accounts = response.json()['accounts']
for account in accounts:
    print(f"{account['platform']}: {account['_id']}")

Response:

{
  "accounts": [
    {
      "_id": "acc_xyz789",
      "platform": "twitter",
      "username": "yourhandle",
      "profileId": "prof_abc123"
    }
  ]
}

Save the account _id — you need it to create posts.

Step 4: Schedule Your First Post

Now you can schedule a post! Here's how to schedule a tweet for tomorrow at noon:

curl -X POST https://getlate.dev/api/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Hello world! This is my first post from the Late API 🚀",
    "scheduledFor": "2024-01-16T12:00:00",
    "timezone": "America/New_York",
    "platforms": [
      {
        "platform": "twitter",
        "accountId": "acc_xyz789"
      }
    ]
  }'
const response = await fetch('https://getlate.dev/api/v1/posts', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'Hello world! This is my first post from the Late API 🚀',
    scheduledFor: '2024-01-16T12:00:00',
    timezone: 'America/New_York',
    platforms: [
      {
        platform: 'twitter',
        accountId: 'acc_xyz789'
      }
    ]
  })
});

const { post } = await response.json();
console.log('Post scheduled:', post._id);
import requests

response = requests.post(
    'https://getlate.dev/api/v1/posts',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'content': 'Hello world! This is my first post from the Late API 🚀',
        'scheduledFor': '2024-01-16T12:00:00',
        'timezone': 'America/New_York',
        'platforms': [
            {
                'platform': 'twitter',
                'accountId': 'acc_xyz789'
            }
        ]
    }
)

post = response.json()['post']
print(f"Post scheduled: {post['_id']}")

Response:

{
  "message": "Post scheduled successfully",
  "post": {
    "_id": "post_123abc",
    "content": "Hello world! This is my first post from the Late API 🚀",
    "status": "scheduled",
    "scheduledFor": "2024-01-16T17:00:00.000Z",
    "platforms": [
      {
        "platform": "twitter",
        "accountId": "acc_xyz789",
        "status": "pending"
      }
    ]
  }
}

Your post is now scheduled and will publish automatically at the specified time.

Posting to Multiple Platforms

You can post to multiple platforms at once. Just add more entries to the platforms array:

curl -X POST https://getlate.dev/api/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Cross-posting to all my accounts!",
    "scheduledFor": "2024-01-16T12:00:00",
    "timezone": "America/New_York",
    "platforms": [
      {"platform": "twitter", "accountId": "acc_twitter123"},
      {"platform": "linkedin", "accountId": "acc_linkedin456"},
      {"platform": "bluesky", "accountId": "acc_bluesky789"}
    ]
  }'
const response = await fetch('https://getlate.dev/api/v1/posts', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'Cross-posting to all my accounts!',
    scheduledFor: '2024-01-16T12:00:00',
    timezone: 'America/New_York',
    platforms: [
      { platform: 'twitter', accountId: 'acc_twitter123' },
      { platform: 'linkedin', accountId: 'acc_linkedin456' },
      { platform: 'bluesky', accountId: 'acc_bluesky789' }
    ]
  })
});

const { post } = await response.json();
console.log('Cross-posted:', post._id);
import requests

response = requests.post(
    'https://getlate.dev/api/v1/posts',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'content': 'Cross-posting to all my accounts!',
        'scheduledFor': '2024-01-16T12:00:00',
        'timezone': 'America/New_York',
        'platforms': [
            {'platform': 'twitter', 'accountId': 'acc_twitter123'},
            {'platform': 'linkedin', 'accountId': 'acc_linkedin456'},
            {'platform': 'bluesky', 'accountId': 'acc_bluesky789'}
        ]
    }
)

post = response.json()['post']
print(f"Cross-posted: {post['_id']}")

Publishing Immediately

To publish right now instead of scheduling, use publishNow: true:

curl -X POST https://getlate.dev/api/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "This posts immediately!",
    "publishNow": true,
    "platforms": [
      {"platform": "twitter", "accountId": "acc_xyz789"}
    ]
  }'
const response = await fetch('https://getlate.dev/api/v1/posts', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'This posts immediately!',
    publishNow: true,
    platforms: [
      { platform: 'twitter', accountId: 'acc_xyz789' }
    ]
  })
});

const { post } = await response.json();
console.log('Published:', post._id);
import requests

response = requests.post(
    'https://getlate.dev/api/v1/posts',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'content': 'This posts immediately!',
        'publishNow': True,
        'platforms': [
            {'platform': 'twitter', 'accountId': 'acc_xyz789'}
        ]
    }
)

post = response.json()['post']
print(f"Published: {post['_id']}")

Creating a Draft

To save a post without publishing or scheduling:

curl -X POST https://getlate.dev/api/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "I will finish this later...",
    "platforms": [
      {"platform": "twitter", "accountId": "acc_xyz789"}
    ]
  }'
const response = await fetch('https://getlate.dev/api/v1/posts', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'I will finish this later...',
    platforms: [
      { platform: 'twitter', accountId: 'acc_xyz789' }
    ]
  })
});

const { post } = await response.json();
console.log('Draft saved:', post._id);
import requests

response = requests.post(
    'https://getlate.dev/api/v1/posts',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'content': 'I will finish this later...',
        'platforms': [
            {'platform': 'twitter', 'accountId': 'acc_xyz789'}
        ]
    }
)

post = response.json()['post']
print(f"Draft saved: {post['_id']}")

What's Next?

Now that you've scheduled your first post, explore more features:

Need Help?

Questions? Contact us at miki@getlate.dev