POST /experiences/{experience_id}/capabilities

Add capabilities to an experience.

Creates sessions for each capability and queues background processing. Returns immediately with PENDING status while processing happens async.

Path parameters

  • experience_id string Required
application/json

Body Required

  • context object | null

    User context shared across all capabilities.

    Contains cart contents, purchase history, and other signals used for personalization.

    Hide context attributes Show context attributes object | null
    • cart object | null

      Container for product selections.

      Partners submit products they want to generate widgets for. Can include items from user's cart, browsing history, or curated selections.

      Hide cart attributes Show cart attributes object | null
      • type string Required

        Values are grocery or fashion.

      • products array[object] Required

        Product in a cart/selection.

        Two modes supported:

        1. Catalog reference (minimal): Only product_id required. Backend hydrates details.
        2. Inline (legacy): Full product details provided directly.

        For catalog-based products (e.g., fashion try-on), provide product_id. Product details are fetched from the catalog database. For inline products (e.g., grocery), provide name and details directly.

        Hide products attributes Show products attributes object
        • productId string | null
        • name string | null
        • brand string | null
        • price number | null
        • category string | null
        • quantity integer

          Default value is 1.

        • size string | null
        • unit string | null
        • barcode string | null
        • organic boolean | null

          Default value is false.

        • glutenFree boolean | null

          Default value is false.

    • trip object | null
      Hide trip attributes Show trip attributes object | null
      • flight object | null
        Hide flight attributes Show flight attributes object | null
        • departureAirport string Required
        • arrivalAirport string Required
        • departureTimestamp integer Required
        • arrivalTimestamp integer Required
        • numTravelers integer Required
        • seatClass string Required

          Values are economy, main, premium, business, or first.

      • cruise object | null
        Hide cruise attributes Show cruise attributes object | null
        • departurePort string Required
        • arrivalPort string Required
        • departureTimestamp integer Required
        • arrivalTimestamp integer Required
        • numTravelers integer Required
    • topic object | null
      Hide topic attributes Show topic attributes object | null
      • topic string Required
      • questions array[string] Required
    • history object | null

      User's purchase/browsing history for personalization.

      Hide history attribute Show history attribute object | null
      • orders array[object]

        A past order from purchase history.

        Two modes supported:

        1. Catalog reference (minimal): Only product_id required. Backend hydrates details.
        2. Inline (legacy): Full product details provided directly.
        Hide orders attributes Show orders attributes object
        • productId string | null
        • name string | null
        • brand string | null
        • category string | null
        • color string | null
        • purchasedAt string | null
  • capabilities array[object] Required

    List of capabilities to add (at least one required)

    At least 1 element.

    One of:

Responses

  • 200 application/json

    Successful Response

    Hide response attributes Show response attributes object
    • experienceId string Required
    • status string Required
    • widgets array[object] Required
      One of:
  • 422 application/json

    Validation Error

    Hide response attribute Show response attribute object
    • detail array[object]
      Hide detail attributes Show detail attributes object
      • loc array[string | integer] Required
      • msg string Required
      • type string Required
POST /experiences/{experience_id}/capabilities
curl \
 --request POST 'http://api.example.com/experiences/{experience_id}/capabilities' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"context":{"cart":{"type":"grocery","products":[{"productId":"string","name":"string","brand":"string","price":42.0,"category":"string","quantity":1,"size":"string","unit":"string","barcode":"string","organic":false,"glutenFree":false}]},"trip":{"flight":{"departureAirport":"string","arrivalAirport":"string","departureTimestamp":42,"arrivalTimestamp":42,"numTravelers":42,"seatClass":"economy"},"cruise":{"departurePort":"string","arrivalPort":"string","departureTimestamp":42,"arrivalTimestamp":42,"numTravelers":42}},"topic":{"topic":"string","questions":["string"]},"history":{"orders":[{"productId":"string","name":"string","brand":"string","category":"string","color":"string","purchasedAt":"string"}]}},"capabilities":[{"type":"catalog_recommendations","config":{"allowedSources":["string"],"blockedSources":["string"],"catalogSlug":"string","maxResults":6,"budgetMax":42.0}}]}'
Request examples
{
  "context": {
    "cart": {
      "type": "grocery",
      "products": [
        {
          "productId": "string",
          "name": "string",
          "brand": "string",
          "price": 42.0,
          "category": "string",
          "quantity": 1,
          "size": "string",
          "unit": "string",
          "barcode": "string",
          "organic": false,
          "glutenFree": false
        }
      ]
    },
    "trip": {
      "flight": {
        "departureAirport": "string",
        "arrivalAirport": "string",
        "departureTimestamp": 42,
        "arrivalTimestamp": 42,
        "numTravelers": 42,
        "seatClass": "economy"
      },
      "cruise": {
        "departurePort": "string",
        "arrivalPort": "string",
        "departureTimestamp": 42,
        "arrivalTimestamp": 42,
        "numTravelers": 42
      }
    },
    "topic": {
      "topic": "string",
      "questions": [
        "string"
      ]
    },
    "history": {
      "orders": [
        {
          "productId": "string",
          "name": "string",
          "brand": "string",
          "category": "string",
          "color": "string",
          "purchasedAt": "string"
        }
      ]
    }
  },
  "capabilities": [
    {
      "type": "catalog_recommendations",
      "config": {
        "allowedSources": [
          "string"
        ],
        "blockedSources": [
          "string"
        ],
        "catalogSlug": "string",
        "maxResults": 6,
        "budgetMax": 42.0
      }
    }
  ]
}
Response examples (200)
{
  "experienceId": "string",
  "status": "string",
  "widgets": [
    {
      "capabilityId": "string",
      "status": "string",
      "currentVersion": 42,
      "heading": "string",
      "errorMessage": "string",
      "type": "restaurants",
      "data": {
        "type": "string",
        "heading": "string",
        "items": [
          {
            "title": "string",
            "description": "string",
            "address": "string",
            "link": "string",
            "imageSearchQuery": "string",
            "imageUrl": "string"
          }
        ]
      }
    }
  ]
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}