---
title: "Ai Parse Capacity"
method: POST
path: "/v2/tms/carriers/{carrier_id}/ai-parse-capacity"
tags: ["v2", "tms", "carriers"]
---

# Ai Parse Capacity

`POST /v2/tms/carriers/{carrier_id}/ai-parse-capacity`

## Request

- Base URL: `https://api.mentium.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mentium.io/v2/tms/carriers/{carrier_id}/ai-parse-capacity`
- Auth: HTTP bearer

Parse natural language text or screenshot into carrier capacity form data.

Uses AI to extract lane or availability data from descriptions or screenshots
and returns pre-fill data for the Add Lane / Add Truck forms.

## Path parameters

- `carrier_id` string, required

## Headers

- `mentium-workspace-id` string, nullable

## Request body

- AIParseCapacityRequest: Request to parse natural language or image input into capacity form data.
  - `text` string, nullable: Natural language description of the lane or availability
  - `image_base64` string, nullable: Base64-encoded image (screenshot), max ~5 MB
  - `capacity_type` 'lane' | 'availability', required: Type of capacity data to extract: 'lane' or 'availability'
  - `current_carrier_name` string, nullable: Name of the carrier whose page is currently open. Helps the AI distinguish carrier names from place names in ambiguous input.
  - `available_carriers` string[], nullable: List of carrier names available in the system. The AI uses this to match fuzzy carrier references to exact names.
  - `existing_lane_items` ExistingLaneItem[], nullable: Current lane rows in the form, sent as context so the AI can modify/add/remove them.
    - `index` integer, required: 1-based lane number in the form
    - `source` string, nullable: Source location, e.g. 'Dallas, Texas, US'
    - `destination` string, nullable: Destination location, e.g. 'Chicago, Illinois, US'
    - `shipping_method` string, nullable: Shipping method, e.g. FTL, LTL
    - `equipment_type` string, nullable: Equipment type, e.g. DRY_VAN, REEFER
    - `preference_level` string, nullable: Preference level, e.g. PREFERRED, PRIMARY
    - `target_line_haul_rate` number, nullable: Line haul rate in dollars
    - `target_fuel_surcharge_rate` number, nullable: Fuel surcharge in dollars
    - `automation_enabled` boolean, nullable: Whether automation is enabled
    - `is_contract` boolean, nullable: Whether this is a contract lane
    - `contract_status` string, nullable: Contract status, e.g. ACTIVE, DRAFT
    - `contract_effective_at` string, nullable: Start date in YYYY-MM-DD format
    - `contract_expires_at` string, nullable: End date in YYYY-MM-DD format
    - `contract_notes` string, nullable: Contract-specific notes
    - `notes` string, nullable: Notes for this lane
  - `existing_availability_items` ExistingAvailabilityItem[], nullable: Current availability rows in the form, sent as context so the AI can modify/add/remove them.
    - `index` integer, required: 1-based availability number in the form
    - `source` string, nullable: Source location, e.g. 'Dallas, Texas, US'
    - `destination` string, nullable: Destination location, e.g. 'Chicago, Illinois, US'
    - `shipping_method` string, nullable: Shipping method, e.g. FTL, LTL
    - `equipment_type` string, nullable: Equipment type, e.g. DRY_VAN, REEFER
    - `recurrence_frequency` string, nullable: Recurrence pattern, e.g. ONCE, WEEKLY_BY_DAY_OF_WEEK
    - `recurrence_interval` integer, nullable: Recurrence interval, e.g. every N weeks
    - `recurrence_start_at` string, nullable: Start date in YYYY-MM-DD format
    - `recurrence_end_at` string, nullable: End date in YYYY-MM-DD format
    - `days_of_week` string[], nullable: Days of week, e.g. ['MONDAY', 'WEDNESDAY']
    - `days_of_week_monthly_occurrences` string[], nullable: Monthly occurrences, e.g. ['FIRST', 'THIRD']
    - `days_of_month` integer[], nullable: Days of month, e.g. [1, 15]
    - `notes` string, nullable: Notes for this availability

## Response `200`

Successful Response

- ParsedCapacityResponse: Response containing parsed capacity data from AI input.
  - `capacity_type` 'lane' | 'availability', required: Type of capacity data extracted
  - `carrier` ParsedCarrierIdentifier: Carrier identifier — name or DOT number.
    - `carrier_name` string, nullable: Carrier company name
    - `dot_number` string, nullable: USDOT number (primary identifier)
  - `lane_items` ParsedLaneData[]: Parsed lane items (one or more lanes).
    - `carrier` ParsedCarrierIdentifier: Carrier identifier — name or DOT number.
      - `carrier_name` string, nullable: Carrier company name
      - `dot_number` string, nullable: USDOT number (primary identifier)
    - `source` union: Source Region (Location or Area)
      - LocationByState: Location by a single state + country.
        - `kind` 'state_only'
        - `state` string, required
        - `country` string
      - LocationByPostalCode: Location by a single full postal/ZIP code + country.
        - `kind` 'postal_code'
        - `postal_code` string, required
        - `country` string
      - LocationByPostalPrefix: Location by a single postal-code prefix + country.
        - `kind` 'postal_prefix'
        - `postal_code_prefix` string, required
        - `country` string
      - LocationByCity: Location by a single city + state + country.
        - `kind` 'city'
        - `city` string, required
        - `state` string, required
        - `country` string
      - LocationByCoordinates: Location by a single lat/long + radius in miles.
        - `kind` 'coordinates'
        - `latitude` number, required
        - `longitude` number, required
        - `radius_miles` number
      - AreaByStates: Area by a list of states + country.
        - `kind` 'area_by_states'
        - `states` string[], required
        - `country` string
      - AreaByPostalCodes: Area by a list of full postal/ZIP codes + country.
        - `kind` 'area_by_postal_codes'
        - `postal_codes` string[], required
        - `country` string
      - AreaByPostalPrefixes: Area by a list of postal-code prefixes + country.
        - `kind` 'area_by_postal_prefixes'
        - `postal_code_prefixes` string[], required
        - `country` string
      - EmptyRegion: No Region specified for this side — user omitted geographic info entirely.
        - `kind` 'empty'
    - `destination` union: Destination Region (Location or Area)
      - LocationByState: Location by a single state + country.
        - `kind` 'state_only'
        - `state` string, required
        - `country` string
      - LocationByPostalCode: Location by a single full postal/ZIP code + country.
        - `kind` 'postal_code'
        - `postal_code` string, required
        - `country` string
      - LocationByPostalPrefix: Location by a single postal-code prefix + country.
        - `kind` 'postal_prefix'
        - `postal_code_prefix` string, required
        - `country` string
      - LocationByCity: Location by a single city + state + country.
        - `kind` 'city'
        - `city` string, required
        - `state` string, required
        - `country` string
      - LocationByCoordinates: Location by a single lat/long + radius in miles.
        - `kind` 'coordinates'
        - `latitude` number, required
        - `longitude` number, required
        - `radius_miles` number
      - AreaByStates: Area by a list of states + country.
        - `kind` 'area_by_states'
        - `states` string[], required
        - `country` string
      - AreaByPostalCodes: Area by a list of full postal/ZIP codes + country.
        - `kind` 'area_by_postal_codes'
        - `postal_codes` string[], required
        - `country` string
      - AreaByPostalPrefixes: Area by a list of postal-code prefixes + country.
        - `kind` 'area_by_postal_prefixes'
        - `postal_code_prefixes` string[], required
        - `country` string
      - EmptyRegion: No Region specified for this side — user omitted geographic info entirely.
        - `kind` 'empty'
    - `shipping_method` string, nullable: Shipping method: FTL, PTL, LTL
    - `equipment_type` string, nullable: Equipment type: DRY_VAN, REEFER, FLATBED, etc.
    - `preference_level` string, nullable: Preference level: PREFERRED, PRIMARY, SECONDARY, BACKUP, EXCLUDED
    - `target_line_haul_rate` number, nullable: Target line haul rate in dollars
    - `target_fuel_surcharge_rate` number, nullable: Target fuel surcharge rate in dollars
    - `automation_enabled` boolean, nullable: Whether automation is enabled
    - `is_contract` boolean, nullable: Whether this is a contract lane
    - `contract_status` string, nullable: Contract status: DRAFT, ACTIVE, PAUSED, EXPIRED
    - `contract_effective_at` string, nullable: Start date in ISO format (YYYY-MM-DD)
    - `contract_expires_at` string, nullable: End date in ISO format (YYYY-MM-DD)
    - `contract_notes` string, nullable: Contract-specific notes
    - `notes` string, nullable: Additional notes extracted from input
  - `availability_items` ParsedAvailabilityData[]: Parsed availability items (one or more availabilities).
    - `carrier` ParsedCarrierIdentifier: Carrier identifier — name or DOT number.
      - `carrier_name` string, nullable: Carrier company name
      - `dot_number` string, nullable: USDOT number (primary identifier)
    - `source` union: Source Region (Location or Area)
      - LocationByState: Location by a single state + country.
        - `kind` 'state_only'
        - `state` string, required
        - `country` string
      - LocationByPostalCode: Location by a single full postal/ZIP code + country.
        - `kind` 'postal_code'
        - `postal_code` string, required
        - `country` string
      - LocationByPostalPrefix: Location by a single postal-code prefix + country.
        - `kind` 'postal_prefix'
        - `postal_code_prefix` string, required
        - `country` string
      - LocationByCity: Location by a single city + state + country.
        - `kind` 'city'
        - `city` string, required
        - `state` string, required
        - `country` string
      - LocationByCoordinates: Location by a single lat/long + radius in miles.
        - `kind` 'coordinates'
        - `latitude` number, required
        - `longitude` number, required
        - `radius_miles` number
      - AreaByStates: Area by a list of states + country.
        - `kind` 'area_by_states'
        - `states` string[], required
        - `country` string
      - AreaByPostalCodes: Area by a list of full postal/ZIP codes + country.
        - `kind` 'area_by_postal_codes'
        - `postal_codes` string[], required
        - `country` string
      - AreaByPostalPrefixes: Area by a list of postal-code prefixes + country.
        - `kind` 'area_by_postal_prefixes'
        - `postal_code_prefixes` string[], required
        - `country` string
      - EmptyRegion: No Region specified for this side — user omitted geographic info entirely.
        - `kind` 'empty'
    - `destination` union: Destination Region (Location or Area)
      - LocationByState: Location by a single state + country.
        - `kind` 'state_only'
        - `state` string, required
        - `country` string
      - LocationByPostalCode: Location by a single full postal/ZIP code + country.
        - `kind` 'postal_code'
        - `postal_code` string, required
        - `country` string
      - LocationByPostalPrefix: Location by a single postal-code prefix + country.
        - `kind` 'postal_prefix'
        - `postal_code_prefix` string, required
        - `country` string
      - LocationByCity: Location by a single city + state + country.
        - `kind` 'city'
        - `city` string, required
        - `state` string, required
        - `country` string
      - LocationByCoordinates: Location by a single lat/long + radius in miles.
        - `kind` 'coordinates'
        - `latitude` number, required
        - `longitude` number, required
        - `radius_miles` number
      - AreaByStates: Area by a list of states + country.
        - `kind` 'area_by_states'
        - `states` string[], required
        - `country` string
      - AreaByPostalCodes: Area by a list of full postal/ZIP codes + country.
        - `kind` 'area_by_postal_codes'
        - `postal_codes` string[], required
        - `country` string
      - AreaByPostalPrefixes: Area by a list of postal-code prefixes + country.
        - `kind` 'area_by_postal_prefixes'
        - `postal_code_prefixes` string[], required
        - `country` string
      - EmptyRegion: No Region specified for this side — user omitted geographic info entirely.
        - `kind` 'empty'
    - `shipping_method` string, nullable: Shipping method: FTL, PTL, LTL
    - `equipment_type` string, nullable: Equipment type: DRY_VAN, REEFER, FLATBED, etc.
    - `recurrence_frequency` string, nullable: Recurrence frequency: ONCE, DAILY, WEEKLY_BY_DAY_OF_WEEK, MONTHLY_BY_DAY_OF_MONTH, MONTHLY_BY_DAY_OF_WEEK_MONTHLY_OCCURRENCE
    - `recurrence_interval` integer, nullable: Recurrence interval (e.g., every N days/weeks)
    - `recurrence_start_at` string, nullable: Start date in ISO format (YYYY-MM-DD)
    - `recurrence_end_at` string, nullable: End date in ISO format (YYYY-MM-DD)
    - `days_of_week` string[], nullable: Days of week: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
    - `days_of_week_monthly_occurrences` string[], nullable: Monthly occurrences: FIRST, SECOND, THIRD, FOURTH, LAST, SECOND_TO_LAST
    - `days_of_month` integer[], nullable: Days of month (1-31)
    - `notes` string, nullable: Additional notes extracted from input
  - `confidence` number, required: Overall confidence score (0-1)
  - `warnings` string[]: Warnings about fields that couldn't be extracted

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mentium/apis/mentium-api.md) - [All operations](https://skmtc.dev/mentium/apis/mentium-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mentium/apis/mentium-api/revisions/b4ed8e59432e?raw)
