POST
/
api
/
v1
/
sdk
/
suggestions
Create Suggestion
curl --request POST \
  --url https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "<string>",
  "description": "<string>",
  "userId": "<string>",
  "labelId": "<string>"
}'
Create a new suggestion in your project. This endpoint allows users to submit feature requests, bug reports, or improvement ideas.
title
string
required
Clear, concise suggestion title (minimum 1 character)
description
string
required
Detailed description of the suggestion (minimum 1 character)
userId
string
required
ID of the user creating the suggestion (must be valid CUID). This is the user ID of the user who is creating the suggestion.
labelId
string
ID of label to assign to this suggestion

Response Fields

FieldTypeRequiredDescription
idstringYesUnique suggestion identifier (auto-generated)
titlestringYesSuggestion title
descriptionstringYesSuggestion description
statusstringYesCurrent status (PENDING by default)
userIdstringNoID of the user who created the suggestion
projectIdstringYesProject this suggestion belongs to
labelobjectNoLabel information (id, name, color)
voteCountnumberYesNumber of votes (0 for new suggestions)
hasUserVotedbooleanNoWhether creator has voted (false by default)
sumValuenumberYesTotal monetary value from votes (0 initially)
createdAtstringYesCreation timestamp (ISO 8601)
updatedAtstringYesLast update timestamp (ISO 8601)

Example Request

{
  "title": "Add keyboard shortcuts",
  "description": "It would be great to have keyboard shortcuts for common actions like creating new items (Cmd+N) and searching (Cmd+K)",
  "userId": "clm7x1a2b000008l7h3k1b2c3",
}

Example Response

{
  "id": "clm7x1a2b000008l7h3k1b2c3",
  "title": "Add keyboard shortcuts",
  "description": "It would be great to have keyboard shortcuts for common actions like creating new items (Cmd+N) and searching (Cmd+K)",
  "status": "PENDING",
  "userId": "clm7x1a2b000008l7h3k1b2c3",
  "projectId": "clm7x1a2b000008l7h3k1b2c3",
  "label": null,
  "voteCount": 0,
  "hasUserVoted": false,
  "sumValue": 0,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}

Error Responses

Status CodeDescriptionExample Response
400Bad request - Missing required fields{"error": "Title and description are required"}
401Unauthorized - Invalid API key{"error": "Unauthorized"}
500Internal server error{"error": "Failed to create suggestion"}