{
  "openapi": "3.0.0",
  "info": {
    "title": "Lane Intelligence API v2",
    "description": "Loadlink Lane Intelligence API — v2\n\nGet combined rate index and pickup/delivery posting-volume intelligence for a\nlane.\n\n**New here?** [Check your access →](/access)\n\nAll endpoints require a bearer token — call `POST /v2/authorize` with your\norganization's integration email and org token to get one. Your Salesforce account\nadmin provisions the org token; it is shared across every sub-account in your\norganization.\n\n**Errors**: 400 responses follow RFC 9457 (`ProblemDetails`) with a structured\n`errors[]` array of `{name, reason}` pairs. 401 responses have no body.\n429 (rate limit exceeded) includes `X-RateLimit-*` headers and `Retry-After`.\n\n**Example payloads**: every operation below has a sample request/response for\nillustration only — cities, tokens, rates, etc. are made up. Substitute your own\nvalid values both in \"Try it\" and in real integration code; nothing about the\nexample values themselves is required or enforced.",
    "version": "v2"
  },
  "servers": [
    {
      "url": "https://azdevgateway.loadlink.ca/lane-intelligence",
      "description": "Dev"
    }
  ],
  "paths": {
    "/v2/reference/vehicle-types": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "Get all vehicle types",
        "operationId": "GetVehicleTypes",
        "responses": {
          "200": {
            "description": "Vehicle types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VehicleTypeResponse"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "vehicleTypeId": 1,
                    "detail": "Van",
                    "value": 1,
                    "code": "V"
                  },
                  {
                    "id": 2,
                    "vehicleTypeId": 2,
                    "detail": "Reefer",
                    "value": 2,
                    "code": "R"
                  }
                ]
              }
            }
          },
          "204": {
            "description": "No types found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "OrgTokenBearer": []
          }
        ]
      }
    },
    "/v2/rate-index": {
      "post": {
        "tags": [
          "rate-index"
        ],
        "summary": "Get rate index for a lane",
        "operationId": "FreightMatchingApiEndpointsRIRateGetRIRateEndpoint",
        "requestBody": {
          "x-name": "RIRateRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RIRateRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "RI rate data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RIRateResponse"
                }
              }
            }
          },
          "204": {
            "description": "No data for this lane"
          },
          "400": {
            "description": "Invalid lane or city not found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "OrgTokenBearer": []
          }
        ]
      }
    },
    "/v2/posting-index": {
      "post": {
        "tags": [
          "posting-index"
        ],
        "summary": "Get pickup/delivery ratio for a lane",
        "operationId": "FreightMatchingApiEndpointsPDRatioGetPDRatioEndpoint",
        "requestBody": {
          "x-name": "PickupDeliveryRatioRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PickupDeliveryRatioRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "PD ratio data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickupDeliveryRatioResponse"
                }
              }
            }
          },
          "204": {
            "description": "No data for this lane"
          },
          "400": {
            "description": "Invalid lane or city not found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "OrgTokenBearer": []
          }
        ]
      }
    },
    "/v2/lane-intelligence": {
      "post": {
        "tags": [
          "lane-intelligence"
        ],
        "summary": "Get combined rate and posting-volume intelligence for a lane",
        "operationId": "FreightMatchingApiEndpointsLaneIntelligencePostLaneIntelligenceEndpoint",
        "requestBody": {
          "x-name": "LaneIntelligenceRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LaneIntelligenceRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Lane intelligence data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaneIntelligenceResponse"
                }
              }
            }
          },
          "204": {
            "description": "No data for this lane"
          },
          "400": {
            "description": "Invalid lane or city not found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "OrgTokenBearer": []
          }
        ]
      }
    },
    "/v2/authorize": {
      "post": {
        "tags": [
          "Authorize"
        ],
        "summary": "Exchange an org token for a bearer",
        "description": "Resolves the given email against your organization, validates the org-level integration token, and — if your organization has the Integration API feature provisioned — returns a bearer token to use as `Authorization: Bearer <token>` on every other endpoint. Tokens expire after 5 minutes; call this endpoint again to get a new one.",
        "operationId": "Authorize",
        "requestBody": {
          "x-name": "AuthorizeRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizeRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Bearer issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                },
                "example": {
                  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                  "tokenType": "Bearer",
                  "expiresIn": 300
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Org token does not match"
          },
          "403": {
            "description": "Account does not have the Integration API feature provisioned"
          },
          "404": {
            "description": "No user for that email, no account, or no org token provisioned yet"
          },
          "503": {
            "description": "Identity is temporarily unreachable — retry shortly"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "VehicleTypeResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique row identifier for this vehicle type.",
            "format": "int32"
          },
          "vehicleTypeId": {
            "type": "integer",
            "description": "Broader category grouping several vehicle types together (e.g. Van, Straight Truck, and Container all share the same category).",
            "format": "int32"
          },
          "detail": {
            "type": "string",
            "description": "Human-readable name (e.g. \"Van\", \"Reefer\", \"Flatbed\")."
          },
          "value": {
            "type": "integer",
            "description": "Bit-flag value for this vehicle type (a power of two). Postings encode their accepted vehicle types as a bitwise combination of these values.",
            "format": "int64"
          },
          "code": {
            "type": "string",
            "description": "Single-letter code for this vehicle type (e.g. \"V\" for Van, \"R\" for Reefer). This is the character used in a posting's VehicleType string."
          }
        }
      },
      "RIRateResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "vehicleType": {
            "type": "string",
            "nullable": true
          },
          "rate": {
            "type": "number"
          },
          "extra": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/RIRateExtra"
              }
            ]
          }
        }
      },
      "RIRateExtra": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "minRate": {
            "type": "number",
            "nullable": true
          },
          "maxRate": {
            "type": "number",
            "nullable": true
          },
          "fromMarket": {
            "type": "number",
            "nullable": true
          },
          "toMarket": {
            "type": "number",
            "nullable": true
          },
          "vanRate": {
            "type": "number",
            "nullable": true
          },
          "reeferRate": {
            "type": "number",
            "nullable": true
          },
          "flatbedRate": {
            "type": "number",
            "nullable": true
          }
        }
      },
      "RIRateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vehicleType",
          "srceCity",
          "srceSt",
          "destCity",
          "destSt"
        ],
        "properties": {
          "vehicleType": {
            "type": "string",
            "description": "One or more single-letter vehicle type codes concatenated together — see GET /v2/reference/vehicle-types (e.g. \"VR\" for Van + Reefer).",
            "maxLength": 50,
            "minLength": 0,
            "nullable": false
          },
          "srceCity": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": false
          },
          "srceSt": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "nullable": false
          },
          "destCity": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": false
          },
          "destSt": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "nullable": false
          }
        }
      },
      "PickupDeliveryRatioResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "weeklyOutbound": {
            "$ref": "#/components/schemas/PickupDeliveryOutbound"
          },
          "monthlyOutbound": {
            "$ref": "#/components/schemas/PickupDeliveryOutbound"
          }
        }
      },
      "PickupDeliveryOutbound": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "equipment": {
            "type": "integer",
            "format": "int32"
          },
          "loads": {
            "type": "integer",
            "format": "int32"
          },
          "ratio": {
            "type": "number"
          }
        }
      },
      "PickupDeliveryRatioRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vehicleType",
          "srceCity",
          "srceSt",
          "destCity",
          "destSt"
        ],
        "properties": {
          "vehicleType": {
            "type": "string",
            "description": "One or more single-letter vehicle type codes concatenated together — see GET /v2/reference/vehicle-types (e.g. \"VR\" for Van + Reefer).",
            "maxLength": 50,
            "minLength": 0,
            "nullable": false
          },
          "srceCity": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": false
          },
          "srceSt": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "nullable": false
          },
          "destCity": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": false
          },
          "destSt": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "nullable": false
          }
        }
      },
      "LaneIntelligenceResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "origin": {
            "type": "string"
          },
          "destination": {
            "type": "string"
          },
          "equipmentType": {
            "type": "string",
            "nullable": true
          },
          "rate": {
            "type": "number",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "rateMin": {
            "type": "number",
            "nullable": true
          },
          "rateMax": {
            "type": "number",
            "nullable": true
          },
          "vanRate": {
            "type": "number",
            "nullable": true
          },
          "reeferRate": {
            "type": "number",
            "nullable": true
          },
          "flatbedRate": {
            "type": "number",
            "nullable": true
          },
          "weeklyOutboundTruckPostings": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "weeklyOutboundLoadPostings": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "weeklyLoadToTruckRatio": {
            "type": "number",
            "nullable": true
          },
          "monthlyOutboundTruckPostings": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "monthlyOutboundLoadPostings": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "monthlyLoadToTruckRatio": {
            "type": "number",
            "nullable": true
          }
        }
      },
      "LaneIntelligenceRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vehicleType",
          "srceCity",
          "srceSt",
          "destCity",
          "destSt"
        ],
        "properties": {
          "vehicleType": {
            "type": "string",
            "description": "One or more single-letter vehicle type codes concatenated together — see GET /v2/reference/vehicle-types (e.g. \"VR\" for Van + Reefer).",
            "maxLength": 50,
            "minLength": 0,
            "pattern": "^[VvRrKkFfSsDdTtCcUuHhLlOoNnPpIiEe]+$",
            "nullable": false
          },
          "srceCity": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": false
          },
          "srceSt": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "nullable": false
          },
          "destCity": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": false
          },
          "destSt": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "nullable": false
          }
        }
      },
      "AuthorizeResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "tokenType": {
            "type": "string"
          },
          "expiresIn": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "AuthorizeRequest": {
        "type": "object",
        "example": {
          "email": "dispatch@example.com",
          "orgToken": "ll_example-org-token"
        },
        "additionalProperties": false,
        "required": [
          "email",
          "orgToken"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 1,
            "pattern": "^[^@]+@[^@]+$",
            "nullable": false,
            "example": "dispatch@example.com"
          },
          "orgToken": {
            "type": "string",
            "maxLength": 100,
            "minLength": 0,
            "nullable": false,
            "example": "ll_example-org-token"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "description": "RFC9457 compatible problem details/ error response class. this can be used by configuring startup like so:\napp.UseFastEndpoints(c => c.Errors.UseProblemDetails())",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "default": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1"
          },
          "title": {
            "type": "string",
            "default": "One or more validation errors occurred."
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "default": 400
          },
          "instance": {
            "type": "string",
            "default": "/api/route"
          },
          "traceId": {
            "type": "string",
            "default": "0HMPNHL0JHL76:00000001"
          },
          "detail": {
            "type": "string",
            "description": "the details of the error",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProblemDetails_Error"
            }
          }
        }
      },
      "ProblemDetails_Error": {
        "type": "object",
        "description": "the error details object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "the name of the error or property of the dto that caused the error",
            "default": "Error or field name"
          },
          "reason": {
            "type": "string",
            "description": "the reason for the error",
            "default": "Error reason"
          },
          "code": {
            "type": "string",
            "description": "the code of the error",
            "nullable": true
          },
          "severity": {
            "type": "string",
            "description": "the severity of the error",
            "nullable": true
          }
        }
      }
    },
    "securitySchemes": {
      "OrgTokenBearer": {
        "type": "http",
        "description": "Bearer token from POST /v2/authorize — exchange your org token for one, then use it here.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "tags": [
    {
      "name": "Authorize"
    },
    {
      "name": "Reference"
    },
    {
      "name": "rate-index"
    },
    {
      "name": "posting-index"
    },
    {
      "name": "lane-intelligence"
    }
  ]
}