Discard a role’s open draft
Discards the caller’s open draft; the published state is never touched, and the discarded edits cannot be recovered. Requires the Contributor or Admin role; a key needs write:roles. This closes the loop PATCH opens: an auto-opened draft that will not be published is released here instead of holding the author lock forever. Errors: 409 with reason: NO_OPEN_DRAFT when nothing is open to discard, 409 with reason: DRAFT_LOCKED when another user holds the draft (a draft is author-private; only its holder may discard it).
apiKeyAuthorizationBearer <token>Workspace API key (SKA_...).
roleId*stringRole id
1 <= lengthDraft discarded; the published state is unchanged
curl -X DELETE 'https://app.skilder.ai/api/v1/roles/0x3c4d/draft'Publish a role’s draft POST
Promotes the role’s currently open draft to the published state (the version agents run) — nothing else. It takes no edits: make them with `PATCH /roles/{roleId}` first, an ownership transfer included, and the publish carries them. Requires the owner-scoped `publish` ability (a workspace admin or the role’s owner), which is also what lets the caller promote a draft authored by someone else without taking it over. The body is optional: empty publishes the open draft as-is. Errors: **409 with `reason: NO_OPEN_DRAFT`** when nothing is open to publish (edit it first with PATCH), **403** when the caller is not the role’s owner or a workspace admin, or the key lacks `publish:roles`.
Export several skills as one zip bundle GET
Streams a zip holding one Agent Skills package folder per skill (published state only). Any workspace role may export; a key needs `read:skills`, and `read:roles` too when filtering by `roleId`. Filter with exactly one of `ids` (comma-separated, max 100) or `roleId` (every skill of that role). All-or-nothing: any id that does not resolve in the key’s workspace fails the whole request with 404. Folder-name collisions inside the bundle get numeric suffixes (`report`, `report-2`, …). A role with no skills yields an empty zip. Downloadable resources with no uploaded file yet are left out of their package. Every App the skills attach is written once under `apps/<name>/`, and no skill folder is named `apps` then; Apps travel only when the key may read them (`read:apps`).

