Skip to main content
PUT
/
api
/
notes
/
:id
{
  "id": 23,
  "title": "Advanced CSS and Flexbox Techniques",
  "content": "Comprehensive guide to modern CSS layout techniques including Grid, Flexbox, and responsive design patterns.",
  "color": "success"
}
{
  "id": 23,
  "title": "Advanced CSS and Flexbox Techniques",
  "content": "Comprehensive guide to modern CSS layout techniques including Grid, Flexbox, and responsive design patterns.",
  "category": "css",
  "group": "first",
  "color": "success",
  "archived": false,
  "createdAt": "2024-01-25T14:30:00Z",
  "updatedAt": "2024-01-25T16:45:00Z"
}

Update Note

Update an existing note by providing its ID and the fields you want to modify. All fields except ID are optional.

Path Parameters

id
integer
required
The unique identifier of the note to update

Request Body

id
integer
required
The ID of the note (must match the path parameter)
title
string
The new title of the note
content
string
The new content/body of the note
category
string
New category classification. Valid values: css, val-town, prompts, notes, chat-gpt, cursor-chats, bash-commands
group
string
New group classification. Valid values: first, second, third, fourth, fifth
color
string
New visual color coding. Valid values: primary, secondary, accent, neutral, info, success, warning, error

Examples

curl -X PUT "https://arfan-notes.val.run/api/notes/23" \
  -H "Content-Type: application/json" \
  -d '{
    "id": 23,
    "title": "Updated CSS Techniques"
  }'

Request Example

{
  "id": 23,
  "title": "Advanced CSS and Flexbox Techniques",
  "content": "Comprehensive guide to modern CSS layout techniques including Grid, Flexbox, and responsive design patterns.",
  "color": "success"
}

Response

{
  "id": 23,
  "title": "Advanced CSS and Flexbox Techniques",
  "content": "Comprehensive guide to modern CSS layout techniques including Grid, Flexbox, and responsive design patterns.",
  "category": "css",
  "group": "first",
  "color": "success",
  "archived": false,
  "createdAt": "2024-01-25T14:30:00Z",
  "updatedAt": "2024-01-25T16:45:00Z"
}

Important Notes

  • The id field in the request body must match the id in the URL path
  • Only provided fields will be updated; other fields remain unchanged
  • The updatedAt timestamp will be automatically updated
  • The archived status cannot be changed through this endpoint (use archive/unarchive endpoints)

Validation Rules

  • id: Must be a valid integer and match an existing note
  • title: If provided, must be a non-empty string
  • content: If provided, must be a non-empty string
  • category: If provided, must be one of the valid category values
  • group: If provided, must be one of the valid group values
  • color: If provided, must be one of the valid color values
I