REST API

Integrate with our REST API to build custom feedback solutions.

Base URL

https://yoursite.com/api/

Authentication

All API requests require authentication using your project's API key:

Authorization: Bearer YOUR_API_KEY
Get your API key: Find your API key in your project settings in the dashboard.

Submit Feedback

Submit feedback, bug reports, or reviews programmatically.

/api/feedback/submit

Request Body

{
  "type": "feedback", // "feedback" | "bug" | "review"
  "title": "Feature request",
  "description": "Would love to see dark mode",
  "email": "user@example.com", // optional
  "metadata": { // optional
    "url": "https://example.com/page",
    "userAgent": "Mozilla/5.0...",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Response

{
  "success": true,
  "id": "feedback_123",
  "message": "Feedback submitted successfully"
}

Get Feedback

Retrieve feedback for your project.

/api/feedback?projectId=YOUR_PROJECT_ID

Query Parameters

ParameterTypeDescription
projectIdstringYour project ID (required)
typestringFilter by type: feedback, bug, review
limitnumberNumber of items to return (max 100)
offsetnumberPagination offset

Response

{
  "data": [
    {
      "id": "feedback_123",
      "type": "feedback",
      "title": "Feature request",
      "description": "Would love to see dark mode",
      "email": "user@example.com",
      "created_at": "2024-01-15T10:30:00Z",
      "metadata": {
        "url": "https://example.com/page",
        "userAgent": "Mozilla/5.0..."
      }
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}

Error Responses

All errors follow this format:

{
  "success": false,
  "error": "INVALID_PROJECT_ID",
  "message": "The provided project ID is invalid"
}

Common Error Codes

StatusCodeDescription
400VALIDATION_ERRORRequest validation failed
401UNAUTHORIZEDInvalid or missing API key
404INVALID_PROJECT_IDProject not found
429RATE_LIMITEDToo many requests

Rate Limits

Rate Limits: API requests are limited to 1000 requests per hour per API key.

SDKs

We provide official SDKs for popular languages:

  • JavaScript/Node.js: npm install feedbackwidget-js
  • Python: pip install feedbackwidget-python
  • PHP: composer require feedbackwidget/php-sdk