Skip to main content
POST
/
widget
/
getOrCreateThread
Get or create widget thread
curl --request POST \
  --url http://api.superwize.ai/api/widget/getOrCreateThread \
  --header 'Content-Type: application/json' \
  --data '
{
  "widgetId": "wid_01JHKYX9T3EF123456789"
}
'
{
  "thread": {
    "id": "obj_01JHKZ0PV2WX123456789",
    "widgetId": "wid_01JHKYX9T3EF123456789",
    "userId": "user_01JHKYV8FMS234567890",
    "status": "active",
    "createdAt": "2026-01-01T00:00:00.000Z",
    "updatedAt": "2026-01-01T00:00:00.000Z",
    "messages": [
      {
        "id": "obj_01JHKZ0PV2WX123456789",
        "threadId": "thr_01JHKYY5K4GH123456789",
        "data": {},
        "createdAt": "2026-01-01T00:00:00.000Z"
      }
    ]
  },
  "created": true
}

Body

application/json
widgetId
string
required

Response

Widget thread returned.

thread
object
required
created
boolean
required