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

# Retrieve a Script Template

> Fetches the details of a specific script template, including its content.



## OpenAPI

````yaml /api/en/scripts.yaml get /scripts/templates/{templateId}
openapi: 3.0.3
info:
  title: Altostrat Scripts API
  version: 1.0.0
  description: >-
    The Altostrat Scripts API is the microservice responsible for creating,
    managing, and executing MikroTik RouterOS scripts across your network
    infrastructure.


    It serves as the core automation engine within the Altostrat SDX platform,
    empowering developers to programmatically deploy configuration changes,
    perform operational tasks, and leverage AI for script generation. This API
    is the foundation for network automation and agentic AI capabilities.


    This API allows you to programmatically manage:

    - **Scheduled Scripts:** The primary resource for defining a script, its
    target devices, and a future execution time, complete with authorization
    workflows and progress tracking.

    - **Script Templates:** Reusable, version-controlled script blueprints that
    can be either private to an organization or shared globally to enforce
    standardization and best practices.

    - **Community Scripts:** A curated and searchable library of publicly
    available RouterOS scripts sourced from GitHub, providing ready-to-use
    solutions for common networking tasks.

    - **AI Script Generation:** An agentic AI endpoint that translates natural
    language prompts into functional and safe MikroTik RouterOS scripts.


    Developers use this API to build powerful, scalable, and intelligent network
    automation workflows for their fleet of MikroTik devices.
servers:
  - url: https://v1.api.altostrat.io
security:
  - BearerAuth:
      - script:view
      - script:create
      - script:update
      - script:delete
      - script:run
      - script:authorize
tags:
  - name: Scheduled Scripts
    description: >-
      Manage the lifecycle of scripts scheduled for execution on network
      devices.
  - name: Script Templates
    description: Create and manage reusable script templates for standardization.
  - name: Community Scripts
    description: Discover and utilize scripts from the public community repository.
  - name: AI Script Generation
    description: Generate MikroTik scripts from natural language prompts.
paths:
  /scripts/templates/{templateId}:
    get:
      tags:
        - Script Templates
      summary: Retrieve a Script Template
      description: >-
        Fetches the details of a specific script template, including its
        content.
      operationId: getScriptTemplate
      parameters:
        - name: templateId
          in: path
          required: true
          description: The unique identifier for the script template.
          schema:
            type: string
            format: uuid
            example: d9e5b5e3-3e8a-4c2f-8d2a-7e6e5a4b1c0d
      responses:
        '200':
          description: Detailed information about the script template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScriptTemplate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ScriptTemplate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier for the script template.
          example: d9e5b5e3-3e8a-4c2f-8d2a-7e6e5a4b1c0d
        name:
          type: string
          description: The name of the script template.
          example: Standard Firewall Setup
        description:
          type: string
          description: A brief description of what the template does.
          example: Applies the standard set of corporate firewall rules to a device.
        content:
          type: string
          description: The full script content of the template.
          example: >-
            /ip firewall filter add chain=input action=accept
            connection-state=established,related
        metadata:
          type: object
          nullable: true
          description: A key-value map for storing arbitrary metadata.
          example:
            version: '1.2'
            compliance: PCI-DSS
        author:
          type: string
          format: uuid
          nullable: true
          description: The user ID of the template's author. Null for global templates.
          example: auth0|642b7f3b8b3b3e3e3e3e3e3e
        read_only:
          type: boolean
          description: True if the template is global and cannot be edited by the user.
          example: false
        created_at:
          type: string
          format: date-time
          description: The timestamp when the template was created.
          example: '2025-10-29T10:30:00.000000Z'
        updated_at:
          type: string
          format: date-time
          description: The timestamp when the template was last updated.
          example: '2025-10-29T11:00:00.000000Z'
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_missing
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'name' parameter is required for this request.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_missing
  responses:
    Unauthorized:
      description: >-
        Unauthorized - The request requires authentication and a valid Bearer
        token was not provided.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >-
        Forbidden - The authenticated user does not have the required
        permissions (scopes) to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found - The requested resource could not be found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Altostrat SDX API uses JWT Bearer tokens for authentication. Obtain a
        token via the Authentication API and include it in the Authorization
        header as 'Bearer {token}'.

````