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

# Publish a dashboard as a Costory template

> Costory-staff only. Creates a TEMPLATE row under COSTORY_ORG_ID.



## OpenAPI

````yaml https://app-api.costory.io/docs/openapi.json post /dashboard-v2/{id}/create-template
openapi: 3.0.0
info:
  title: Costory
  version: '1.0'
  description: API Documentation
servers:
  - url: ''
    description: Production server
security: []
paths:
  /dashboard-v2/{id}/create-template:
    post:
      tags:
        - Dashboards
      summary: Publish a dashboard as a Costory template
      description: Costory-staff only. Creates a TEMPLATE row under COSTORY_ORG_ID.
      operationId: createDashboardTemplate
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                description:
                  type: string
                  default: ''
              required:
                - name
      responses:
        '201':
          description: Template created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardIdCreated'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardError'
        '404':
          description: Source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardError'
      security:
        - bearerAuth: []
components:
  schemas:
    DashboardIdCreated:
      type: object
      properties:
        dashboardId:
          type: string
      required:
        - dashboardId
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          description: Unauthorized error message
      required:
        - error
    DashboardError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or Clerk ak_* API key
      description: >-
        Send `Authorization: Bearer <credential>` using either a Clerk session
        JWT or a Clerk API key (`ak_*`). API keys may identify a user (`user_*`)
        or organization (`org_*`) principal and are generated in the Clerk
        Dashboard under API keys.

````

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