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

# List Recent Sites

> Returns a list of the 5 most recently accessed sites for the authenticated user, ordered by most recent access.



## OpenAPI

````yaml /api/en/mikrotik-api.yaml get /sites/recent
openapi: 3.0.3
info:
  title: Altostrat MikroTik Devices API
  version: 1.0.0
  description: >-
    The Altostrat MikroTik Devices API is the microservice responsible for
    managing the lifecycle, configuration, and real-time state of MikroTik
    devices within the SDX platform.


    It acts as the command and control plane for individual network endpoints,
    receiving heartbeats, dispatching jobs, and providing observability into
    device health. This service is the bridge between the Altostrat SDX
    automation layer and the physical network hardware.


    This API allows you to programmatically manage:

    - **Sites:** The digital twin of a physical MikroTik router, representing
    its identity, configuration, and current online status.

    - **Jobs:** Asynchronous commands or scripts sent to a Site for execution,
    enabling remote configuration changes, troubleshooting, and automation.

    - **Device Stats:** Time-series performance data, including CPU load, memory
    usage, and uptime, collected from each Site.


    Developers use this API to programmatically list, monitor, and interact with
    their fleet of MikroTik devices, forming the basis for building custom
    network automation and management tools.
servers:
  - url: https://v1.api.altostrat.io
    description: Production API Server
security:
  - BearerAuth: []
tags:
  - name: Sites
    description: Manage and monitor MikroTik devices, referred to as "Sites".
  - name: Jobs
    description: Create and manage asynchronous commands to be executed on Sites.
  - name: Device Stats
    description: Retrieve time-series performance metrics from Sites.
  - name: Runbooks
    description: Access device onboarding configurations.
  - name: Developer API
    description: >-
      Run synchronous RouterOS commands or queue asynchronous RouterOS scripts
      through SDX.
  - name: Developer Routers
    description: Read router-level summaries exposed by the SDX developer API.
paths:
  /sites/recent:
    get:
      tags:
        - Sites
      summary: List Recent Sites
      description: >-
        Returns a list of the 5 most recently accessed sites for the
        authenticated user, ordered by most recent access.
      responses:
        '200':
          description: A list of recently accessed sites.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SiteRecent'
components:
  schemas:
    SiteRecent:
      type: object
      description: Represents a recently accessed Site.
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier (UUID) for the site.
          example: 9a9a3e6f-1b1a-4b1a-8c1a-1e1a1a1a1a1a
        pid:
          type: string
          nullable: true
          description: A time-sortable, prefixed unique identifier for the site.
          example: site_2m3h5n7k9j8g7f6e5d4c3b2a1
        name:
          type: string
          nullable: true
          description: The user-defined name for the site.
          example: Main Office Router
        model:
          type: string
          nullable: true
          description: The model of the MikroTik device.
          example: CCR2004-1G-12S+2XS
        version:
          type: string
          nullable: true
          description: The RouterOS software version.
          example: 7.15.1
        ip_address:
          type: string
          format: ipv4
          nullable: true
          description: The last known public IP address of the device.
          example: 203.0.113.54
        online:
          type: boolean
          description: Indicates if the site is currently online.
          example: true
        last_seen:
          type: string
          nullable: true
          description: >-
            A human-readable string indicating when the last heartbeat was
            received.
          example: just now
        accessed_at:
          type: string
          format: date-time
          description: The timestamp when the user last accessed this site.
          example: '2025-10-29T11:47:50Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Authenticate requests by providing a JSON Web Token (JWT) in the
        `Authorization` header. Example: `Authorization: Bearer <YOUR_JWT>`

````