rizamodocs

SDKs

The official TypeScript and Python SDKs, generated from the API itself.

Both are generated from openapi.json at each release, so every endpoint in the API reference is a typed method, with its sample on its page.

npm install rizamo

Set up the client

It reads your API key from RIZAMO_API_KEY (Authentication), or takes it as apiKey (api_key in Python).

import { RizamoClient } from "rizamo";

const rizamo = new RizamoClient();

Schedule a post

An endpoint is a method named after it: Create a post is rizamo.posts.create. Fields keep the API's names in TypeScript and are snake_case in Python.

const post = await rizamo.posts.create({
  profileId: "prof_...",
  targets: [{ accountId: "acc_..." }],
  text: "Hello from the Rizamo API",
  mediaIds: ["med_..."],
  status: "scheduled",
  scheduledAt: "2027-06-01T09:00:00Z",
});
console.log(post.id);

Lists

Loop over a list and the SDK asks for the next page as you go (Pages).

for await (const post of await rizamo.posts.list({ status: "scheduled" })) {
  console.log(post.id);
}

Errors and retries

An error answer is thrown with its status and Rizamo's error body. Calls other than POST retry by themselves on a timeout, a rate limit or a server error, twice, waiting Retry-After when there is one. A POST never retries by itself: send an idempotency key and retry it yourself (Retries).

import { RizamoError } from "rizamo";

try {
  await rizamo.posts.publish({ id: "post_..." }, { idempotencyKey: crypto.randomUUID() });
} catch (error) {
  if (error instanceof RizamoError) console.log(error.statusCode, error.body);
}

Versions

Rizamo adds fields and values within v1 (Versions), and both SDKs let the ones they do not know through, so an older release keeps working. Update it to get their types.

On this page