Sign in

API

Authentication & endpoints

Base URL for Duskly Cloud: https://api.duskly.site. Self-host uses your own API origin. All /v1/* routes need auth.

API tokens

In the app, open Settings → API tokens and create a token. The secret is shown once and starts with dk_.

Send it as Authorization: Bearer dk_… or X-Api-Token: dk_…. Tokens are scoped to the workspace that minted them. Session cookies from Sign in also work for browser clients.

Routes below that show workspaceId still need that value in the query string or body — the token does not fill it in. Copy it from Settings (the Workspace ID row). MCP tools do not take this id; they use the token’s workspace automatically.

Posts

GET /v1/posts?workspaceId=…

List posts for an account (newest scheduled first). limit defaults to 50 (max 100) and offset skips that many. next is the next offset, or null. The same query works on accounts, media, and inbox.

POST /v1/posts

Create a draft or scheduled post. Body includes workspaceId (copy from Settings). destinations is an array of social account ids. scheduledAt is unix milliseconds.

POST /v1/posts/:id/queue-now

Push a scheduled post into the publish queue immediately.

Accounts (channels)

GET /v1/accounts?workspaceId=…

List connected channels.

POST /v1/accounts

Add a channel (network + handle / credentials as required by that network).

PATCH /v1/accounts/:id

Update channel settings (e.g. Slack default channel).

DELETE /v1/accounts/:id?workspaceId=…

Disconnect a channel.

Media

GET /v1/media?workspaceId=…

List media library items.

POST /v1/media/upload

Multipart form: workspaceId + file.

GET /v1/media/:id/file?workspaceId=…

Download the stored file bytes.

POST /v1/media/edit

Apply a picture edit and store the result in the library.

Mint tokens via API

POST /v1/org/tokens with workspaceId (copy from Settings) and name (session auth). Response includes the raw token once. The minted token can only act on that workspace.

CLI

From a checkout of this repo, set DUSKLY_TOKEN and DUSKLY_WORKSPACE, then run pnpm duskly. Self-host sets DUSKLY_API to your API origin. Commands: channels, posts, schedule, pause.

n8n, Zapier, and Make

These call the same REST routes as the CLI. Import the n8n workflow or the Make scenario, then replace the token, workspace id, and channel id.