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

# Organization Service Health

> Current service health of one organization's fleet, counted from the stored chains.



## OpenAPI

````yaml https://app.podero.com/api/partners/v2.0/openapi.json get /api/partners/v2.0/org/{org_id}/platform/service-health
openapi: 3.1.0
info:
  title: Podero Partner API
  version: '2.0'
  description: >-
    This API provides a unified interaction point for Podero's partner
    companies.


    The goal of this API is to give partners easily integratable endpoints that
    don't require extensive software

    development. For this reason, the endpoints focus around user and device
    management, setting of preferences

    and high level device controls.


    While direct control of devices is implemented for special use cases such as
    pause power, we abstract away low level

    direct device steering so developers and partners can focus on delivering
    maximum value to end users.


    ## Authentication


    Send an OAuth2 access token in the `Authorization: Bearer <access_token>`
    header of each request.

    A token request must have a JSON body. The token endpoints do not read a
    form-encoded body.


    Server-to-server integrations use the client credentials grant:


    ```http

    POST /oauth2/token/

    Authorization: Basic base64(<client_id>:<client_secret>)

    Content-Type: application/json


    {"grant_type": "client_credentials"}

    ```


    The response does not contain a refresh token. The access token expires
    after `expires_in` seconds (one hour).

    To renew it, send the same request again. Use one token for all requests
    until shortly before it expires.

    Do not request a new token for each request. If a request returns `401`, get
    one new token and send the request

    again once. If it returns `401` again, the token is valid but the
    application has no access to that resource,

    and a new token does not change that.


    Apps where a person signs in use the password grant at `POST
    /api/partners/v2.0/auth/token`, and renew the

    session with the `refresh_token` grant at the same endpoint.
  termsOfService: https://www.podero.com/terms-and-conditions
servers: []
security: []
paths:
  /api/partners/v2.0/org/{org_id}/platform/service-health:
    get:
      tags:
        - Platform
      summary: Organization Service Health
      description: >-
        Current service health of one organization's fleet, counted from the
        stored chains.
      operationId: integrations_api_api_v2_platform_router_organization_service_health
      parameters:
        - in: query
          name: device_type
          schema:
            description: >-
              A device type's ORM relation name — and the key into its
              state-store binding.


              The value doubles as the related-name used in ORM kwargs (e.g.
              ``HeatPumpDataPoint(heat_pump=…)``),

              so this is a ``StrEnum`` to stay interchangeable with that string
              at those sites.
            enum:
              - heat_pump
              - inverter
              - electric_vehicle
              - wallbox
            title: DeviceField
            type: string
          required: true
          description: >-
            A device type's ORM relation name — and the key into its state-store
            binding.


            The value doubles as the related-name used in ORM kwargs (e.g.
            ``HeatPumpDataPoint(heat_pump=…)``),

            so this is a ``StrEnum`` to stay interchangeable with that string at
            those sites.
        - in: path
          name: org_id
          schema:
            format: uuid
            title: Org Id
            type: string
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FleetServiceHealthOutput'
      security:
        - OAuth2: []
components:
  schemas:
    FleetServiceHealthOutput:
      properties:
        contract:
          default: fleet-service-health
          title: Contract
          type: string
        schema_version:
          default: 2
          title: Schema Version
          type: integer
        generated_at:
          format: date-time
          title: Generated At
          type: string
        scope:
          $ref: '#/components/schemas/FleetServiceHealthScope'
        coverage:
          $ref: '#/components/schemas/FleetServiceHealthCoverage'
        overall:
          $ref: '#/components/schemas/StatusSummaryOutput'
        overall_reasons:
          items:
            $ref: '#/components/schemas/ReasonCountOutput'
          title: Overall Reasons
          type: array
        services:
          items:
            $ref: '#/components/schemas/ServiceCardOutput'
          title: Services
          type: array
      required:
        - generated_at
        - scope
        - coverage
        - overall
        - overall_reasons
        - services
      title: FleetServiceHealthOutput
      type: object
    FleetServiceHealthScope:
      properties:
        organization_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Organization Id
        device_type:
          $ref: '#/components/schemas/DeviceField'
        population:
          const: physical
          default: physical
          title: Population
          type: string
      required:
        - organization_id
        - device_type
      title: FleetServiceHealthScope
      type: object
    FleetServiceHealthCoverage:
      description: >-
        How much of the population the sweep has reached. A device without a
        record counts as

        unknown. A device whose record outlived its 45-minute evaluation
        deadline counts in

        ``lapsed_devices`` and reads unknown, so a stopped sweep cannot leave
        its last verdicts standing.
      properties:
        expected_devices:
          title: Expected Devices
          type: integer
        evaluated_devices:
          title: Evaluated Devices
          type: integer
        missing_record_devices:
          title: Missing Record Devices
          type: integer
        lapsed_devices:
          title: Lapsed Devices
          type: integer
        newest_record_change_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Newest Record Change At
      required:
        - expected_devices
        - evaluated_devices
        - missing_record_devices
        - lapsed_devices
        - newest_record_change_at
      title: FleetServiceHealthCoverage
      type: object
    StatusSummaryOutput:
      description: >-
        One population's state distribution. ``healthy_share`` is ``healthy /
        evaluable`` and null

        when nothing could be evaluated; ``blocked`` devices stay in the
        response for the greyed-out

        share of the bar.
      properties:
        total:
          title: Total
          type: integer
        applicable:
          title: Applicable
          type: integer
        blocked:
          title: Blocked
          type: integer
        evaluable:
          title: Evaluable
          type: integer
        counts:
          additionalProperties:
            type: integer
          title: Counts
          type: object
        affected:
          title: Affected
          type: integer
        unknown:
          title: Unknown
          type: integer
        healthy_share:
          anyOf:
            - type: number
            - type: 'null'
          title: Healthy Share
      required:
        - total
        - applicable
        - blocked
        - evaluable
        - counts
        - affected
        - unknown
        - healthy_share
      title: StatusSummaryOutput
      type: object
    ReasonCountOutput:
      properties:
        status:
          $ref: '#/components/schemas/ServiceHealthStatus'
        reason:
          title: Reason
          type: string
        devices:
          title: Devices
          type: integer
      required:
        - status
        - reason
        - devices
      title: ReasonCountOutput
      type: object
    ServiceCardOutput:
      description: >-
        One service over the selected population, with the breakdowns that
        partition it.
      properties:
        id:
          $ref: '#/components/schemas/ComponentId'
        summary:
          $ref: '#/components/schemas/StatusSummaryOutput'
        manufacturers:
          items:
            $ref: '#/components/schemas/ManufacturerSummaryOutput'
          title: Manufacturers
          type: array
        reasons:
          items:
            $ref: '#/components/schemas/ReasonCountOutput'
          title: Reasons
          type: array
      required:
        - id
        - summary
        - manufacturers
        - reasons
      title: ServiceCardOutput
      type: object
    DeviceField:
      description: >-
        A device type's ORM relation name — and the key into its state-store
        binding.


        The value doubles as the related-name used in ORM kwargs (e.g.
        ``HeatPumpDataPoint(heat_pump=…)``),

        so this is a ``StrEnum`` to stay interchangeable with that string at
        those sites.
      enum:
        - heat_pump
        - inverter
        - electric_vehicle
        - wallbox
      title: DeviceField
      type: string
    ServiceHealthStatus:
      description: >-
        What one service-health row means for the fleet, in the v2 contract's
        words.
      enum:
        - healthy
        - degraded
        - failed
        - authorization_required
        - unknown
        - idle
        - not_applicable
        - blocked
      title: ServiceHealthStatus
      type: string
    ComponentId:
      description: >-
        The service chain a device's health is reported over, in dependency
        order.
      enum:
        - oem_auth
        - podero_auth
        - oem_monitoring
        - podero_monitoring
        - forecasting
        - optimization
        - podero_steering
        - oem_steering
      title: ComponentId
      type: string
    ManufacturerSummaryOutput:
      properties:
        manufacturer:
          title: Manufacturer
          type: string
        summary:
          $ref: '#/components/schemas/StatusSummaryOutput'
      required:
        - manufacturer
        - summary
      title: ManufacturerSummaryOutput
      type: object
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        password:
          tokenUrl: /api/partners/v2.0/auth/token
          scopes: {}
        clientCredentials:
          tokenUrl: /oauth2/token/
          scopes: {}

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.