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

# Create Transport Config

> Create a reusable transport configuration template with optional legs.

## Method

`POST` `/v1/products/:id/transport/configs`

## Path Parameters

<ParamField path="id" type="uuid">Product ID that will own the transport config.</ParamField>

## Body Parameters

<ParamField name="key" type="string" required>Unique identifier for the config (per product).</ParamField>
<ParamField name="name" type="string" required>Human-readable name.</ParamField>
<ParamField name="description" type="string">Optional description shown in the dashboard.</ParamField>
<ParamField name="legs" type="array">Optional array of leg definitions applied when the config is used.</ParamField>

<Expandable title="Leg object">
  <ParamField name="legs[].seq" type="integer">Ordering of the leg (defaults to array order).</ParamField>
  <ParamField name="legs[].mode_id" type="uuid" required>Transport mode ID (e.g., `mode_bus`, `mode_flight`).</ParamField>
  <ParamField name="legs[].operator_org_id" type="uuid">Provider organization ID (required for non-air modes).</ParamField>
  <ParamField name="legs[].from_place_id" type="string">Google Place ID for the origin.</ParamField>
  <ParamField name="legs[].to_place_id" type="string">Google Place ID for the destination.</ParamField>
  <ParamField name="legs[].airline_code" type="string">IATA airline code (air legs only).</ParamField>
  <ParamField name="legs[].flight_number" type="string">Flight number.</ParamField>
  <ParamField name="legs[].cabin_class" type="string">Cabin class label.</ParamField>
  <ParamField name="legs[].fare_class_code" type="string">Fare class code.</ParamField>
  <ParamField name="legs[].duration_minutes" type="integer">Duration in minutes.</ParamField>
  <ParamField name="legs[].luggage" type="object">JSON object describing luggage allowances.</ParamField>
</Expandable>

## Headers

<ParamField header="Authorization" type="string">Bearer token (requires `products:write`).</ParamField>
<ParamField header="content-type" type="string">`application/json`</ParamField>

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.voyantcloud.com/v1/products/prod_123/transport/configs" \
    -H "Authorization: Bearer $VOYANT_API_KEY" \
    -H "content-type: application/json" \
    -d '{
      "key": "default-coach",
      "name": "Coach transfer",
      "description": "Coach transfer between airport and hotel",
      "legs": [
        {
          "mode_id": "mode_bus",
          "operator_org_id": "org_transport",
          "from_place_id": "ChIJ8UNwppk4j4ARzWPaN9xq_9o",
          "to_place_id": "ChIJGaK-SZcYtUYR0Y1DSXB6QrM",
          "duration_minutes": 45,
          "luggage": { "checked_bag": 1 }
        }
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://api.voyantcloud.com/v1/products/prod_123/transport/configs", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.VOYANT_API_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({
      key: "default-coach",
      name: "Coach transfer",
      legs: [{ mode_id: "mode_bus", operator_org_id: "org_transport" }],
    }),
  })
  const payload = await res.json()
  ```

  ```python Python theme={null}
  import os, requests

  payload = {
    "key": "default-coach",
    "name": "Coach transfer",
    "legs": [
      {
        "mode_id": "mode_bus",
        "operator_org_id": "org_transport",
        "duration_minutes": 45
      }
    ]
  }

  resp = requests.post(
    "https://api.voyantcloud.com/v1/products/prod_123/transport/configs",
    headers={
      "Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}",
      "content-type": "application/json",
    },
    json=payload,
  )
  data = resp.json()
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "item": {
      "id": "cfg_001",
      "product_id": "prod_123",
      "key": "default-coach",
      "name": "Coach transfer",
      "description": "Coach transfer between airport and hotel",
      "created_at": "2025-01-05T10:22:41.000Z",
      "updated_at": "2025-01-05T10:22:41.000Z"
    }
  }
  ```
</ResponseExample>

<Tip>
  Config keys must be unique per product. Attempting to reuse a key returns `409 Conflict`.
</Tip>
