POST /experiences/{experience_id}/capabilities/{capability_id}/refine

Refine a capability with user feedback.

Uses optimistic locking - client must provide expected_version. Returns 409 Conflict if version mismatch or refinement already in progress.

Path parameters

  • experience_id string Required
  • capability_id string Required
application/json

Body Required

  • type string Required

    Capability type for validation

  • expectedVersion integer Required

    Optimistic lock version

  • prompt string | null
  • accept array[string]

    Item IDs to accept

  • reject array[string]

    Item IDs to reject

  • filters object

    Additional filters

    Additional properties are allowed.

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/{capability_id}/refine
curl \
 --request POST 'http://api.example.com/experiences/{experience_id}/capabilities/{capability_id}/refine' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"type":"string","expectedVersion":42,"prompt":"string","accept":["string"],"reject":["string"],"filters":{}}'
Request examples
{
  "type": "string",
  "expectedVersion": 42,
  "prompt": "string",
  "accept": [
    "string"
  ],
  "reject": [
    "string"
  ],
  "filters": {}
}
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"
    }
  ]
}