Get post
Fetch a single post by ID. For published posts, this returns platformPostUrl for each platform.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.posts.getPost({ path: { postId: 'post_abc123', },});console.log(data);{
"post": {
"_id": "65f1c0a9e2b5af0012ab34cd",
"title": "Launch post",
"content": "We just launched!",
"status": "scheduled",
"scheduledFor": "2024-11-01T10:00:00Z",
"platforms": [
{
"platform": "twitter",
"accountId": {
"_id": "64e1f0...",
"platform": "twitter",
"username": "@acme",
"displayName": "Acme Corp",
"isActive": true
},
"status": "pending"
}
]
}
}{
"error": "Unauthorized"
}{
"error": "Not found"
}Create post POST
Create and optionally publish a post. Immediate posts (publishNow: true) include platformPostUrl in the response. Content is optional when media is attached or all platforms have customContent. See each platform's schema for media constraints.
Update post metadata POST
Updates metadata of a published video on the specified platform without re-uploading. Currently only supported for YouTube. At least one updatable field is required. Two modes: 1. Post-based (video published through Zernio): pass the Zernio postId in the URL and platform in the body. 2. Direct video ID (video uploaded outside Zernio, e.g. directly to YouTube): use _ as the postId, and pass videoId + accountId + platform in the body. The accountId is the Zernio social account ID for the connected YouTube channel.