Widgets API

Create and manage embeddable feedback widgets programmatically.

GET/api/widgets

List all widgets

Returns a list of all widgets for the authenticated user.

Response

JSON
[
  {
    "id": "widget_abc123",
    "title": "Quick Feedback",
    "widget_type": "feedback",
    "published": true,
    "created_at": "2025-01-15T10:30:00Z"
  }
]
POST/api/widgets

Create a widget

Creates a new widget. Requires Pro or Business subscription.

Request body

JSON
{
  "widget_type": "feedback",
  "title": "Quick Feedback",
  "questions": [
    {
      "id": "rating",
      "type": "star_rating",
      "title": "How would you rate your experience?",
      "required": true
    }
  ],
  "trigger_config": {
    "position": "bottom-right",
    "icon": "chat",
    "text": "Feedback",
    "showText": true,
    "color": "#000000",
    "textColor": "#ffffff",
    "triggerMode": "click_toggle"
  },
  "thank_you_title": "Thank you!",
  "thank_you_message": "Your feedback helps us improve."
}

Response

JSON
{
  "id": "widget_abc123",
  "title": "Quick Feedback",
  "widget_type": "feedback",
  "published": false,
  "created_at": "2025-01-15T10:30:00Z"
}
GET/api/widgets/:id

Get a widget

Returns widget configuration. Published widgets are publicly accessible.

Response

JSON
{
  "id": "widget_abc123",
  "title": "Quick Feedback",
  "widget_type": "feedback",
  "questions": [...],
  "trigger_config": {...},
  "display_rules": {...},
  "theme": {...},
  "thank_you_title": "Thank you!",
  "thank_you_message": "Your feedback helps us improve.",
  "published": true
}
POST/api/widgets/:id/submit

Submit widget response

Submit a response to a published widget. No authentication required.

Request body

JSON
{
  "answers": {
    "rating": 5,
    "comment": "Great experience!"
  },
  "metadata": {
    "page_url": "https://example.com/pricing",
    "referrer": "https://google.com"
  }
}

Response

JSON
{ "success": true }
PUT/api/widgets/:id

Update a widget

Update widget configuration.

Request body

JSON
{
  "title": "Updated Feedback Widget",
  "published": true
}

Response

JSON
{
  "id": "widget_abc123",
  "title": "Updated Feedback Widget",
  "published": true,
  "updated_at": "2025-01-15T11:00:00Z"
}
DELETE/api/widgets/:id

Delete a widget

Permanently deletes a widget and all its responses.

Response

JSON
{ "success": true }

Widget types

feedbackStar rating + optional comment
nps0-10 NPS scale with follow-up
contactEmail + message fields
bug_reportDescription + severity
customBuild your own