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

# Create prompt block

> Creates a reusable prompt block. Its v0 draft is created automatically (do not create it yourself). Returns the block + the empty draft.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/prompt-blocks
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:
    post:
      tags:
        - Prompt blocks
      summary: Create prompt block
      description: >-
        Creates a reusable prompt block. Its v0 draft is created automatically
        (do not create it yourself). Returns the block + the empty draft.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  example: Brand voice
                description:
                  type: string
                  example: Tone and phrasing every agent shares
      responses:
        '201':
          description: The new block and the empty v0 draft created with it
          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.
                  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 auto-created draft, at `version_number` 0 with empty
                      content.
        '400':
          description: Invalid body or missing headers
        '500':
          description: Create failed
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````