> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tetherai.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish an item to organization and/or marketplace

> Publish a prompt or template to the caller's organization scope, the global marketplace scope, or both. Admin/Superadmin only; rejects duplicate publications of the same itemId.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/marketplace/publish
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/marketplace/publish:
    post:
      tags:
        - Marketplace
      summary: Publish an item to organization and/or marketplace
      description: >-
        Publish a prompt or template to the caller's organization scope, the
        global marketplace scope, or both. Admin/Superadmin only; rejects
        duplicate publications of the same itemId.
      operationId: publish_item
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishItemRequest'
      responses:
        '201':
          description: Item published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketplacePublishResponse'
        '400':
          description: Missing required fields, invalid item type, or already published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketplaceErrorResponse'
        '403':
          description: Only Admin/Superadmin can publish or item not owned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketplaceErrorResponse'
        '404':
          description: User or item not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketplaceErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketplaceErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    PublishItemRequest:
      type: object
      properties:
        itemType:
          type: string
          enum:
            - prompt
            - template
          description: 'What''s being published: `prompt` or `template`.'
        itemId:
          type: string
          description: >-
            Mongo ObjectId of the source prompt or template the caller owns and
            wants to publish.
        scopes:
          type: object
          description: >-
            Per-scope publish settings (`organization`, `marketplace`) — each
            carries `enabled`, `shareType`, `isContentVisible`,
            `allowEditableReferences`.
          properties:
            organization:
              type: object
              description: >-
                Publish settings for the caller's organization scope; only
                visible to members of the publisher's org.
              properties:
                enabled:
                  type: boolean
                  description: >-
                    When true, create (or keep) an organization-scope listing
                    for this item.
                shareType:
                  type: string
                  enum:
                    - reference
                    - copy
                  description: >-
                    `reference` (acquirer gets a live link) or `copy` (acquirer
                    gets an editable duplicate).
                isContentVisible:
                  type: boolean
                  description: >-
                    When false, marketplace browsers see metadata only — body is
                    hidden until acquired.
                allowEditableReferences:
                  type: boolean
                  description: >-
                    For `reference` listings, allow acquirers to edit the linked
                    item; ignored for `copy` listings.
            marketplace:
              type: object
              description: >-
                Publish settings for the global marketplace scope; visible to
                every Tether organization.
              properties:
                enabled:
                  type: boolean
                  description: >-
                    When true, create (or keep) a marketplace-scope listing for
                    this item.
                shareType:
                  type: string
                  enum:
                    - reference
                    - copy
                  description: >-
                    `reference` (acquirer gets a live link) or `copy` (acquirer
                    gets an editable duplicate).
                isContentVisible:
                  type: boolean
                  description: >-
                    When false, marketplace browsers see metadata only — body is
                    hidden until acquired.
                allowEditableReferences:
                  type: boolean
                  description: >-
                    For `reference` listings, allow acquirers to edit the linked
                    item; ignored for `copy` listings.
        metadata:
          type: object
          description: >-
            Optional display overrides for the listing; when omitted the
            underlying item's own name/description are used.
          properties:
            name:
              type: string
              description: >-
                Display name shown in marketplace listings; falls back to the
                source item's name.
            description:
              type: string
              description: >-
                Short blurb shown on the listing card; falls back to the source
                item's description.
            usageInformation:
              type: string
              description: >-
                Guidance shown to acquirers (e.g., required variables, setup
                steps).
      required:
        - itemType
        - itemId
        - scopes
      additionalProperties: true
      example:
        itemType: prompt
        itemId: 5f7b1c2e8a1d4e0012c3b4a5
        scopes:
          organization:
            enabled: true
            shareType: copy
            isContentVisible: true
            allowEditableReferences: false
          marketplace:
            enabled: false
            shareType: reference
            isContentVisible: false
            allowEditableReferences: false
        metadata:
          name: Acme Inbound Triage Prompt
          description: Routes inbound SMS to the right department.
          usageInformation: Set the {{org_name}} variable before applying.
    MarketplacePublishResponse:
      type: object
      description: >-
        Returned after `POST /api/marketplace/publish`. `published[]` contains
        one summary per enabled scope.
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            published:
              type: array
              items:
                $ref: '#/components/schemas/MarketplacePublishedSummary'
          required:
            - published
          additionalProperties: true
      required:
        - success
        - data
      additionalProperties: true
      example:
        success: true
        data:
          published:
            - id: 64d2f9c5e8a1d4e001a0b1c2
              scope: organization
              shareType: copy
              isContentVisible: true
              status: active
            - id: 64d2f9c5e8a1d4e001a0b1c3
              scope: marketplace
              shareType: reference
              isContentVisible: false
              status: active
    MarketplaceErrorResponse:
      type: object
      description: Generic error envelope returned by Marketplace endpoints.
      properties:
        error:
          type: string
        details:
          type: string
      required:
        - error
      additionalProperties: true
      example:
        error: Marketplace item not found
    MarketplacePublishedSummary:
      type: object
      description: One published-scope summary returned after a publish call.
      properties:
        id:
          type: string
        scope:
          type: string
          enum:
            - organization
            - marketplace
        shareType:
          type: string
          enum:
            - reference
            - copy
        isContentVisible:
          type: boolean
        status:
          type: string
          enum:
            - active
      required:
        - id
        - scope
        - shareType
        - status
      additionalProperties: true
      example:
        id: 64d2f9c5e8a1d4e001a0b1c2
        scope: marketplace
        shareType: reference
        isContentVisible: true
        status: active
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````