Skip to main content
POST
/
api
/
projects
Create Project
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
}
Creates a new project and associates it with the authenticated user.

Authentication

Requires Bearer token authentication.

Request Body

name
string
required
The name of the project (max 100 characters, cannot be blank)
color
string
The color code for the project in hex format (max 7 characters, e.g., #3b82f6). Defaults to #8b949e if not provided.

Response

id
integer
required
The unique identifier for the newly created project
name
string
required
The name of the project
color
string
required
The color code for the project
userId
integer
required
The ID of the user who owns the project

Example Request

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"
  }'

Example Response

{
  "id": 1,
  "name": "Website Redesign",
  "color": "#3b82f6",
  "userId": 123
}

Error Responses

400 Bad Request
Validation failed for the request body
{
  "error": "Validation Failed",
  "message": "name: must not be blank"
}
401 Unauthorized
Authentication token is missing or invalid
{
  "error": "Unauthorized",
  "message": "Invalid or missing authentication token"
}

Build docs developers (and LLMs) love