Quickstart
Get started with the Zernio API - authenticate, connect accounts, and schedule your first post in minutes.
Zernio is a social media scheduling platform that lets you manage and publish content across all major platforms from a single API. Whether you're building a social media tool, automating your content workflow, or managing multiple brands, Zernio's API gives you complete control.
Base URL: https://zernio.com/api/v1
Install the SDK
npm install @zernio/nodepip install zernio-sdkgo get github.com/zernio-dev/zernio-gogem install zernio-sdk<dependency>
<groupId>com.zernio</groupId>
<artifactId>zernio-sdk</artifactId>
<version>1.0.1</version>
</dependency>composer require zernio-dev/zernio-phpdotnet add package Zerniocargo add zernioAuthentication
All API requests require an API key. The SDKs read from the ZERNIO_API_KEY environment variable by default.
Getting Your API Key
- Log in to your Zernio account at zernio.com
- Go to Settings → API Keys
- Click Create API Key
- Copy the key immediately - you won't be able to see it again
Set Up the Client
import Zernio from '@zernio/node';
const zernio = new Zernio(); // uses ZERNIO_API_KEY env varfrom zernio import Zernio
client = Zernio() # uses ZERNIO_API_KEY env var# Set your API key as an environment variable
export ZERNIO_API_KEY="sk_..."
# All requests use the Authorization header
curl https://zernio.com/api/v1/posts \
-H "Authorization: Bearer $ZERNIO_API_KEY"Key format: sk_ prefix + 64 hex characters (67 total). Keys are stored as SHA-256 hashes - they're only shown once at creation.
Security tips: Use environment variables, create separate keys per app, and rotate periodically. You can also manage keys via the API.
Key Concepts
- Profiles - Containers that group social accounts together (think "brands" or "projects")
- Accounts - Your connected social media accounts, belonging to profiles
- Posts - Content to publish, schedulable to multiple accounts across platforms simultaneously
- Queue - Optional recurring time slots for auto-scheduling posts
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.
const { profile } = await zernio.profiles.createProfile({
name: 'My First Profile',
description: 'Testing the Zernio API'
});
console.log('Profile created:', profile._id);result = client.profiles.create(
name="My First Profile",
description="Testing the Zernio API"
)
print(f"Profile created: {result.profile['_id']}")curl -X POST https://zernio.com/api/v1/profiles \
-H "Authorization: Bearer $ZERNIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My First Profile",
"description": "Testing the Zernio API"
}'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.
const { authUrl } = await zernio.connect.getConnectUrl({
platform: 'twitter',
profileId: 'prof_abc123'
});
// Redirect user to this URL to authorize
console.log('Open this URL:', authUrl);result = client.connect.get_connect_url(
platform="twitter",
profile_id="prof_abc123"
)
print(f"Open this URL: {result.auth_url}")curl "https://zernio.com/api/v1/connect/twitter?profileId=prof_abc123" \
-H "Authorization: Bearer $ZERNIO_API_KEY"Open the URL in a browser to authorize Zernio 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:
| Platform | API Value | Guide |
|---|---|---|
| Twitter/X | twitter | Twitter Guide |
instagram | Instagram Guide | |
| Facebook Pages | facebook | Facebook Guide |
linkedin | LinkedIn Guide | |
| TikTok | tiktok | TikTok Guide |
| YouTube | youtube | YouTube Guide |
pinterest | Pinterest Guide | |
reddit | Reddit Guide | |
| Bluesky | bluesky | Bluesky Guide |
| Threads | threads | Threads Guide |
| Google Business | googlebusiness | Google Business Guide |
| Telegram | telegram | Telegram Guide |
| Snapchat | snapchat | Snapchat Guide |
Step 3: Get Your Connected Accounts
After connecting, list your accounts to get the account ID:
const { accounts } = await zernio.accounts.listAccounts();
for (const account of accounts) {
console.log(`${account.platform}: ${account._id}`);
}result = client.accounts.list()
for account in result.accounts:
print(f"{account['platform']}: {account['_id']}")curl "https://zernio.com/api/v1/accounts" \
-H "Authorization: Bearer $ZERNIO_API_KEY"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:
const { post } = await zernio.posts.createPost({
content: 'Hello world! This is my first post from the Zernio API',
scheduledFor: '2024-01-16T12:00:00',
timezone: 'America/New_York',
platforms: [
{ platform: 'twitter', accountId: 'acc_xyz789' }
]
});
console.log('Post scheduled:', post._id);result = client.posts.create(
content="Hello world! This is my first post from the Zernio API",
scheduled_for="2024-01-16T12:00:00",
timezone="America/New_York",
platforms=[
{"platform": "twitter", "accountId": "acc_xyz789"}
]
)
print(f"Post scheduled: {result.post['_id']}")curl -X POST https://zernio.com/api/v1/posts \
-H "Authorization: Bearer $ZERNIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Hello world! This is my first post from the Zernio API",
"scheduledFor": "2024-01-16T12:00:00",
"timezone": "America/New_York",
"platforms": [
{"platform": "twitter", "accountId": "acc_xyz789"}
]
}'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:
const { post } = await zernio.posts.createPost({
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' }
]
});result = client.posts.create(
content="Cross-posting to all my accounts!",
scheduled_for="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"}
]
)curl -X POST https://zernio.com/api/v1/posts \
-H "Authorization: Bearer $ZERNIO_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"}
]
}'Publishing Immediately
To publish right now instead of scheduling, use publishNow: true:
const { post } = await zernio.posts.createPost({
content: 'This posts immediately!',
publishNow: true,
platforms: [
{ platform: 'twitter', accountId: 'acc_xyz789' }
]
});result = client.posts.create(
content="This posts immediately!",
publish_now=True,
platforms=[
{"platform": "twitter", "accountId": "acc_xyz789"}
]
)curl -X POST https://zernio.com/api/v1/posts \
-H "Authorization: Bearer $ZERNIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "This posts immediately!",
"publishNow": true,
"platforms": [
{"platform": "twitter", "accountId": "acc_xyz789"}
]
}'Creating a Draft
To save a post without publishing or scheduling, omit both scheduledFor and publishNow:
const { post } = await zernio.posts.createPost({
content: 'I will finish this later...',
platforms: [
{ platform: 'twitter', accountId: 'acc_xyz789' }
]
});result = client.posts.create(
content="I will finish this later...",
platforms=[
{"platform": "twitter", "accountId": "acc_xyz789"}
]
)curl -X POST https://zernio.com/api/v1/posts \
-H "Authorization: Bearer $ZERNIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "I will finish this later...",
"platforms": [
{"platform": "twitter", "accountId": "acc_xyz789"}
]
}'What's Next?
- Platform Guides - Learn platform-specific features and requirements
- Upload media - Add images and videos to your posts
- Set up a queue - Create recurring posting schedules
- View analytics - Track how your posts perform
- Invite team members - Collaborate with your team
- CLI - Manage posts from the terminal