`POST /api/marketplace/scripts/publish` -- publish a workspace Script as a `kind='script'` marketplace item. Workspace-admin only. Returns the created item.
const url = 'https://example.com/api/marketplace/scripts/publish';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"categories":["example"],"description":"example","name":"example","pricing":{"amount_minor":1,"currency":"example","model":"example"},"script_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","slug":"example","summary":"example","tags":["example"],"version":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/marketplace/scripts/publish \ --header 'Content-Type: application/json' \ --data '{ "categories": [ "example" ], "description": "example", "name": "example", "pricing": { "amount_minor": 1, "currency": "example", "model": "example" }, "script_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "slug": "example", "summary": "example", "tags": [ "example" ], "version": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Body for POST /api/marketplace/scripts/publish (Issue #279 / ADR 0034
P2). version defaults to “1.0.0”; categories / tags default to empty.
object
Seller-declared price on a publish request. model is the publish-facing
vocabulary (free | one_time | monthly); an absent currency defaults
to EUR. Shared by every publish handler (app / script / workflow / node).
object
Examplegenerated
{ "categories": [ "example" ], "description": "example", "name": "example", "pricing": { "amount_minor": 1, "currency": "example", "model": "example" }, "script_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "slug": "example", "summary": "example", "tags": [ "example" ], "version": "example"}Responses
Section titled “Responses”A catalog item — an app, script, bundle, or runner offer listing.
Scoped to a source via source_id. The (source_id, slug) pair is unique.
object
ADR 0030 W6 — build framework of the item’s latest non-withdrawn
version (plain | react | svelte). Populated by list_items /
get_item via a correlated subquery; absent in queries that do not
project it (e.g. upsert_item RETURNING), where #[sqlx(default)]
supplies "plain". Surfaces a framework badge on browse cards.
Runtime String; the spec narrows it to the closed [MarketplaceFramework].
#358 — public install popularity: the number of DISTINCT workspaces that
have installed this item (marketplace_installs). Populated by
list_items / get_item via a correlated subquery mirroring rating;
absent (None) in projections that do not select it, where
#[sqlx(default)] supplies None.
ADR 0034 P4c — active price of the item’s latest version as a JSON
object {model, amount_minor, currency}, or null when the listing is
free. Populated by list_items / get_item via a correlated subquery;
absent (None) in projections that do not select it (e.g. upsert
RETURNING), where #[sqlx(default)] supplies None.
Runtime stays serde_json::Value; the spec types it as [MarketplaceItemPrice].
object
Publisher metadata bag. Runtime stays serde_json::Value; the spec types it
as Option<MarketplaceItemPublisher> (the FE reads publisher?.name) — a
seed/curated listing can carry a publisher-less (null) bag, so the optional
spec is the honest shape and the FE drops its .extend() defensive widening.
object
ADR 0034 #351 — aggregate CUSTOMER rating of this item as a JSON object
{avg, count} (avg rounded to 2 dp), or null when it has no ratings.
Populated by list_items / get_item via a correlated subquery; absent
(None) in projections that do not select it, where #[sqlx(default)]
supplies None. Distinct from verified (the moderation gate).
Runtime stays serde_json::Value; the spec types it as [MarketplaceItemRatingSummary].
object
Example
{ "framework": "plain"}