REST API Overview

The Feedhog REST API provides server-to-server integration for feedback collection in any programming language.

REST API

The Feedhog REST API allows you to integrate feedback collection from any backend system or programming language.

Base URL

https://feedhog.com/api/v1

Authentication

All API requests require authentication via the x-api-key header:

curl -X GET https://feedhog.com/api/v1/feedback \
  -H "x-api-key: fhpk_your_public_key"

The public API key (starting with fhpk_) can:

  • Submit feedback
  • List feedback
  • Get feedback details
  • Toggle votes
  • Identify users

Quick Start

Submit Feedback

curl -X POST https://feedhog.com/api/v1/feedback \
  -H "Content-Type: application/json" \
  -H "x-api-key: fhpk_your_public_key" \
  -d '{
    "title": "Add dark mode",
    "description": "Would love a dark theme option",
    "type": "idea",
    "endUser": {
      "externalId": "user-123",
      "email": "user@example.com",
      "name": "John Doe"
    }
  }'

List Feedback

curl -X GET "https://feedhog.com/api/v1/feedback?status=planned&sortBy=votes" \
  -H "x-api-key: fhpk_your_public_key"

Identify User

curl -X POST https://feedhog.com/api/v1/identify \
  -H "Content-Type: application/json" \
  -H "x-api-key: fhpk_your_public_key" \
  -d '{
    "externalId": "user-123",
    "email": "user@example.com",
    "name": "John Doe"
  }'

Endpoints Summary

MethodEndpointDescription
POST/api/v1/identifyIdentify or create a user
POST/api/v1/feedbackSubmit new feedback
GET/api/v1/feedbackList feedback with filters
GET/api/v1/feedback/:idGet feedback details
POST/api/v1/feedback/:id/voteToggle vote
GET/api/v1/feedback/:id/voteCheck vote status

Response Format

Success Responses

All successful responses return JSON:

{
  "feedback": { ... },
  "items": [ ... ],
  "user": { ... }
}

Error Responses

Errors include an error field and optional details:

{
  "error": "Invalid input",
  "details": {
    "formErrors": [],
    "fieldErrors": {
      "title": ["Title is required"]
    }
  }
}

HTTP Status Codes

CodeDescription
200Success
201Created (for POST that creates resources)
400Bad Request (validation error)
401Unauthorized (missing or invalid API key)
404Not Found
429Too Many Requests (rate limited)
500Internal Server Error

Rate Limiting

The API is rate limited to prevent abuse:

  • 100 requests per minute per API key
  • Rate limit headers are included in responses

When rate limited, you'll receive a 429 response:

{
  "error": "Too many requests, please slow down"
}

Language Examples

JavaScript/Node.js

const response = await fetch('https://feedhog.com/api/v1/feedback', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'fhpk_your_public_key'
  },
  body: JSON.stringify({
    title: 'Add dark mode',
    type: 'idea'
  })
});

const data = await response.json();
console.log(data.feedback.id);

Python

import requests

response = requests.post(
    'https://feedhog.com/api/v1/feedback',
    headers={
        'Content-Type': 'application/json',
        'x-api-key': 'fhpk_your_public_key'
    },
    json={
        'title': 'Add dark mode',
        'type': 'idea'
    }
)

data = response.json()
print(data['feedback']['id'])

Ruby

require 'net/http'
require 'json'

uri = URI('https://feedhog.com/api/v1/feedback')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['x-api-key'] = 'fhpk_your_public_key'
request.body = { title: 'Add dark mode', type: 'idea' }.to_json

response = http.request(request)
data = JSON.parse(response.body)
puts data['feedback']['id']

PHP

<?php
$data = json_encode([
    'title' => 'Add dark mode',
    'type' => 'idea'
]);

$options = [
    'http' => [
        'method' => 'POST',
        'header' => [
            'Content-Type: application/json',
            'x-api-key: fhpk_your_public_key'
        ],
        'content' => $data
    ]
];

$context = stream_context_create($options);
$response = file_get_contents('https://feedhog.com/api/v1/feedback', false, $context);
$result = json_decode($response, true);
echo $result['feedback']['id'];

Go

package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    body := map[string]string{
        "title": "Add dark mode",
        "type":  "idea",
    }
    jsonBody, _ := json.Marshal(body)

    req, _ := http.NewRequest("POST", "https://feedhog.com/api/v1/feedback", bytes.NewBuffer(jsonBody))
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("x-api-key", "fhpk_your_public_key")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var result map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&result)
}

Next Steps

See the complete API Reference for detailed endpoint documentation.