curl --request POST \
--url https://api.example.com/api/projects \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"color": "<string>"
}
'{
"id": 123,
"name": "<string>",
"color": "<string>",
"userId": 123
}Create a new project for the authenticated user
curl --request POST \
--url https://api.example.com/api/projects \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"color": "<string>"
}
'{
"id": 123,
"name": "<string>",
"color": "<string>",
"userId": 123
}curl -X POST https://api.example.com/api/projects \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"name": "Website Redesign",
"color": "#3b82f6"
}'
{
"id": 1,
"name": "Website Redesign",
"color": "#3b82f6",
"userId": 123
}
{
"error": "Validation Failed",
"message": "name: must not be blank"
}
{
"error": "Unauthorized",
"message": "Invalid or missing authentication token"
}