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

# Publish prompt block

> Blocks if the draft is pristine (== latest published, 422), then creates a new numbered version. Publishing does NOT change what any agent renders: agents pin a block version when they publish. Activate the new version and then use /rollout to move agents onto it.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/prompt-blocks/{id}/publish
openapi: 3.1.0
info:
  title: Sidenet API
  version: 1.0.0
  description: >-
    Sidenet HTTP endpoints exposed by the Sidenet Studio. All routes require an
    api key that can be generated through the studio in studio.sidenet.ai.
servers:
  - url: https://api.sidenet.ai
security:
  - bearerAuth: []
paths:
  /v1/prompt-blocks/{id}/publish:
    post:
      tags:
        - Prompt blocks
      summary: Publish prompt block
      description: >-
        Blocks if the draft is pristine (== latest published, 422), then creates
        a new numbered version. Publishing does NOT change what any agent
        renders: agents pin a block version when they publish. Activate the new
        version and then use /rollout to move agents onto it.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                change_message:
                  type: string
                  example: Softer opening line
      responses:
        '201':
          description: The new immutable version, copied from the draft
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      block_id:
                        type: string
                        format: uuid
                      version_number:
                        type: integer
                        description: >-
                          0 is the mutable draft; every published version is 1
                          or above.
                      rev:
                        type: integer
                        description: >-
                          Server-owned change counter, bumped on every save of
                          the draft. Read-only — useful to tell whether a draft
                          moved since you last read it.
                      content:
                        type: string
                        description: >-
                          The block text. May contain `{{variable}}`, `{{a.b}}`
                          and `{{variable || 'default'}}` placeholders, resolved
                          per request.
                      rules:
                        type: object
                        nullable: true
                        description: >-
                          Display condition — a `{ operator: "AND"|"OR",
                          conditions: [...] }` group (max 3 levels). The block
                          is included in the prompt only when it evaluates true.
                          Null means always included.
                      change_message:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                    description: >-
                      The published version. Agents keep serving whatever they
                      are pinned to until POST /v1/prompt-blocks/{id}/rollout
                      moves them.
        '404':
          description: Not found
        '409':
          description: Concurrent publish
        '422':
          description: Nothing to publish
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````