Skip to main content
PATCH
/
api
/
notes
/
:id
/
unarchive
Unarchive Note
curl --request PATCH \
  --url https://arfan-notes.val.run/api/notes/:id/unarchive
{
  "id": 23,
  "title": "Advanced CSS Techniques",
  "content": "Modern CSS techniques including Grid, Flexbox, and custom properties...",
  "category": "css",
  "group": "first",
  "color": "primary",
  "archived": false,
  "createdAt": "2024-01-25T14:30:00Z",
  "updatedAt": "2024-01-25T18:45:00Z"
}

Unarchive Note

Restore an archived note by setting its archived status to false. This makes the note visible in regular views again.

Path Parameters

id
integer
required
The unique identifier of the note to unarchive

Examples

curl -X PATCH "https://arfan-notes.val.run/api/notes/23/unarchive" \
  -H "Content-Type: application/json"

Response

{
  "id": 23,
  "title": "Advanced CSS Techniques",
  "content": "Modern CSS techniques including Grid, Flexbox, and custom properties...",
  "category": "css",
  "group": "first",
  "color": "primary",
  "archived": false,
  "createdAt": "2024-01-25T14:30:00Z",
  "updatedAt": "2024-01-25T18:45:00Z"
}

Behavior

  • Sets the archived field to false
  • Updates the updatedAt timestamp
  • Returns the complete updated note object
  • Unarchived notes will appear in regular note listings

Use Cases

  • Content Recovery: Restore accidentally archived notes
  • Workflow Management: Reactivate notes that are relevant again
  • Content Management: Bring back historical notes for reference
  • Mistake Correction: Undo archiving operations

Workflow Example

// Check if a note is archived before unarchiving
const noteId = 23;

// First, get the note to check its status
const checkResponse = await fetch(`https://arfan-notes.val.run/api/notes?id=${noteId}`);
const notes = await checkResponse.json();

if (notes.length > 0 && notes[0].archived) {
  // Note is archived, so we can unarchive it
  const unarchiveResponse = await fetch(`https://arfan-notes.val.run/api/notes/${noteId}/unarchive`, {
    method: 'PATCH',
    headers: { 'Content-Type': 'application/json' }
  });
  
  const unarchivedNote = await unarchiveResponse.json();
  console.log('Note unarchived:', unarchivedNote);
} else {
  console.log('Note is not archived or does not exist');
}
I