> ## 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 Specific Backup

> Fetches the contents of a specific backup file. The format of the response can be controlled via HTTP headers to return JSON metadata, raw text, highlighted HTML, or a downloadable file.



## OpenAPI

````yaml /api/en/backups.yaml get /backup/{siteId}/{filename}
openapi: 3.0.3
info:
  title: Altostrat Backups API
  version: 1.0.0
  description: >-
    Manage and retrieve configuration backups for MikroTik sites through the
    public `/backup` gateway path. Use these endpoints to list backup files,
    request a new backup, download a backup, and discover subnets from captured
    configuration data.
servers:
  - url: https://v1.api.altostrat.io
    description: Production API Server
security:
  - BearerAuth: []
tags:
  - name: Backups
    description: Manage and retrieve configuration backups for individual sites.
paths:
  /backup/{siteId}/{filename}:
    get:
      tags:
        - Backups
      summary: Retrieve a Specific Backup
      description: >-
        Fetches the contents of a specific backup file. The format of the
        response can be controlled via HTTP headers to return JSON metadata, raw
        text, highlighted HTML, or a downloadable file.
      operationId: getSiteBackup
      parameters:
        - name: siteId
          in: path
          required: true
          description: The unique identifier for the site.
          schema:
            type: string
            format: uuid
            example: a1b2c3d4-e5f6-7890-1234-567890abcdef
        - name: filename
          in: path
          required: true
          description: >-
            The filename of the backup, typically a UNIX timestamp with an
            `.rsc` extension.
          schema:
            type: string
            example: 1732567800.rsc
        - name: X-View
          in: header
          required: false
          description: >-
            Set to `true` to receive the backup content as raw plain text
            (`text/plain`).
          schema:
            type: boolean
        - name: X-Highlight
          in: header
          required: false
          description: >-
            Set to `true` to receive the backup content with syntax highlighting
            as an HTML fragment (`text/html`).
          schema:
            type: boolean
        - name: X-Download
          in: header
          required: false
          description: >-
            Set to `true` to trigger a file download with appropriate
            `Content-Disposition` headers (`application/octet-stream`).
          schema:
            type: boolean
      responses:
        '200':
          description: >-
            The requested backup file content, formatted based on request
            headers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackupFileContent'
            text/plain:
              schema:
                type: string
                example: >-
                  /ip address

                  add address=192.168.88.1/24 interface=bridge
                  network=192.168.88.0
            text/html:
              schema:
                type: string
                example: >-
                  <span class="hljs-section">/ip address</span>

                  <span class="hljs-keyword">add</span> <span
                  class="hljs-attribute">address</span>=192.168.88.1/24 ...
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
      security:
        - BearerAuth:
            - backup:view
components:
  schemas:
    BackupFileContent:
      type: object
      description: The full content and metadata of a specific backup file.
      properties:
        filename:
          type: string
          description: The unique filename of the backup file.
          example: 1732567800.rsc
        size:
          type: string
          description: The human-readable size of the backup file.
          example: 12.3KB
        date:
          type: string
          description: >-
            The date the backup was created, formatted according to the user's
            preferences.
          example: 29/10/2025
        time:
          type: string
          description: >-
            The time the backup was created, formatted according to the user's
            preferences and timezone.
          example: '12:50:00'
        created_at:
          type: string
          format: date-time
          description: The full ISO 8601 timestamp of when the backup was created.
          example: '2025-10-29T12:50:00.000000Z'
        content:
          type: string
          description: The full text content of the RouterOS configuration script.
          example: |-
            /ip address
            add address=192.168.88.1/24 interface=bridge network=192.168.88.0
            ...
    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
          format: uri
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_missing
  responses:
    UnauthorizedError:
      description: >-
        Unauthorized - Authentication credentials are required and are missing
        or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenError:
      description: Forbidden - You do not have permission to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundError:
      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: >-
        A bearer token is required for all API requests. Obtain a token via the
        Altostrat Authentication API.

````