monoesdocs
Menu

API reference

Library

Workflows, web automations (.mpkg) and orgs that MonoAgent installs: list, download, publish and version them.

GET/api/library/itemsPublic

List library items.

Request

Query params: kind ('workflow'|'automation'|'org'), scope ('public' (default: public + official) | 'official' | 'mine'), q, tag, page (1-indexed), per_page (≤ 100, default 24)

Response

{ items: Item[], page, per_page, total }

scope=mine needs library:read (401 without credentials). Item: { id, kind, slug, name, description, version, visibility, tags, owner: { id, username, name }, sha256, size, meta, created_at, updated_at, url, artifact_url }. Community gallery orgs are listed as public kind=org items with meta.gallery = true.

GET/api/library/items/{ref}Public

Get one item by id, or by kind and slug (/api/library/items/automation/instagram).

Response

Item

A private item is 404 unless the caller is its owner (session, or a token with library:read).

GET/api/library/items/{id}/artifactPublic

Download the artifact: an .mpkg for automations, JSON for workflows and orgs.

Request

Query params: version (optional; defaults to the current version)

Response

The bytes, with Content-Type, Content-Length, Content-Disposition, X-Content-SHA256 (hex) and X-Library-Version headers

Verify X-Content-SHA256 before installing. Same visibility rules as getting the item.

GET/api/library/items/{id}/versionsPublic

List an item's versions, newest first.

Response

{ versions: [{ version, sha256, size, created_at, artifact_url }] }
POST/api/library/itemslibrary:write

Publish a new item.

Request

multipart/form-data: kind, file, visibility ('private' default | 'public' | 'official' for admins), name?, description?, tags? (comma-separated), version? (semver)

Response

201 Item

The server validates the file: automations are .mpkg zips with a valid automation.json (≤ 20 MB; the item version is automation.json's); workflows are MonoAgent workflow exports (≤ 20 MB); orgs must pass the org schema (≤ 500 KB). meta is derived from the file. At most 30 uploads per hour (429).

PUT/api/library/items/{id}/artifactlibrary:write

Publish a new version of an item you own.

Request

multipart/form-data: file, version? (semver; default: next patch, or automation.json's version)

Response

Item (with the new version)

The version must be newer than the current one (409 version_conflict). Earlier versions stay downloadable.

PATCH/api/library/items/{id}library:write

Edit an item you own.

Request

{ name?, description?, tags?: string[] | string, visibility? }

Response

Item

Only admins move items into or out of 'official'. Gallery orgs are edited on the org gallery instead (409 gallery_org).

DELETE/api/library/items/{id}library:write

Delete an item and all its versions (owner or admin).

Response

{ id, deleted: true }
GET/api/library/mePublic

Who the token belongs to, and what it was granted.

Response

{ user: { id, name, username, email, image }, scopes: string[] }

Requires a session or any valid token (401 otherwise). MonoAgent uses it to show who is logged in.