Library
Workflows, web automations (.mpkg) and orgs that MonoAgent installs: list, download, publish and version them.
/api/library/itemsPublicList 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.
/api/library/items/{ref}PublicGet one item by id, or by kind and slug (/api/library/items/automation/instagram).
Response
ItemA private item is 404 unless the caller is its owner (session, or a token with library:read).
/api/library/items/{id}/artifactPublicDownload 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 headersVerify X-Content-SHA256 before installing. Same visibility rules as getting the item.
/api/library/items/{id}/versionsPublicList an item's versions, newest first.
Response
{ versions: [{ version, sha256, size, created_at, artifact_url }] }/api/library/itemslibrary:writePublish 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 ItemThe 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).
/api/library/items/{id}/artifactlibrary:writePublish 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.
/api/library/items/{id}library:writeEdit an item you own.
Request
{ name?, description?, tags?: string[] | string, visibility? }Response
ItemOnly admins move items into or out of 'official'. Gallery orgs are edited on the org gallery instead (409 gallery_org).
/api/library/items/{id}library:writeDelete an item and all its versions (owner or admin).
Response
{ id, deleted: true }/api/library/mePublicWho 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.