URLStasher provides a simple REST API for saving and managing your links programmatically. Perfect for browser extensions, mobile apps, and automation workflows.
All API requests require authentication using session-based auth. You must be logged in to make API requests.
Make sure to include your session cookie in requests:
fetch('/api/links', {
credentials: 'include',
headers: {
'Content-Type': 'application/json'
}
});Fetch all links for the authenticated user.
tagId - Filter by tag IDsearch - Search queryfavorite - Filter favorites (true/false)archived - Filter archived (true/false){
"links": [
{
"id": "clx123abc",
"url": "https://example.com",
"title": "Example Site",
"summary": "A great example website",
"thumbnailUrl": "https://alvarotrigo.com/blog/assets/imgs/2022-08-17/various-thumbnail-of-google-icon.jpeg",
"isFavorite": false,
"isArchived": false,
"createdAt": "2024-01-15T10:30:00.000Z",
"linkTags": [
{
"tag": {
"id": "tag123",
"name": "tech"
}
}
]
}
]
}Save a new link. Automatically extracts title, summary, and thumbnail.
{
"url": "https://example.com",
"title": "Optional custom title",
"summary": "Optional custom summary",
"thumbnailUrl": "Optional custom thumbnail",
"tags": ["tech", "article"]
}fetch('/api/links', {
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com',
tags: ['tech', 'tutorial']
})
});Update a link's properties.
{
"isFavorite": true,
"isArchived": false,
"title": "Updated title",
"tags": ["updated", "tags"]
}Delete a link permanently.
fetch('/api/links/clx123abc', {
method: 'DELETE',
credentials: 'include'
});Fetch all tags for the authenticated user.
{
"tags": [
{
"id": "tag123",
"name": "tech",
"_count": {
"linkTags": 5
}
}
]
}