Create Suggestion
curl --request POST \
--url https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"userId": "<string>",
"labelId": "<string>"
}
'import requests
url = "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions"
payload = {
"title": "<string>",
"description": "<string>",
"userId": "<string>",
"labelId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
userId: '<string>',
labelId: '<string>'
})
};
fetch('https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'userId' => '<string>',
'labelId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"userId\": \"<string>\",\n \"labelId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"userId\": \"<string>\",\n \"labelId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"userId\": \"<string>\",\n \"labelId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySuggestions
Create Suggestion
Create a new suggestion in your project
POST
/
api
/
v1
/
sdk
/
suggestions
Create Suggestion
curl --request POST \
--url https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"userId": "<string>",
"labelId": "<string>"
}
'import requests
url = "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions"
payload = {
"title": "<string>",
"description": "<string>",
"userId": "<string>",
"labelId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
userId: '<string>',
labelId: '<string>'
})
};
fetch('https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'userId' => '<string>',
'labelId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"userId\": \"<string>\",\n \"labelId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"userId\": \"<string>\",\n \"labelId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"userId\": \"<string>\",\n \"labelId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCreate a new suggestion in your project. This endpoint allows users to submit feature requests, bug reports, or improvement ideas.
string
required
Clear, concise suggestion title (minimum 1 character)
string
required
Detailed description of the suggestion (minimum 1 character)
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.
string
ID of label to assign to this suggestion
Response Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Unique suggestion identifier (auto-generated) |
| title | string | Yes | Suggestion title |
| description | string | Yes | Suggestion description |
| status | string | Yes | Current status (PENDING by default) |
| userId | string | No | ID of the user who created the suggestion |
| projectId | string | Yes | Project this suggestion belongs to |
| label | object | No | Label information (id, name, color) |
| voteCount | number | Yes | Number of votes (0 for new suggestions) |
| hasUserVoted | boolean | No | Whether creator has voted (false by default) |
| sumValue | number | Yes | Total monetary value from votes (0 initially) |
| createdAt | string | Yes | Creation timestamp (ISO 8601) |
| updatedAt | string | Yes | Last 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 Code | Description | Example Response |
|---|---|---|
| 400 | Bad request - Missing required fields | {"error": "Title and description are required"} |
| 401 | Unauthorized - Invalid API key | {"error": "Unauthorized"} |
| 500 | Internal server error | {"error": "Failed to create suggestion"} |
Was this page helpful?
⌘I