Skip to main content
POST
/
api
/
notes
{
  "title": "Advanced CSS Techniques",
  "content": "Modern CSS techniques including Grid, Flexbox, and custom properties. These tools allow developers to create responsive and beautiful layouts with minimal code.",
  "category": "css",
  "group": "first",
  "color": "primary"
}
{
  "id": 23,
  "title": "Advanced CSS Techniques",
  "content": "Modern CSS techniques including Grid, Flexbox, and custom properties. These tools allow developers to create responsive and beautiful layouts with minimal code.",
  "category": "css",
  "group": "first",
  "color": "primary",
  "archived": false,
  "createdAt": "2024-01-25T14:30:00Z",
  "updatedAt": "2024-01-25T14:30:00Z"
}

Create Note

Create a new note by providing the required fields. All fields are mandatory for creating a note.

Request Body

title
string
required
The title of the note
content
string
required
The main content/body of the note
category
string
required
Category classification. Valid values: css, val-town, prompts, notes, chat-gpt, cursor-chats, bash-commands
group
string
required
Group classification. Valid values: first, second, third, fourth, fifth
color
string
required
Visual color coding. Valid values: primary, secondary, accent, neutral, info, success, warning, error

Examples

curl -X POST "https://arfan-notes.val.run/api/notes" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Advanced CSS Techniques",
    "content": "Modern CSS techniques including Grid, Flexbox, and custom properties...",
    "category": "css",
    "group": "first",
    "color": "primary"
  }'

Request Example

{
  "title": "Advanced CSS Techniques",
  "content": "Modern CSS techniques including Grid, Flexbox, and custom properties. These tools allow developers to create responsive and beautiful layouts with minimal code.",
  "category": "css",
  "group": "first",
  "color": "primary"
}

Response

{
  "id": 23,
  "title": "Advanced CSS Techniques",
  "content": "Modern CSS techniques including Grid, Flexbox, and custom properties. These tools allow developers to create responsive and beautiful layouts with minimal code.",
  "category": "css",
  "group": "first",
  "color": "primary",
  "archived": false,
  "createdAt": "2024-01-25T14:30:00Z",
  "updatedAt": "2024-01-25T14:30:00Z"
}

Validation Rules

  • title: Must be a non-empty string
  • content: Must be a non-empty string
  • category: Must be one of the valid category values
  • group: Must be one of the valid group values
  • color: Must be one of the valid color values

Response Fields

The response includes all the provided fields plus:
  • id: Auto-generated unique identifier
  • archived: Defaults to false for new notes
  • createdAt: Timestamp when the note was created
  • updatedAt: Timestamp when the note was last updated (same as createdAt for new notes)
I