---
title: SDK reference
description: Input and output details for the JavaScript and TypeScript SDK.
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://dev.lumopilot.com/llms.txt). Append `.md` to any page URL for its markdown version.

| Method | Input | Result |
| --- | --- | --- |
| `new LumoPilot(options)` | Required `apiKey`; optional `baseUrl` and custom `fetch`. | A server-side SDK client. The default API origin is `https://api.lumopilot.com`. |
| `accounts.list()` | No arguments. | Connected accounts with `id`, `platform`, and nullable `handle` and `displayName`. |
| `media.upload(files, options?)` | An array of `File` objects or Blob and filename pairs, plus an optional `{ idempotencyKey }`. | Private asset IDs and file metadata in input order. |
| `posts.schedule(input)` | Post input plus a future `scheduledAt` as a Date or ISO 8601 timestamp with a timezone. | A Post with its scheduled or current status. |
| `posts.publish(input)` | Post input. | A Post with its current aggregate status after the immediate publish attempt. |

The required key scopes are `accounts:read` for account listing, `media:upload` for uploads, and `posts:write` for scheduling or publishing.

## Post input

- `caption` and `accountIds` are required. Use unique account IDs from `accounts.list()`.
- `contentType` is `text` by default. Other values are `image`, `video`, and `carousel`.
- `mediaIds` lists ordered IDs for assets in your LumoPilot library.
- `tags` and `contentPillar` are optional.
- `idempotencyKey` identifies one logical post in your LumoPilot account. Use at most 120 characters. Reuse the same action and input on a retry.

## Post result

The result has `id`, `status`, `caption`, `contentType`, `createdAt`, and nullable `scheduledAt`. Timestamps are ISO 8601 strings. Statuses include `scheduled`, `publishing`, `published`, and `failed`. Check individual platform outcomes in LumoPilot before resending an uncertain or failed post.
