GET
/
api
/
v1
/
sdk
/
suggestions
Get Suggestions
curl --request GET \
  --url https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions \
  --header 'Authorization: Bearer <token>'
Retrieve all suggestions from your project. This endpoint returns a paginated list of all suggestions with vote counts and status information.
userId
string
required
ID of user who created this suggestion (CUID format, e.g., clm7x1a2b000008l7h3k1b2c3)
status
string
default:"IN_PROGRESS"
required
Status of suggestion (PENDING, PLANNED, IN_PROGRESS, COMPLETED, CLOSED) (default: IN_PROGRESS)
limit
number
Number of suggestions to return (1-100, default: 20)
offset
number
Number of suggestions to skip (default: 0)

Response Fields

Returns an object with suggestions array and pagination info:
FieldTypeRequiredDescription
suggestionsarrayYesArray of suggestion objects
pagination.limitnumberYesNumber of suggestions returned
pagination.offsetnumberYesNumber of suggestions skipped
pagination.totalnumberYesTotal number of suggestions
pagination.hasMorebooleanYesWhether there are more suggestions

Suggestion Object Fields

FieldTypeRequiredDescription
idstringYesUnique suggestion identifier
titlestringYesSuggestion title
descriptionstringYesSuggestion description
statusstringYesStatus (PENDING, PLANNED, IN_PROGRESS, COMPLETED, CLOSED)
projectIdstringYesProject this suggestion belongs to
labelobjectNoLabel information (id, name, color)
voteCountnumberYesTotal number of votes
hasUserVotedbooleanYesWhether the user has voted for this suggestion
createdAtstringYesCreation timestamp (ISO 8601)
updatedAtstringYesLast update timestamp (ISO 8601)

Example Request

GET /api/v1/sdk/suggestions?limit=10&offset=0

Example Response

{
  "suggestions": [
    {
      "id": "clm7x1a2b000008l7h3k1b2c3",
      "title": "Add dark mode",
      "description": "Please add dark mode support for better user experience",
      "status": "PENDING",
      "projectId": "clm7x1a2b000008l7h3k1b2c3",
      "label": null,
      "voteCount": 15,
      "hasUserVoted": true,
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "pagination": {
    "limit": 10,
    "offset": 0,
    "total": 23,
    "hasMore": true
  }
}

Error Responses

Status CodeDescriptionExample Response
400Bad request - Invalid parameters{"error": "limit must be between 1 and 100"}
401Unauthorized - Invalid API key{"error": "Unauthorized"}
500Internal server error{"error": "Failed to get suggestions"}