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

# Publish dashboard templates

> The bulk publish a repository's CI runs (with the platform key, it publishes the templates every organization is shared). One `collection` per publisher: every template is checked first (nothing is written when one fails), those whose `hash` differs from the stored one are written, every key gets its position in `keys` (a template's own `ord` wins), and the collection's published templates whose key is not in `keys` are removed. Send only the changed templates with the full `keys` list (`GET /v1/dashboard-templates/state` for the hashes). A key the organization wrote with PUT is taken over; a key of another collection is refused (409).



## OpenAPI

````yaml /api-reference/openapi.json post /v1/dashboard-templates/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/dashboard-templates/publish:
    post:
      tags:
        - Dashboard templates
      summary: Publish dashboard templates
      description: >-
        The bulk publish a repository's CI runs (with the platform key, it
        publishes the templates every organization is shared). One `collection`
        per publisher: every template is checked first (nothing is written when
        one fails), those whose `hash` differs from the stored one are written,
        every key gets its position in `keys` (a template's own `ord` wins), and
        the collection's published templates whose key is not in `keys` are
        removed. Send only the changed templates with the full `keys` list (`GET
        /v1/dashboard-templates/state` for the hashes). A key the organization
        wrote with PUT is taken over; a key of another collection is refused
        (409).
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - templates
              properties:
                collection:
                  type: string
                  default: default
                  example: pms
                templates:
                  type: array
                  items:
                    type: object
                    required:
                      - key
                      - title
                      - spec
                    properties:
                      key:
                        type: string
                      hash:
                        type: string
                      title:
                        type: string
                        maxLength: 120
                        example: Hotel performance
                      description:
                        type: string
                        maxLength: 500
                        nullable: true
                      icon:
                        type: string
                        maxLength: 60
                        nullable: true
                        example: chart
                      spec:
                        type: object
                        description: >-
                          The dashboard spec, as `POST /v1/dashboards` takes it
                          (transforms complete). Checked structurally on write.
                      tags:
                        type: array
                        items:
                          type: string
                          example: general_manager
                        description: >-
                          Audience: offered on the networks whose `tags` share
                          one of these (`PATCH /v1/networks/{id}`). Empty =
                          every network.
                      when:
                        type: object
                        nullable: true
                        description: >-
                          Offered only when a read run **in the caller's
                          session** yields at least `min_options` distinct
                          values: the spec's own select filter `filter` (one
                          with `options_from`: its source and value path), or a
                          source tool named outright (`tool`, `args`, `value`:
                          the field path of the value in a row). E.g. `{ "tool":
                          "pms_list_property_options", "value": "id",
                          "min_options": 2 }` offers a portfolio page to a
                          caller with several hotels only.
                        properties:
                          filter:
                            type: string
                            example: property
                          tool:
                            type: string
                            example: pms_list_property_options
                          args:
                            type: object
                          value:
                            type: string
                            example: id
                          min_options:
                            type: integer
                            minimum: 1
                            example: 2
                      ord:
                        type: integer
                        nullable: true
                      enabled:
                        type: boolean
                        default: true
                keys:
                  type: array
                  items:
                    type: string
                  description: >-
                    Every key of the collection, in picker order. Absent: the
                    templates' keys.
                commit:
                  type: string
                  description: The commit published from (kept as `source_ref`).
                  example: 1a2b3c4d5e6f
      responses:
        '200':
          description: What changed
          content:
            application/json:
              schema:
                type: object
                properties:
                  collection:
                    type: string
                  updated:
                    type: array
                    items:
                      type: string
                  unchanged:
                    type: array
                    items:
                      type: string
                  removed:
                    type: array
                    items:
                      type: string
                  reordered:
                    type: boolean
              example:
                collection: pms
                updated:
                  - performance
                unchanged:
                  - portfolio
                removed: []
                reordered: false
        '400':
          description: >-
            Invalid body, or a template whose spec does not parse (`issues`
            lists them)
        '409':
          description: A key belongs to another collection
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.