{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Get telematic details of an ELD carrier",
    "description": "The API provides the list of providers and assets of an ELD carriers.\n\nRequests are authenticated by the `partnerId` and `accountId` attributes as query params.\nThese values will be provided by TruckerTools during onboarding, the latter already being encrypted.\n\n**Note:** The below providers do not allow us to access a carrier's vehicle list, so carriers\nwith these providers will result in blank responses.\n\n```\nOmnitracs\nMercer\nAriontech\nGPS Border\n```\n"
  },
  "servers": [
    {
      "url": "http://loadtracking.truckertools.com",
      "description": "Production Server\n"
    }
  ],
  "security": [],
  "paths": {
    "/telematics/carrierExternal": {
      "get": {
        "summary": "List of telematic providers and assets of an ELD carriers",
        "description": "Get telematic details of an ELD carrier\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/accountId"
          },
          {
            "$ref": "#/components/parameters/partnerId"
          },
          {
            "$ref": "#/components/parameters/mcNumber"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/getTelematicDetailsResponse"
          },
          "422": {
            "$ref": "#/components/responses/GetInvalid"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "accountId": {
        "description": "Encrypted Customer Account Id\n",
        "name": "accountId",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "example": null
        }
      },
      "partnerId": {
        "description": "Customer Partner Id\n",
        "name": "partnerId",
        "in": "query",
        "required": true,
        "schema": {
          "type": "integer",
          "example": null
        }
      },
      "mcNumber": {
        "description": "Carrier MC/Docket number\n",
        "name": "mcNumber",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "example": 123456
        }
      }
    },
    "responses": {
      "getTelematicDetailsResponse": {
        "description": "Get telematic details of an ELD carrier\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CarrierResponse"
            }
          }
        }
      },
      "GetInvalid": {
        "description": "Unprocessable Entity. This occurs when the requested resource (Carrier or Account) cannot be found.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "CarrierNotFound": {
                "summary": "Carrier Error",
                "value": {
                  "errors": {
                    "error": [
                      "Carrier detail not found."
                    ]
                  }
                }
              },
              "AccountNotFound": {
                "summary": "Account Error",
                "value": {
                  "errors": {
                    "error": [
                      "Account not found"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "CarrierResponse": {
        "type": "object",
        "properties": {
          "carrier": {
            "$ref": "#/components/schemas/Carrier"
          },
          "providers": {
            "$ref": "#/components/schemas/Providers"
          },
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Asset"
            }
          }
        }
      },
      "Carrier": {
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string",
            "example": "ABC Trucking LLC"
          },
          "mcNumber": {
            "type": "string",
            "example": "MC123456"
          },
          "dotNumber": {
            "type": "string",
            "example": "456789"
          }
        }
      },
      "Providers": {
        "type": "object",
        "description": "Lists the integrated technology providers for the carrier.",
        "properties": {
          "telematicsProviders": {
            "type": "array",
            "description": "A list of ELD/Telematics service providers (e.g., Samsara, Motive).",
            "items": {
              "type": "string"
            },
            "example": [
              "Motive"
            ]
          },
          "temperatureProviders": {
            "type": "array",
            "description": "A list of providers used for reefer/temperature tracking.",
            "items": {
              "type": "string"
            },
            "example": [
              "Samsara"
            ]
          }
        }
      },
      "Asset": {
        "type": "object",
        "description": "Details regarding specific telematic assets and associated vehicles.",
        "properties": {
          "telematicsProvider": {
            "type": "string",
            "description": "The name of the provider for this specific asset group.",
            "example": "Samsara"
          },
          "id": {
            "type": "integer",
            "description": "Internal unique identifier for the integration record.",
            "example": 104084
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp when the asset record was created.",
            "example": "2026-02-16 13:52:15"
          },
          "trucks": {
            "type": "array",
            "description": "List of truck identifiers associated with this provider.",
            "items": {
              "type": "string"
            },
            "example": [
              "truck1",
              "truck2",
              "truck3"
            ]
          },
          "trailers": {
            "type": "array",
            "description": "List of trailer identifiers.",
            "items": {
              "type": "string"
            },
            "example": [
              "trailer1",
              "trailer2",
              "trailer3"
            ]
          },
          "trucksAndTrailers": {
            "type": "array",
            "description": "Combined mapping of trucks and their linked trailers.",
            "items": {
              "type": "string"
            },
            "example": [
              "trailer1",
              "truck2"
            ]
          },
          "temp": {
            "type": "array",
            "description": "Temperature sensor data or identifiers.",
            "items": {
              "type": "string"
            },
            "example": []
          },
          "message": {
            "type": "string",
            "nullable": true,
            "description": "Any status or error message returned by the provider.",
            "example": null
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "object",
            "properties": {
              "error": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}