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

# Update a Site

> Updates the mutable properties of a site, such as its name, location, or timezone. Only the fields provided in the request body will be updated.



## OpenAPI

````yaml /api/en/mikrotik-api.yaml patch /sites/{siteId}
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/{siteId}:
    patch:
      tags:
        - Sites
      summary: Update a Site
      description: >-
        Updates the mutable properties of a site, such as its name, location, or
        timezone. Only the fields provided in the request body will be updated.
      parameters:
        - name: siteId
          in: path
          required: true
          description: The UUID of the site to update.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSitePayload'
      responses:
        '200':
          description: The updated site object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Site'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          description: Not Found - The requested site does not exist.
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    UpdateSitePayload:
      type: object
      description: Fields that can be updated for a Site.
      properties:
        name:
          type: string
          description: A new user-defined name for the site.
          minLength: 3
          maxLength: 100
          example: Headquarters Primary Router
        lat:
          type: number
          format: float
          description: The latitude of the site's physical location.
          minimum: -90
          maximum: 90
          example: -33.8688
        lng:
          type: number
          format: float
          description: The longitude of the site's physical location.
          minimum: -180
          maximum: 180
          example: 151.2093
        address:
          type: string
          maxLength: 255
          description: A new physical address for the site.
          example: 123 Pitt Street, Sydney NSW 2000, Australia
        timezone:
          type: string
          description: The IANA timezone for the site's location.
          example: Australia/Sydney
    Site:
      type: object
      description: Represents the digital twin of a physical MikroTik device.
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier (UUID) for the site.
          example: 9a9a3e6f-1b1a-4b1a-8c1a-1e1a1a1a1a1a
        pid:
          type: string
          description: >-
            A time-sortable, prefixed unique identifier for the site, suitable
            for user-facing display.
          example: site_2m3h5n7k9j8g7f6e5d4c3b2a1
        name:
          type: string
          description: A user-defined name for the site.
          example: Main Office Router
        address:
          type: string
          nullable: true
          description: The geolocated physical address of the site.
          example: Sydney, New South Wales, Australia
        has_pulse:
          type: boolean
          description: >-
            Indicates if the site is currently online and sending heartbeats.
            `true` if online, `false` if offline.
          example: true
        uptime:
          type: string
          nullable: true
          description: A human-readable representation of the device's current uptime.
          example: 3 days, 14 hours, 5 minutes
        architecture_name:
          type: string
          nullable: true
          description: The CPU architecture of the device hardware.
          example: arm
        hardware_hash:
          type: string
          nullable: true
          description: A unique hash generated from the device's hardware identifiers.
          example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
        serial_number:
          type: string
          nullable: true
          description: The serial number of the MikroTik device.
          example: HFB098M0M2P
        software_version:
          type: string
          nullable: true
          description: The RouterOS software version running on the device.
          example: 7.15.1
        software_id:
          type: string
          nullable: true
          description: The software ID provided by RouterOS.
          example: U0B1-15HF
        identity:
          type: string
          nullable: true
          description: The identity name configured on the MikroTik device itself.
          example: HQ-Router
        last_seen_from:
          type: string
          format: ipv4
          nullable: true
          description: The public IP address from which the last heartbeat was received.
          example: 203.0.113.54
        model:
          type: string
          nullable: true
          description: The specific model of the MikroTik device.
          example: RB5009UG+S+
        board_name:
          type: string
          nullable: true
          description: The board name of the MikroTik device.
          example: RB5009
        routerboard:
          type: boolean
          nullable: true
          description: Indicates if the device is a genuine RouterBOARD product.
          example: true
        last_seen:
          type: string
          nullable: true
          description: >-
            A human-readable string indicating how long ago the last heartbeat
            was received.
          example: 2 minutes ago
        last_seen_at:
          type: string
          format: date-time
          nullable: true
          description: The specific timestamp (ISO 8601) of the last heartbeat.
          example: '2025-10-29T11:45:56Z'
        created_at:
          type: string
          format: date-time
          description: The timestamp (ISO 8601) when the site was created.
          example: '2025-10-20T08:30:00Z'
        updated_at:
          type: string
          format: date-time
          description: The timestamp (ISO 8601) when the site was last updated.
          example: '2025-10-29T11:47:50Z'
        deleted_at:
          type: string
          format: date-time
          nullable: true
          description: The timestamp (ISO 8601) when the site was marked for deletion.
          example: null
        scheduler_removal:
          type: string
          nullable: true
          description: >-
            A human-readable string indicating when the device's bootstrap
            scheduler will be removed.
          example: in 23 hours
    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_invalid
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'lat' parameter must be between -90 and 90.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_invalid
  responses:
    BadRequest:
      description: >-
        Bad Request - The request was malformed or invalid. Check the response
        body for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: Internal Server Error - An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
            example:
              type: api_error
              code: internal_server_error
              message: An internal server error occurred. Please try again later.
              doc_url: https://docs.altostrat.io/errors/api_error
  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>`

````