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

# Get service map status

> Return ServiceMap collection status for one or more hosts, or a bounded fleet sample.

## Restrictions

| Aspect      | Value                                                      |
| ----------- | ---------------------------------------------------------- |
| Rate limits | **100 requests/minute**; **5 requests/second** per account |
| Permissions | **Targets Read** (`monit`)                                 |

## Usage

* ServiceMap is an optional subsystem: a deployment without `redis.servicemap` configured returns `ServiceUnavailable`.
* Exactly one selection mode is used per call: explicit `host_id`/`host_ids`, or `fleet=true`; combining `fleet=true` with either host field is rejected.
* Unlike `POST /monit/servicemap/topology` and `POST /monit/servicemap/summary`, an unresolvable host does not fail the whole request — it is reported per item via `items[].error_code`.
* `limit` (default 100, max 200) bounds the number of explicit hosts accepted, and in `fleet` mode, the number of candidate hosts sampled.


## OpenAPI

````yaml /api-reference/monitors.openapi.en.json post /monit/servicemap/status
openapi: 3.1.0
info:
  title: Flashduty Open API
  description: >-
    Public HTTP API for the Flashduty incident management platform — incidents,
    notification templates, channels, schedules, monitors, RUM, and platform
    administration. Every operation is authenticated with an `app_key` query
    parameter issued from the Flashduty console under Account → APP Keys.
    Responses follow a uniform envelope: `{ request_id, data }` on success, `{
    request_id, error }` on failure.
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: Monitors/Alert rules
    description: >-
      Create, manage, and export monitor alert rules. Query rule counters and
      audit history.
  - name: Monitors/Data sources
    description: Manage monitoring data sources used by alert rules to query metrics.
  - name: Monitors/Rule sets
    description: >-
      Manage shared rule sets (rulesets) in the Monitors rule repository.
      Rulesets can be shared publicly or within an account.
  - name: Monitors/Diagnostics
    description: >-
      Diagnostic and query endpoints used by Flashduty AI SRE — ad-hoc data
      source queries, log/metric diagnostics, and target-side tool invocation.
  - name: Monitors/Monitor utilities
    description: Monitors service activation and data preview utilities.
  - name: Monitors/Service map
    description: >-
      Query network-observed service topology, dependency summaries, and
      ServiceMap collection status across hosts.
paths:
  /monit/servicemap/status:
    post:
      tags:
        - Monitors/Service map
      summary: Get service map status
      description: >-
        Return ServiceMap collection status for one or more hosts, or a bounded
        fleet sample.
      operationId: monit-servicemap-read-status
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceMapStatusRequest'
            example:
              host_id: host_0123456789abcdef0123456789abcdef
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ServiceMapStatusResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  fleet: false
                  items:
                    - host_id: host_0123456789abcdef0123456789abcdef
                      network_scope_id: ns_0123456789abcdef0123456789abcdef
                      status: active
                      authoritative: true
                      graph_available: true
                      capability:
                        present: true
                        enabled: true
                        status: running
                        host_id: host_0123456789abcdef0123456789abcdef
                        capture_mode: ebpf
                        report_interval_ms: 60000
                        snapshot_ready: true
                      freshness:
                        status: fresh
                        newest_received_at_ms: 1784635557272
                        oldest_received_at_ms: 1784635557272
                        max_age_ms: 1200
                      coverage:
                        degraded: false
                        truncated: false
                        network_inventory_status: complete
                        kubernetes_enrichment_status: unavailable
                      observed_at_ms: 1784635556072
                      received_at_ms: 1784635557272
                      report_interval_ms: 60000
                      node_count: 12
                      edge_count: 8
                  coverage:
                    requested: 1
                    succeeded: 1
                    failed: 0
                    truncated: false
                    states:
                      active: 1
                      degraded: 0
                      stale: 0
                      initializing: 0
                      disabled: 0
                      unsupported: 0
                      no_data: 0
                  partial: false
                  generated_at_ms: 1784635558472
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    ServiceMapStatusRequest:
      type: object
      description: >-
        Selects which hosts to fetch collection status for: explicit host IDs,
        or a bounded fleet sample.
      properties:
        host_id:
          type: string
          description: >-
            A single host ID to check. Combine with `host_ids` to check several;
            mutually exclusive with `fleet=true`.
          pattern: ^host_[a-z0-9_-]+$
          maxLength: 128
        host_ids:
          type: array
          description: >-
            Multiple host IDs to check in one call, up to 200 combined with
            `host_id`. Mutually exclusive with `fleet=true`.
          items:
            type: string
        fleet:
          type: boolean
          description: >-
            When `true`, ignore `host_id`/`host_ids` and instead sample up to
            `limit` fleet candidate hosts for the account. Default `false`.
          default: false
        limit:
          type: integer
          description: >-
            In `fleet` mode, the number of candidate hosts to sample. Ignored
            otherwise. Default 100, range 1-200.
          default: 100
          minimum: 1
          maximum: 200
    SuccessEnvelope:
      type: object
      description: >-
        Success response envelope. On every 2xx response, `request_id`
        identifies the call (also mirrored in the `Flashcat-Request-Id` header)
        and `data` holds the endpoint-specific payload. Failure responses use a
        different shape — see `ErrorResponse`.
      properties:
        request_id:
          type: string
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            response header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
      required:
        - request_id
        - data
    ServiceMapStatusResponse:
      type: object
      description: ServiceMap collection status for the requested hosts.
      required:
        - fleet
        - items
        - coverage
        - partial
        - generated_at_ms
      properties:
        fleet:
          type: boolean
          description: >-
            Echoes whether this response was produced from a fleet sample rather
            than explicit host IDs.
        items:
          type: array
          description: Per-host status, in the same order the hosts were resolved.
          items:
            $ref: '#/components/schemas/ServiceMapStatusItem'
        coverage:
          $ref: '#/components/schemas/ServiceMapStatusBatchCoverage'
          description: Summary of how many hosts were successfully covered.
        partial:
          type: boolean
          description: True if any host failed or the fleet sample was truncated.
        generated_at_ms:
          type: integer
          format: int64
          description: Unix timestamp in milliseconds this response was generated.
    ServiceMapStatusItem:
      type: object
      description: ServiceMap collection status for a single host.
      required:
        - host_id
        - status
        - authoritative
        - graph_available
        - capability
        - freshness
        - coverage
        - node_count
        - edge_count
      properties:
        host_id:
          type: string
          description: Host ID this status describes.
        network_scope_id:
          type: string
          description: Network scope resolved for this host, when known.
        status:
          type: string
          enum:
            - active
            - degraded
            - stale
            - initializing
            - disabled
            - unsupported
            - no_data
          description: >-
            Overall ServiceMap collection status.


            | Value | Meaning |

            |---|---|

            | `active` | Collection healthy: a fresh snapshot exists with no
            degradation. |

            | `degraded` | Collecting but quality is impaired: health reports
            are newer than the snapshot, the snapshot is truncated/degraded, or
            collection is failing. |

            | `stale` | A snapshot exists but is outdated (not updated within 2×
            the report interval). |

            | `initializing` | The agent has reported the capability but the
            first snapshot is not ready yet. |

            | `disabled` | Topology collection is disabled on this host. |

            | `unsupported` | The agent or kernel does not support this
            collection. |

            | `no_data` | No snapshot or health data received at all. |
        authoritative:
          type: boolean
          description: True if the host has an authoritative current graph.
        graph_available:
          type: boolean
          description: True if a current graph can be fetched for this host right now.
        capability:
          $ref: '#/components/schemas/ServiceMapCapability'
          description: The host's self-reported ServiceMap capability.
        freshness:
          $ref: '#/components/schemas/ServiceMapFreshness'
          description: How recent the host's graph data is.
        coverage:
          $ref: '#/components/schemas/ServiceMapHostCoverage'
          description: Coverage and enrichment status for this host's graph.
        observed_at_ms:
          type: integer
          format: int64
          description: >-
            Unix timestamp in milliseconds the host's graph was observed by the
            agent.
        received_at_ms:
          type: integer
          format: int64
          description: >-
            Unix timestamp in milliseconds the host's current graph generation
            was received by the server.
        latest_health_at_ms:
          type: integer
          format: int64
          description: >-
            Unix timestamp in milliseconds of the most recent non-authoritative
            health signal, when more recent than the current graph.
        report_interval_ms:
          type: integer
          format: int64
          description: Configured reporting interval in milliseconds.
        node_count:
          type: integer
          description: Number of nodes in the host's current graph.
        edge_count:
          type: integer
          description: Number of edges in the host's current graph.
        reason_codes:
          type: array
          description: Machine-readable codes explaining the current status.
          items:
            type: string
        error_code:
          type: string
          description: >-
            Set to `status_unavailable` when this host's status could not be
            read; other fields fall back to inventory-derived defaults in that
            case.
    ServiceMapStatusBatchCoverage:
      type: object
      description: Summary of how many hosts in the request were successfully covered.
      required:
        - requested
        - succeeded
        - failed
        - truncated
        - states
      properties:
        requested:
          type: integer
          description: >-
            Number of hosts requested (explicit `host_id`/`host_ids`, or the
            fleet sample size actually scanned).
        succeeded:
          type: integer
          description: Number of hosts whose status was read successfully.
        failed:
          type: integer
          description: Number of hosts whose status could not be read.
        truncated:
          type: boolean
          description: >-
            True if `fleet` mode found more candidates than `limit` allowed to
            return.
        states:
          type: object
          description: >-
            Count of items per status value; always includes all seven keys
            (`active`, `degraded`, `stale`, `initializing`, `disabled`,
            `unsupported`, `no_data`), zero-filled.
          additionalProperties:
            type: integer
    ErrorResponse:
      type: object
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          description: >-
            Unique trace ID of this request; include it when reporting issues so
            logs can be located.
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    ServiceMapCapability:
      type: object
      description: >-
        The host's self-reported ServiceMap capability, from the target
        inventory.
      required:
        - present
        - enabled
        - snapshot_ready
      properties:
        present:
          type: boolean
          description: >-
            True if the host has an inventory row with ServiceMap capability
            metadata at all.
        enabled:
          type: boolean
          description: True if ServiceMap collection is enabled on this host.
        status:
          type: string
          description: >-
            Agent-reported capability status, e.g. `running`, `disabled`,
            `starting`, `failed`, `unsupported`.
        host_id:
          type: string
          description: Host ID this capability describes.
        capture_mode:
          type: string
          description: Capture mode, e.g. `ebpf` or `polling`.
        report_interval_ms:
          type: integer
          format: int64
          description: Configured reporting interval in milliseconds.
        snapshot_ready:
          type: boolean
          description: True if the agent has produced at least one full snapshot.
        reason_codes:
          type: array
          description: Machine-readable codes explaining the current capability status.
          items:
            type: string
    ServiceMapFreshness:
      type: object
      description: Describes how recent the underlying graph data is.
      required:
        - status
        - newest_received_at_ms
        - oldest_received_at_ms
        - max_age_ms
      properties:
        status:
          type: string
          enum:
            - fresh
            - stale
            - unknown
          description: >-
            Freshness classification. `fresh` = the latest snapshot was received
            within 2× the report interval; `stale` = no new snapshot within 2×
            the report interval; `unknown` = no snapshot data, undecidable.
        newest_received_at_ms:
          type: integer
          format: int64
          description: >-
            Unix timestamp in milliseconds of the most recently received graph
            among the hosts covered.
        oldest_received_at_ms:
          type: integer
          format: int64
          description: >-
            Unix timestamp in milliseconds of the least recently received graph
            among the hosts covered.
        max_age_ms:
          type: integer
          format: int64
          description: Age in milliseconds of the staleest graph covered, relative to now.
    ServiceMapHostCoverage:
      type: object
      description: Coverage and enrichment status for a single host's graph.
      required:
        - degraded
        - truncated
      properties:
        degraded:
          type: boolean
          description: True if the host's graph was degraded at collection time.
        truncated:
          type: boolean
          description: True if the host's graph was truncated at collection time.
        network_inventory_status:
          type: string
          description: >-
            Network-inventory enrichment status for this host, e.g. `complete`,
            `partial`, `unavailable`, as self-reported by the agent.
        kubernetes_enrichment_status:
          type: string
          description: >-
            Kubernetes enrichment status for this host, as self-reported by the
            agent.
        reason_codes:
          type: array
          description: Machine-readable codes explaining the current coverage status.
          items:
            type: string
    DutyError:
      type: object
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            Human-readable error message, localized by the caller's
            Accept-Language. May contain field names, IDs, or other context from
            the failing request.
          example: The specified parameter template_id is not valid.
      required:
        - code
        - message
    ErrorCode:
      type: string
      description: >-
        Flashduty error code enum. Every failed API response sets `error.code`
        to one of these stable wire strings. HTTP status is informational — the
        authoritative signal is the enum value.


        | Code | HTTP | Meaning |

        |---|---|---|

        | `OK` | 200 | Reserved — not returned on real errors. |

        | `InvalidParameter` | 400 | A required parameter is missing or failed
        validation. |

        | `BadRequest` | 400 | Generic 400 used when no more specific code fits.
        |

        | `InvalidContentType` | 400 | The `Content-Type` header is not
        `application/json`. |

        | `ResourceNotFound` | 400 | The referenced resource does not exist.
        Note: returned as HTTP 400, not 404 (historical choice). |

        | `NoLicense` | 400 | The feature is license-gated and no active license
        was found. |

        | `ReferenceExist` | 400 | Deletion blocked — other entities still
        reference this resource. |

        | `Unauthorized` | 401 | `app_key` is missing, invalid, or expired. |

        | `BalanceNotEnough` | 402 | Billing-gated operation with insufficient
        account balance. |

        | `AccessDenied` | 403 | Authenticated but lacking the permission
        required for this operation. |

        | `RouteNotFound` | 404 | The request URL path is not a known route. |

        | `MethodNotAllowed` | 405 | The HTTP method is not allowed on this
        otherwise-known path. |

        | `UndonedOrderExist` | 409 | An outstanding billing order blocks this
        new one. Wait and retry. |

        | `RequestLocked` | 423 | Operation temporarily locked due to repeated
        failures. |

        | `EntityTooLarge` | 413 | Request body exceeds the configured max size.
        |

        | `RequestTooFrequently` | 429 | Rate limit hit — API-global,
        per-account, or per-integration. |

        | `RequestVerifyRequired` | 428 | Second-factor verification required
        but not supplied. |

        | `DangerousOperation` | 428 | High-risk operation requires MFA
        verification. |

        | `InternalError` | 500 | Unhandled server-side error. Include
        `request_id` in the bug report. |

        | `ServiceUnavailable` | 503 | A backend dependency is unavailable. Try
        again later. |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: Reserved — not returned on real errors.
        InvalidParameter: A required parameter is missing or failed validation.
        BadRequest: Generic 400 used when no more specific code fits.
        InvalidContentType: The `Content-Type` header is not `application/json`.
        ResourceNotFound: >-
          The referenced resource does not exist. Note: returned as HTTP 400,
          not 404 (historical choice).
        NoLicense: The feature is license-gated and no active license was found.
        ReferenceExist: Deletion blocked — other entities still reference this resource.
        Unauthorized: '`app_key` is missing, invalid, or expired.'
        BalanceNotEnough: Billing-gated operation with insufficient account balance.
        AccessDenied: Authenticated but lacking the permission required for this operation.
        RouteNotFound: The request URL path is not a known route.
        MethodNotAllowed: The HTTP method is not allowed on this otherwise-known path.
        UndonedOrderExist: An outstanding billing order blocks this new one. Wait and retry.
        RequestLocked: Operation temporarily locked due to repeated failures.
        EntityTooLarge: Request body exceeds the configured max size.
        RequestTooFrequently: Rate limit hit — API-global, per-account, or per-integration.
        RequestVerifyRequired: Second-factor verification required but not supplied.
        DangerousOperation: High-risk operation requires MFA verification.
        InternalError: Unhandled server-side error. Include `request_id` in the bug report.
        ServiceUnavailable: A backend dependency is unavailable. Try again later.
      example: InvalidParameter
  responses:
    BadRequest:
      description: Invalid request — usually a missing or malformed parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter is not valid.
    Unauthorized:
      description: Missing or invalid app_key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingAppKey:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: Unauthorized
                  message: You are unauthorized.
    TooManyRequests:
      description: >-
        Rate limit hit. Either the global API limit, a per-account limit, or a
        per-integration limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: Unexpected server-side error. Include the request_id when reporting.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
    ServiceUnavailable:
      description: >-
        The ServiceMap subsystem is not enabled or not reachable on this
        deployment. Include the request_id when reporting.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            serviceMapDisabled:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: ServiceUnavailable
                  message: servicemap store is not initialized
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: app_key
      description: >-
        App key issued from the Flashduty console under Account → APP Keys.
        Required on every public API call. Keep it secret — it grants the same
        access as the owning account.

````