@rolino/sdk
v0.15.0
Published
Typed TypeScript client for the Rolino public API
Maintainers
Readme
@rolino/sdk
Pinterest and Google Business Profile
Exact-account drafts and delivery options support Pinterest carousels, paginated owned boards, and Google text/image updates. See the shared agent guide for typed SDK calls, limits, review, recovery, and coordinated package upgrades.
Facebook Page video update
The Page video release adds VIDEO to Facebook delivery options. Earlier clients
reject that value. After the coordinated release is published, update the installed
SDK, CLI, or local MCP package; update contracts too if imported directly. Restart
local MCP and update pinned launch versions. Hosted MCP updates with the server.
See package upgrade instructions.
Typed, runtime-validated client for Rolino's public API. It targets both the hosted service and any self-hosted Rolino base URL, including reverse-proxy path prefixes.
import { RolinoClient } from "@rolino/sdk"
const rolino = new RolinoClient({
baseUrl: process.env.ROLINO_URL!,
token: () => process.env.ROLINO_TOKEN,
timeoutMs: 15_000,
})
const actor = await rolino.whoami()
const createdProject = await rolino.projects.create(
{
name: "Northstar",
type: "PRODUCT",
website: "https://northstar.example",
description: "Product launch workspace",
},
{ idempotencyKey: "create-northstar-2026-07-26" },
)
const projects = await rolino.projects.list({ limit: 25 })
const posts = await rolino.posts.list(projects.items[0].id, {
limit: 25,
status: "SCHEDULED",
})
// storage:read and media:delete are independent opt-in capabilities.
const storage = await rolino.storage.getUsage()
const oldUnusedMedia = await rolino.media.listWorkspace({
createdBefore: "2026-08-01T00:00:00.000Z",
unusedOnly: true,
order: "OLDEST_FIRST",
})
const cleanupPreview = await rolino.media.previewCleanup({
selection: { mode: "ASSET_IDS", scope: { type: "WORKSPACE" }, assetIds: oldUnusedMedia.items.map(({ id }) => id) },
})
// Show the cutoff, counts, unknown sizes, and estimated space. Execute only
// after explicit approval of this exact preview.
const cleanup = await rolino.media.executeCleanup({
selection: cleanupPreview.selection,
candidateDigest: cleanupPreview.candidateDigest,
confirmationToken: cleanupPreview.confirmation.token,
}, { idempotencyKey: "cleanup-approved-media-2026-09-03" })
const cleanupProgress = await rolino.media.getCleanupStatus(cleanup.cleanupId)
// SKIPPED_CHANGED means the approved asset identity or version changed before
// the worker ran. Rolino does not call storage for that item.
// Requires an explicitly granted seo:read capability.
const seoOpportunities = await rolino.seo.opportunities.list(
projects.items[0].id,
{ limit: 20, expectedImpact: "HIGH" },
)
const seoBrief = await rolino.seo.opportunities.get(
projects.items[0].id,
seoOpportunities.items[0].id,
)
// seoBrief.task is the canonical versioned task. READY can request complete
// deliverables for review. NEEDS_REVIEW must validate or reject before drafting.
// seoBrief.confidence keeps topic relevance separate from action readiness.
// A Research task has only RESEARCH_TASK selected and no preferred final format.
// Neither decision grants publish authority or any Rolino write authority.
const seoReports = await rolino.seo.reports.list(projects.items[0].id, {
limit: 10,
})
// Backlink access is independent from seo:read. Safe prospect reads require
// backlinks:read. Network-backed work requires backlinks:write. Public contact
// details and drafts require backlinks:contacts together with read access.
const backlinkProspects = await rolino.backlinks.prospects.list(projects.items[0].id)
const backlinkDetail = await rolino.backlinks.prospects.get(
projects.items[0].id,
backlinkProspects.items[0].id,
)
// Rolino prepares editable outreach drafts. It never sends email.
// Provider discovery requires blog:manage. Destination and delivery reads
// require blog:read and return no draft content or provider-private data.
const blogProviders = await rolino.blog.publishing.providers(projects.items[0].id)
const blogDestinations = await rolino.blog.publishing.destinations(projects.items[0].id)
const blogDeliveries = await rolino.blog.publishing.deliveries(
projects.items[0].id,
"article-id", // Optional exact article filter.
)
// Active editorial calendar changes require blog:write. Preview cadence first,
// then execute only the unchanged preview. Neither operation changes publishing.
const cadencePreview = await rolino.blog.plans.previewCadence(
projects.items[0].id,
"plan-id",
{ weekdays: [1, 3, 5], expectedPlanVersion: 1 },
)
await rolino.blog.plans.executeCadence(projects.items[0].id, "plan-id", {
weekdays: cadencePreview.newWeekdays,
expectedPlanVersion: cadencePreview.planVersion,
expectedScheduleDigest: cadencePreview.scheduleDigest,
confirmationToken: cadencePreview.confirmation!.token,
idempotencyKey: "cadence-plan-1-version-1",
})
// Review required: blog:read + blog:write. This can create and review image
// candidates, but it cannot approve or publish an article.
const article = await rolino.blog.articles.get(projects.items[0].id, "article-id")
const generatedImage = await rolino.blog.articles.generateImage(
projects.items[0].id,
article.id,
{ revisionId: article.revisions[0].id, editorialBrief: "Warm editorial workspace with a clear calendar", idempotencyKey: "featured-image-article-1" },
)
await rolino.blog.articles.reviewImage(
projects.items[0].id,
article.id,
generatedImage.image.id,
{ expectedVersion: generatedImage.image.version, decision: "APPROVED", altText: "Product team reviewing a content calendar", idempotencyKey: "review-featured-image-1" },
)
// Agent approval: the separate blog:approve capability approves only the
// exact confirmed revision and image bundle. It still cannot publish.
const approval = await rolino.blog.articles.previewApproval(
projects.items[0].id,
article.id,
{ revisionId: article.revisions[0].id },
)
await rolino.blog.articles.executeApproval(projects.items[0].id, article.id, {
revisionId: approval.revisionId,
confirmationToken: approval.confirmation.token,
idempotencyKey: "approve-article-1-bundle-1",
})
// Full publishing: blog:publish remains separate. Schedule preview and execute
// bind the exact approved bundle, destinations, UTC instant, and IANA timezone.
const schedule = await rolino.blog.articles.previewSchedule(
projects.items[0].id,
article.id,
{ revisionId: approval.revisionId, scheduledAt: "2026-08-20T14:00:00.000Z", timezone: "America/Toronto" },
)
await rolino.blog.articles.executeSchedule(projects.items[0].id, article.id, {
revisionId: schedule.revisionId,
destinationIds: schedule.destinationIds,
scheduledAt: schedule.scheduledAt,
timezone: schedule.timezone,
confirmationToken: schedule.confirmation.token,
idempotencyKey: "schedule-article-1-bundle-1",
})
// Complete order: read setup and current article or plan state; ask for a
// missing website, cadence, destination, or access level; poll import and plan
// jobs; present evidence; create one immutable revision with catalog-backed
// links; generate or upload and review one image with alt text; stop for user
// approval without blog:approve; otherwise preview and execute exact approval
// with confirmation and idempotency; stop after approval without blog:publish;
// otherwise preview and execute unchanged publication or scheduling; poll
// delivery attempts and verify the live URL; and restart from approval preview
// after any content or image change. Existing credentials do not gain
// blog:approve, and a queued delivery is not published.
const tiktokOptions = await rolino.integrations.deliveryOptions(
projects.items[0].id,
"TIKTOK",
)
const tiktokDraft = await rolino.posts.create(
projects.items[0].id,
{
caption: "TikTok launch",
platforms: ["TIKTOK"],
mediaAssetIds: ["stored-video-asset-id"],
tiktokSettings: {
postMode: "DIRECT_POST",
privacyLevel: tiktokOptions.visibilityOptions[0],
allowComment: tiktokOptions.interactions.comment.available,
allowDuet: false,
allowStitch: false,
commercialContentEnabled: false,
promotesOwnBrand: false,
promotesThirdParty: false,
isAiGenerated: false,
reviewed: true,
},
},
{ idempotencyKey: "tiktok-launch-draft" },
)
await rolino.posts.update(
projects.items[0].id,
tiktokDraft.id,
{ caption: "Revised TikTok launch" },
{ expectedVersion: tiktokDraft.version, idempotencyKey: "tiktok-caption-v2" },
)
const youtubeDraft = await rolino.posts.create(
projects.items[0].id,
{
caption: "Shared YouTube description",
platforms: ["YOUTUBE"],
mediaAssetIds: ["stored-video-asset-id"],
youtubeSettings: {
title: "Launch video",
categoryId: "22",
privacyStatus: "PRIVATE",
madeForKids: false,
containsSyntheticMedia: false,
notifySubscribers: true,
tags: ["launch"],
},
},
{ idempotencyKey: "youtube-launch-draft" },
)
const blueskyDraft = await rolino.posts.create(
projects.items[0].id,
{
caption: "Shared launch",
platforms: ["BLUESKY"],
mediaAssetIds: [],
captionOverrides: { BLUESKY: "Launch day 🦋" },
},
{ idempotencyKey: "bluesky-launch-draft" },
)
const linkedinOptions = await rolino.integrations.deliveryOptions(
projects.items[0].id,
"LINKEDIN",
)
const linkedinDraft = await rolino.posts.create(
projects.items[0].id,
{
caption: "Product launch",
platforms: ["LINKEDIN"],
mediaAssetIds: linkedinOptions.supportedPostTypes.includes("VIDEO")
? ["stored-mp4-asset-id"]
: [],
captionOverrides: { LINKEDIN: "Product launch for our LinkedIn network" },
},
{ idempotencyKey: "linkedin-launch-draft" },
)
const googleBusinessProfileDraft = await rolino.posts.create(
projects.items[0].id,
{
caption: "New product available in store",
platforms: ["GOOGLE_BUSINESS_PROFILE"],
mediaAssetIds: ["stored-jpeg-or-png-asset-id"],
captionOverrides: {
GOOGLE_BUSINESS_PROFILE: "Visit us to see our latest product.",
},
},
{ idempotencyKey: "google-business-profile-launch-draft" },
)
const preview = await rolino.posts.previewPublish(
projects.items[0].id,
posts.items[0].id,
{ destinations: ["INSTAGRAM"] },
{ expectedVersion: posts.items[0].version },
)Responses are validated against @rolino/contracts. API, network, and timeout
failures use separate typed errors; bearer credentials are never included in
errors. Consequential scheduling and publishing use separate preview and
execute methods so the server, rather than the caller, enforces confirmation.
Draft updates are partial: omitted media, destinations, captions, and provider
settings are preserved. TikTok creator options use a provider-discriminated
response so future networks can add their own strict option variant without
changing the client workflow. Editing TikTok content clears its prior review.
YouTube uses the same methods and scopes: readiness requires one stored video
and explicit metadata. Immediate publishing reports deliveryMode: "IMMEDIATE",
preserves Public, Unlisted, or Private visibility, and does not create a
schedule. Future scheduling reports deliveryMode: "SCHEDULED", requires
Public visibility, and starts early private preparation. executeSchedule
returns a typed PENDING result with phase REMOTE_SCHEDULE_CONFIRMATION when
the upload is complete but YouTube has not yet acknowledged the requested
publish time; the video remains private and no second publish action is needed.
Bluesky supports text-only drafts and up to four stored images, with a
300-grapheme destination override and the same readiness, preview, execute,
health, and calendar methods.
LinkedIn supports text-only member posts, up to ten stored JPEG/PNG images, or
exactly one stored MP4 without mixing images and video. Native video must be
75 KB to 500 MB and 3 seconds to 30 minutes. Its delivery-options response
identifies the connected member and exposes the strict image and video policy
without credentials. Video publish and schedule execution remains in
PREPARING until LinkedIn confirms upload and processing. Company Page
publishing is not part of this contract, and an unknown final create result
must be checked on LinkedIn before retrying.
Google Business Profile supports text-only standard updates or one stored JPEG
or PNG image with a stable public URL. Rolino uses the location selected in
Integrations and owns immediate or scheduled delivery. An unknown final create
result must be checked on the selected Business Profile before retrying.
The server's independent YouTube, Bluesky, LinkedIn, and Google Business
Profile feature gates and approval status remain authoritative; the SDK cannot
enable or bypass them. Self-hosted
operators should follow the
YouTube operations guide
and
Bluesky operations guide,
LinkedIn operations guide
and the
Google Business Profile operations guide
before live testing.
Project creation has the same hosted and self-hosted behavior, requires an
explicit idempotency key, and atomically creates the project's paired brand.
It does not start research, connect accounts, schedule posts, or publish.
Support, security, and license
Stable releases are published only after the maintainer approves the release gate. Report bugs through the Rolino issue tracker and security issues through the repository's security policy.
@rolino/sdk is available under the MIT License.
Existing delivery recovery
Use client.posts.checkDelivery(projectId, postId, { provider: "YOUTUBE" }) to read the existing upload and reconcile Rolino. This requires posts:write and never uploads or publishes. Unsupported provider reads return UNKNOWN for manual review.
const input = { provider: "YOUTUBE", action: "RESUME", videoId: "VIDEO_ID_11", publishAt: null } as const;
const preview = await client.posts.previewRecovery(projectId, postId, input, { expectedVersion: post.version });
// Present preview.title, preview.channel, and preview.consequence to the user.
// Execute only after the user approves this exact preview.
const result = await client.posts.executeRecovery(projectId, postId,
{ ...input, confirmationToken: preview.confirmation.token },
{ expectedVersion: preview.version, idempotencyKey: stableRetryKey });RESUME requires an explicit future publishAt or null to publish now. It also requires posts:schedule or posts:publish, respectively. ATTACH requires a video ID and must omit publishAt; it links a verified video without publishing it. Follow ATTACHED with checkDelivery. QUEUED is pending confirmation. Reuse the same idempotency key after an uncertain response. Recovery affects only the chosen destination and creates no new upload.
Bluesky
Call integrations.deliveryOptions(projectId, "BLUESKY") for account health, media limits, and the owner OAuth handoff. Use shared draft, media, publish, schedule, and delivery-check methods. posts.previewScheduleCancellation and posts.executeScheduleCancellation cancel a future untouched local schedule with the current version, confirmation, and stable idempotency key. See docs/agent-platform/bluesky.md in the repository.
Bluesky workflows also support image alt text, confirmed deletion of untouched drafts (posts:delete), and confirmed account disconnection (integrations:disconnect). These permissions are optional and independent. See the complete workflow map.
Multiple publishing accounts
Use saved connection IDs from integration health, not account names. A draft's destinations array can select several accounts on the same network. Each item contains integrationId, provider, and optional captionOverride, tiktokSettings, youtubeSettings, and facebookSettings. A null caption override uses the shared caption. Provide YouTube settings for every YouTube account. TikTok choices and consent belong to each account. Each Facebook Page needs { format: "FEED", linkUrl: null } or one HTTPS link URL. For video, use FEED with one MP4 or MOV in its original aspect ratio, or REEL with one vertical 9:16 video. Put links in the caption. Refresh delivery options: video availability depends on the deployment acceptance switch. Page Reels are public.
Do not combine destinations with legacy platforms or provider-level settings. A legacy provider-only request is accepted only when its account is unambiguous. The server returns a selection error otherwise. Missing or changed account identity never selects a replacement account.
Saved post destinations have their own id. Use these destination IDs for publish destinationIds and recovery destinationId; they are different from connection integrationId. Preview, version, confirmation token, and selected destination IDs must remain unchanged when confirming. A pending schedule response can contain several destinations, each with its own mutationId. Wait for each account's confirmed result.
These contracts are staged with the multi-account database migrations. Deploy the server and worker with the same schema before using them. Existing remote receipts remain attached to their saved accounts. No live provider acceptance test is implied by local contract tests.
Article credits
Hosted article credits are shared across the workspace and reset monthly. The first saved generation uses one credit. Three successful regenerations are included per article; each later regeneration needs explicit user confirmation and one credit. Failed attempts use no credits. Reuse the same idempotency key after a network failure.
SDK: use blog.articles.previewGeneration before generate. CLI: use blog articles generate --preview, then --confirmation-token TOKEN --yes only after approval. MCP: use generate_blog_article with previewOnly, then send the returned confirmationToken after explicit approval. Preview returns the charge, usage, reservations, reset date, and included regenerations. Server checks reject stale or reused tokens. See the operating rules.
Article draft updates require draftId and version from the latest article response. Version numbers alone cannot identify a replacement draft. Old or mismatched draft identities return a conflict; reload the current draft before editing it.
Website integrations
Umami and Datafast reports and confirmed management, plus confirmed Astro setup, are available through the shared agent operations. See the website integration guide for permissions, inputs, secret handling, and recovery.
TikTok photo carousels
TikTok supports one video or up to 10 ordered photos. Photo originals must be JPEG, PNG, or WebP, up to 25 MiB each. Rolino makes JPEG delivery copies and keeps originals. The photoCoverIndex is zero-based and defaults to 0; keep allowDuet and allowStitch false and videoCoverTimestampMs null. autoAddMusic is optional, off by default, and only applies to direct photo posts. Photo inbox drafts include the caption; video inbox drafts do not. Refresh exact-account delivery options and review settings after content changes.
Upgrade SDK, CLI, and local MCP clients together to 0.13.0 before using non-default photo settings. Older strict response schemas cannot read these new fields. Default cover and disabled music are omitted from saved settings and API responses. New response schemas ignore unknown fields; request validation remains strict.
Internal approval in 0.14.0
Update the installed entry point to use review submission and feedback:
npm install @rolino/[email protected]
npm install --global @rolino/[email protected] @rolino/[email protected]Install contracts separately only when your code imports them directly. Restart local MCP after the update. Hosted MCP updates with the Rolino application.
Schedule, publish and recovery execution can return PENDING_INTERNAL_APPROVAL
inside internalApproval, with an authenticated reviewUrl and a request ID.
This means publication has not started. Explicitly submit the request for review,
return the link to the user, and wait for a human decision. Agents cannot approve,
assign reviewers or disable the requirement. The server feature gate is separate
from the npm release. Updating packages does not enable the production feature.
