> ## 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.

# Save block draft

> Partial save of the block draft (`content`, `rules`) plus the block-level `name` / `description`. Editing a draft does not affect any published agent version — those are pinned until they are republished.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/prompt-blocks/{id}/draft
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}/draft:
    patch:
      tags:
        - Prompt blocks
      summary: Save block draft
      description: >-
        Partial save of the block draft (`content`, `rules`) plus the
        block-level `name` / `description`. Editing a draft does not affect any
        published agent version — those are pinned until they are republished.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  description: >-
                    Template text. `{{name}}`, `{{a.b}}` and `{{name ||
                    'default'}}` are resolved per request from the chat body's
                    `variables` plus the `now.*` builtins; an unsupplied
                    placeholder is left visible.
                  example: >-
                    You are a support agent for {{company}}. Answer in {{locale
                    || 'English'}}.
                rules:
                  type: object
                  description: >-
                    Display condition: `{ operator: "AND"|"OR", conditions:
                    [...] }`, nested up to 3 levels. Each condition is `{ field,
                    operator, value? }`. Null/absent means the block is always
                    included.
                  example:
                    operator: AND
                    conditions:
                      - field: plan
                        operator: equals
                        value: enterprise
                name:
                  type: string
                  example: Brand voice
                description:
                  type: string
                  example: Tone and phrasing every agent shares
      responses:
        '200':
          description: The saved draft
          content:
            application/json:
              schema:
                type: object
                properties:
                  draft:
                    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 whole draft after the merge. Agents pinned to a
                      published version are unaffected until you publish and
                      roll out.
        '400':
          description: Invalid body
        '404':
          description: Not found
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````