Appearance
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
bash
npm install @zernio/nodebash
pip install zernio-sdkbash
go get github.com/zernio-dev/zernio-gobash
gem install zernio-sdkxml
<dependency>
<groupId>com.zernio</groupId>
<artifactId>zernio-sdk</artifactId>
<version>1.0.1</version>
</dependency>bash
composer require zernio-dev/zernio-phpbash
dotnet add package Zerniobash
cargo 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
typescript
import Zernio from '@zernio/node';
const zernio = new Zernio(); // uses ZERNIO_API_KEY env varpython
from zernio import Zernio
client = Zernio() # uses ZERNIO_API_KEY env varbash
# 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.
typescript
const { profile } = await zernio.profiles.createProfile({
name: 'My First Profile',
description: 'Testing the Zernio API'
});
console.log('Profile created:', profile._id);python
result = client.profiles.create_profile(
name="My First Profile",
description="Testing the Zernio API"
)
print(f"Profile created: {result.profile['_id']}")bash
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.
typescript
const { authUrl } = await zernio.connect.getConnectUrl({
platform: 'twitter',
profileId: 'prof_abc123'
});
// Redirect user to this URL to authorize
console.log('Open this URL:', authUrl);python
result = client.connect.get_connect_url(
platform="twitter",
profile_id="prof_abc123"
)
print(f"Open this URL: {result.auth_url}")bash
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:
Step 3: Get Your Connected Accounts
After connecting, list your accounts to get the account ID:
typescript
const { accounts } = await zernio.accounts.listAccounts();
for (const account of accounts) {
console.log(`${account.platform}: ${account._id}`);
}python
result = client.accounts.list_accounts()
for account in result.accounts:
print(f"{account['platform']}: {account['_id']}")bash
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:
typescript
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);python
result = client.posts.create_post(
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']}")bash
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:
typescript
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' }
]
});python
result = client.posts.create_post(
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"}
]
)bash
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:
typescript
const { post } = await zernio.posts.createPost({
content: 'This posts immediately!',
publishNow: true,
platforms: [
{ platform: 'twitter', accountId: 'acc_xyz789' }
]
});python
result = client.posts.create_post(
content="This posts immediately!",
publish_now=True,
platforms=[
{"platform": "twitter", "accountId": "acc_xyz789"}
]
)bash
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:
typescript
const { post } = await zernio.posts.createPost({
content: 'I will finish this later...',
platforms: [
{ platform: 'twitter', accountId: 'acc_xyz789' }
]
});python
result = client.posts.create_post(
content="I will finish this later...",
platforms=[
{"platform": "twitter", "accountId": "acc_xyz789"}
]
)bash
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