Publish Portfolio
Publishes the given draft revision to its chosen subdomain, making it publicly reachable. Premium templates (`nimbus`, `cipher`) require an active Creator Pro subscription. **Current-state caveat:** in production, publishing is gated behind a hardcoded `ADMIN_EMAIL` check independent of plan tier (`isAdminUser`) — regular users can save drafts, preview, and manage everything except actually flipping a portfolio live. This is a temporary rollout restriction, not a permanent product limitation. Only administrators can exercise this endpoint end-to-end in production today; it is unrestricted in development.
Internal session cookie for local development.
In: cookie
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/portfolios/publish" \ -H "Content-Type: application/json" \ -d '{ "documentId": "string", "subdomain": "string", "revision": 0 }'{ "success": true, "message": "string", "data": { "id": "string", "userId": "string", "documentId": "string", "subdomain": "string", "templateId": "signal", "snapshot": {}, "status": "LIVE", "publishedRevision": 0, "suspensionReason": "string", "suspendedAt": "2019-08-24T14:15:22Z", "publishedAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "publicUrl": "string" }}Preview Portfolio DraftGET
Returns the caller's own portfolio draft for rendering a preview, without publishing it. The response is a trimmed projection of the document, not a full `Document` record — it has no `slug`. Session-authenticated only.
Unpublish PortfolioPOST
Takes a published portfolio offline — status becomes `SUSPENDED` with reason `user_unpublished`, and the underlying document reverts to `PRIVATE` visibility. The document itself is not deleted, so the portfolio can be republished later. Idempotent: if the caller has never published, the call still succeeds and returns `data: null`. Session-authenticated only.