Publishing and the Marketplace
Once you have authored a template, you can share it in two ways: within your organization (instant) or to the public marketplace (requires platform admin approval). This page covers the publication flow, moderation, and how other organizations discover and launch your templates.
Publication flow at a glance
The full lifecycle from draft to marketplace listing looks like this:
draft
|
|-- (visibility = org_shared) --> POST /publish --> published (org_shared)
|
|-- (visibility = public) --> POST /publish --> submitted --> [admin review]
|
approved --+--> published (public)
rejected --+--> rejected (editable)
An org_shared template skips moderation and goes live immediately. A public template enters the platform review queue and is only launchable by other organizations once a platform admin explicitly approves it. A rejected template returns to an editable state; you can revise and resubmit without limits other than the rate cap.
Visibility levels
Every template has a visibility field that controls who can see and launch it:
| Visibility | Who can launch | Publication flow |
|---|---|---|
private | Members of your organization only | Cannot be published |
org_shared | All members of your organization | Published immediately on request |
public | Any organization on the platform | Requires platform admin approval |
A template's visibility can be changed while it is in draft, rejected, or unpublished status.
Publication statuses
| Status | Meaning |
|---|---|
draft | Created but not yet published. Editable. |
submitted | Publish requested for a public template; awaiting admin review. |
approved | Approved by a platform admin (intermediate state). |
published | Live and launchable (by org members if org_shared, by anyone if public). |
rejected | Admin declined the public submission. Editable; you can revise and resubmit. |
unpublished | Previously published; withdrawn. Editable; can be republished. |
Sharing within your organization
Set visibility to org_shared (via PATCH if your template is still private), then publish:
# Set visibility
curl -X PATCH https://api.foundrydb.com/stacks/templates/$TEMPLATE_ID \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"visibility": "org_shared"}'
# Publish immediately
curl -X POST https://api.foundrydb.com/stacks/templates/$TEMPLATE_ID/publish \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN"
The template moves to published status immediately. Every member of your organization can now launch it by passing template_id to POST /stacks.
Submitting to the public marketplace
Set visibility to public, then publish. Unlike org_shared, a public template enters the platform moderation queue and is launchable by other organizations only once a platform admin approves it.
# Set visibility to public
curl -X PATCH https://api.foundrydb.com/stacks/templates/$TEMPLATE_ID \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"visibility": "public"}'
# Submit for moderation
curl -X POST https://api.foundrydb.com/stacks/templates/$TEMPLATE_ID/publish \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN"
The template moves to submitted status. Track its progress:
curl https://api.foundrydb.com/stacks/templates/$TEMPLATE_ID \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN"
Once publication_status reaches published, the template appears in the marketplace and any authenticated organization can launch it.
If the submission is rejected, publication_status becomes rejected and moderation_reason contains the reviewer's note. Revise the template (it becomes editable again) and resubmit.
Publish rate limit
An organization can initiate at most 20 publication requests per hour. Exceeding this returns 429 Too Many Requests. The limit applies to all publish attempts from the organization combined.
Unpublishing
Unpublishing stops new launches from your template. Stacks already launched from it continue to run on their own snapshotted descriptor.
curl -X POST https://api.foundrydb.com/stacks/templates/$TEMPLATE_ID/unpublish \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN"
The template moves to unpublished status. You can edit it and republish.
Listing your templates
To see all templates your organization owns, regardless of status:
curl https://api.foundrydb.com/stacks/templates/mine \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN"
This returns draft, submitted, published, rejected, and unpublished templates together.
Browsing the marketplace
To see templates published publicly by other organizations:
curl https://api.foundrydb.com/stacks/templates/marketplace \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN"
Each entry is a CustomStackTemplate with the descriptor, the publisher's organization ID, and the template version.
Launching a marketplace template
Once you find a marketplace template you want to use, preview and launch it by passing its template_id:
# Preview cost
curl -X POST https://api.foundrydb.com/stacks/preview \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"template_id": "'$TEMPLATE_ID'"}'
# Launch
curl -X POST https://api.foundrydb.com/stacks \
-H "Authorization: Bearer $FOUNDRYDB_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my-stack",
"template_id": "'$TEMPLATE_ID'",
"accepted_monthly_cost": 42.00
}'
Provenance and isolation
The launched stack records source_template_id and source_publisher_org_id as provenance fields on the stack record. These fields tell you which template version and which organization produced the descriptor your stack was launched from.
Stacks you launch from marketplace templates are your own resources. The descriptor is snapshotted at launch time: if the publisher later unpublishes, modifies, or deletes the template, your running stack is completely unaffected. You own the child resources; they are billed to your organization and visible in your account exactly like services you created directly.
Admin moderation
Platform admins use dedicated endpoints to manage public marketplace submissions:
# List templates awaiting review
GET /admin/stack-templates/pending
# Approve a submitted template (makes it publicly launchable)
POST /admin/stack-templates/{template-id}/approve
# Reject a submission (returns it to the author with a reason)
POST /admin/stack-templates/{template-id}/reject
{"reason": "Template references a disallowed image registry."}
# Force-unpublish a live public template
POST /admin/stack-templates/{template-id}/takedown
{"reason": "Security issue in the published image."}
All admin endpoints require platform-admin access and return 403 Forbidden otherwise.
What moderation checks. Admins verify that the template uses only first-party companion apps (since image_ref is blocked for public templates by validation), that the descriptor is consistent, and that the description and display name are informative. Templates with misleading names, inappropriate content, or that circumvent platform restrictions are rejected.
Effect of a takedown on running stacks. A force-unpublish or takedown stops new organizations from launching the template. Stacks already launched from that template before the takedown continue running on their own snapshotted descriptor. No data is deleted and no running resource is stopped by a moderation action.