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

# Preview block content

> Renders `content` with the supplied `variables` and evaluates `rules` against them, so the editor can show the result while typing. Returns the rendered text, the variable names found in the template, which of them had no value, whether the display condition includes the block, and any variables dropped by the size/type limits.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/prompt-blocks/preview
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/preview:
    post:
      tags:
        - Prompt blocks
      summary: Preview block content
      description: >-
        Renders `content` with the supplied `variables` and evaluates `rules`
        against them, so the editor can show the result while typing. Returns
        the rendered text, the variable names found in the template, which of
        them had no value, whether the display condition includes the block, and
        any variables dropped by the size/type limits.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - content
              properties:
                content:
                  type: string
                  example: >-
                    You are a support agent for {{company}}. Answer in {{locale
                    || 'English'}}.
                rules:
                  type: object
                  description: >-
                    Display condition to evaluate against `variables`. Null is
                    always-on.
                  example:
                    operator: AND
                    conditions:
                      - variable: plan
                        operator: equals
                        value: enterprise
                variables:
                  type: object
                  additionalProperties: true
                  example:
                    company: Acme
                    plan: enterprise
      responses:
        '200':
          description: The rendered text, and what the variables did
          content:
            application/json:
              schema:
                type: object
                properties:
                  rendered:
                    type: string
                    description: The content with variables substituted.
                  included:
                    type: boolean
                    description: >-
                      Whether `rules` evaluated true against these variables —
                      i.e. whether this block would appear in the prompt at all.
                  variables:
                    type: array
                    description: Every `{{variable}}` the content references.
                    items:
                      type: string
                  missingVariables:
                    type: array
                    description: >-
                      Those that had no value and rendered as their default (or
                      empty).
                    items:
                      type: string
                  droppedVariables:
                    type: array
                    description: Variables you sent that the size/type limits rejected.
                    items:
                      type: string
              example:
                rendered: You are a support agent for Acme. Answer in English.
                included: true
                variables:
                  - company
                  - locale
                missingVariables:
                  - locale
                droppedVariables: []
        '400':
          description: Invalid body
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````