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

> Retrieves the complete details of a specific job by its unique identifier (UUID).



## OpenAPI

````yaml /api/en/mikrotik-api.yaml get /site/{siteId}/job/{jobId}
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:
  /site/{siteId}/job/{jobId}:
    get:
      tags:
        - Jobs
      summary: Retrieve a Job
      description: >-
        Retrieves the complete details of a specific job by its unique
        identifier (UUID).
      parameters:
        - name: siteId
          in: path
          required: true
          description: The UUID of the site.
          schema:
            type: string
            format: uuid
        - name: jobId
          in: path
          required: true
          description: The UUID of the job to retrieve.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The requested job object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '404':
          description: Not Found - The requested job or site does not exist.
components:
  schemas:
    Job:
      type: object
      description: An asynchronous command or script to be executed on a Site.
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier (UUID) for the job.
          example: 8b8b2e5e-1a19-4a19-8b19-1e1919191919
        token:
          type: string
          description: >-
            A short, unique, human-readable token for the job, often used in log
            filtering.
          example: 2jP5kLqWnZ
        site_id:
          type: string
          format: uuid
          description: The ID of the site this job is targeted for.
          example: 9a9a3e6f-1b1a-4b1a-8c1a-1e1a1a1a1a1a
        idempotency_key:
          type: string
          format: uuid
          description: >-
            A unique key provided by the client to prevent duplicate job
            creation.
          example: 7c7c1e4e-1918-4918-8a18-1e1818181818
        description:
          type: string
          description: A human-readable description of the job's purpose.
          example: Add new firewall rule for guest network
        express_execute:
          type: boolean
          description: >-
            If `true`, the platform will attempt to trigger an immediate
            check-in from the device to execute this job sooner.
          example: false
        needs_acknowledgement:
          type: boolean
          description: >-
            If `true`, the job requires an explicit success/fail notification
            from the device to be marked as complete.
          example: true
        should_backup:
          type: boolean
          description: >-
            If `true`, a configuration backup was automatically created before
            this job was queued.
          example: true
        associated_backup:
          type: string
          nullable: true
          description: >-
            The path to the configuration backup file associated with this job,
            if one was created.
          example: 9a9a3e6f-1b1a-4b1a-8c1a-1e1a1a1a1a1a/1667888400.rsc
        started_at:
          type: string
          format: date-time
          nullable: true
          description: The timestamp when the device started executing the job.
          example: '2025-10-29T12:05:10Z'
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            The timestamp when the device reported successful completion of the
            job.
          example: null
        failed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            The timestamp when the device reported a failure during job
            execution.
          example: null
        created_at:
          type: string
          format: date-time
          description: The timestamp when the job was created.
          example: '2025-10-29T12:00:00Z'
        log_url:
          type: string
          description: >-
            A relative URL to the Altostrat SDX UI to view logs related to this
            job's execution.
          example: >-
            logs?group=sites&streams=9a9a...&start=...&end=...&filter={$.message=*2jP5kLqWnZ*}
        script:
          type: string
          description: The raw RouterOS script payload of the job.
          example: >-
            /ip firewall filter add chain=forward action=accept
            src-address-list=guests
  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>`

````