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

# Get prompt block

> Returns the block and exactly ONE of its versions. Which one is up to `version`; by default it is the active (published) version that agents pin to, falling back to the draft when nothing has been activated yet. The `block` object always reports `activeVersionNumber`, `latestPublishedVersionNumber` and `draftDirty`, so a client can tell what else exists — unpublished edits, or a newer published version agents have not been rolled onto — and ask for it by number in a second call.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/prompt-blocks/{id}
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}:
    get:
      tags:
        - Prompt blocks
      summary: Get prompt block
      description: >-
        Returns the block and exactly ONE of its versions. Which one is up to
        `version`; by default it is the active (published) version that agents
        pin to, falling back to the draft when nothing has been activated yet.
        The `block` object always reports `activeVersionNumber`,
        `latestPublishedVersionNumber` and `draftDirty`, so a client can tell
        what else exists — unpublished edits, or a newer published version
        agents have not been rolled onto — and ask for it by number in a second
        call.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394
        - name: version
          in: query
          required: false
          schema:
            type: string
            example: active
          description: >-
            Which version of the prompt block to return. Takes any of: a version
            number (`3`, or `v3`); `0` or `draft` for the unpublished draft;
            `latest` for the newest published version; `active` for the one
            serving traffic; or the version row's uuid. Defaults to `active`,
            falling back to the draft when nothing has been activated yet.
      responses:
        '200':
          description: The block and the version that was selected
          content:
            application/json:
              schema:
                type: object
                properties:
                  block:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      org_id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      active_version_id:
                        type: string
                        format: uuid
                        nullable: true
                        description: Null until a published version is activated.
                      activeVersionNumber:
                        type: integer
                        nullable: true
                        description: >-
                          Version number agents pin to. Null until a version is
                          activated.
                      latestPublishedVersionNumber:
                        type: integer
                        nullable: true
                        description: >-
                          Newest published version number. Higher than
                          `activeVersionNumber` when a newer version is
                          published but not activated — POST /rollout is what
                          moves agents onto it. Null before the first publish.
                      draftDirty:
                        type: boolean
                        description: >-
                          True when the draft's content or rules differ from the
                          latest published version — i.e. there are unpublished
                          edits. Fetch them with `?version=draft`.
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                  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
                    nullable: true
                    description: >-
                      The one version this call selected, in full — the active
                      version by default, or whatever `version` named.
                      `version_number` says which it is (0 is the draft). Null
                      only for a block with neither an active version nor a
                      draft.
              example:
                block:
                  id: d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394
                  org_id: 2b9d7c31-8e4f-4a2b-9d61-77c0a3f5e812
                  name: Brand voice
                  description: Tone rules shared by every support agent
                  active_version_id: 7e2b5a90-3c48-4d61-b9f7-05a8c2e14d6f
                  activeVersionNumber: 2
                  latestPublishedVersionNumber: 2
                  draftDirty: true
                  created_at: '2026-07-02T09:14:22.418Z'
                  updated_at: '2026-08-11T16:03:47.902Z'
                version:
                  id: 7e2b5a90-3c48-4d61-b9f7-05a8c2e14d6f
                  block_id: d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394
                  version_number: 2
                  rev: 1
                  content: Speak warmly and never promise a refund you can't confirm.
                  rules: null
                  change_message: Soften the tone
                  created_at: '2026-08-04T10:22:05.117Z'
                  updated_at: '2026-08-04T10:22:05.117Z'
        '400':
          description: >-
            Missing identity headers, an unparseable `version`, or the block
            belongs to another organization
        '404':
          description: Block not found, or it has no such version
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````