Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ephraimduncan/minimal.so/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

client.bookmark.update(input)
Defined in: server/procedures/bookmarks.ts:97

Authentication

This endpoint requires authentication. See Authentication for details.

Request

id
string
required
ID of the bookmark to update
title
string
Updated display title
url
string
Updated URL (for link-type bookmarks)
type
'link' | 'color' | 'text'
Updated bookmark type
color
string
Updated color value
groupId
string
Move the bookmark to a different group. When moving groups, the bookmark’s isPublic status is automatically reset to null.

Input Schema

{
  id: string;
  title?: string;
  url?: string;
  type?: 'link' | 'color' | 'text';
  color?: string;
  groupId?: string;
}
Defined in lib/schema.ts:98.

Response

Returns the updated bookmark object.
id
string
required
The bookmark ID
title
string
required
Updated title
url
string | null
Updated URL
favicon
string | null
Favicon URL (unchanged by update)
type
'link' | 'color' | 'text'
required
Bookmark type
color
string | null
Color value
groupId
string
required
Group ID (possibly updated)
isPublic
boolean | null
Public visibility status (reset to null when moved to a different group)
userId
string
required
Owner’s user ID
createdAt
Date
required
Original creation timestamp
updatedAt
Date
required
Updated timestamp (automatically set to current time)

Examples

Update Bookmark Title

import { orpc } from '@/lib/orpc';

function EditBookmark({ bookmarkId }: { bookmarkId: string }) {
  const updateMutation = orpc.bookmark.update.useMutation();

  const handleUpdate = async (newTitle: string) => {
    await updateMutation.mutateAsync({
      id: bookmarkId,
      title: newTitle,
    });
  };

  return (
    <input
      onChange={(e) => handleUpdate(e.target.value)}
      placeholder="Bookmark title"
    />
  );
}

Move Bookmark to Different Group

import { client } from '@/lib/orpc';

const bookmark = await client.bookmark.update({
  id: 'clx123456',
  groupId: 'clx789012', // Move to new group
});

// Note: isPublic is automatically reset to null
console.log(bookmark.isPublic); // null

Update Multiple Properties

import { serverClient } from '@/lib/orpc.server';

const updated = await serverClient.bookmark.update({
  id: 'clx123456',
  title: 'Updated Title',
  type: 'color',
  color: '#FF5733',
});

Behavior

Partial Updates

Only the fields provided in the input are updated. Other fields remain unchanged:
// Only updates the title
await client.bookmark.update({
  id: 'clx123456',
  title: 'New Title',
});

Group Ownership Verification

When updating the groupId, the target group must exist and belong to the authenticated user. From server/procedures/bookmarks.ts:103:
if (data.groupId) {
  await assertGroupOwnership(data.groupId, context.user.id);
  // ...
}

Visibility Reset on Group Change

When moving a bookmark to a different group, the isPublic status is automatically reset to prevent visibility inheritance:
const existing = await db.bookmark.findFirst({
  where: { id, userId: context.user.id },
  select: { groupId: true },
});
if (existing && existing.groupId !== data.groupId) {
  updateData.isPublic = null;
}
This ensures that public/private settings don’t carry over when organizing bookmarks.

Automatic Timestamp Update

The updatedAt field is automatically set to the current timestamp on every update.

Implementation

From server/procedures/bookmarks.ts:97:
export const updateBookmark = authed
  .input(updateBookmarkSchema)
  .handler(async ({ context, input }) => {
    const { id, ...data } = input;
    const updateData: Record<string, unknown> = { ...data };

    if (data.groupId) {
      await assertGroupOwnership(data.groupId, context.user.id);
      const existing = await db.bookmark.findFirst({
        where: { id, userId: context.user.id },
        select: { groupId: true },
      });
      if (existing && existing.groupId !== data.groupId) {
        updateData.isPublic = null;
      }
    }

    const bookmark = await db.bookmark.update({
      where: { id, userId: context.user.id },
      data: updateData,
    });
    return bookmark;
  });

Errors

NOT_FOUND
error
The bookmark with the specified id does not exist or does not belong to the authenticated user. Also thrown if the target groupId is invalid.
UNAUTHORIZED
error
User is not authenticated.

Notes

  • Updates are automatically scoped to the authenticated user via the where clause
  • Updating the URL does not trigger metadata refetching (use the refetch endpoint for that)
  • All fields except id are optional
  • The update is atomic and transactional

Build docs developers (and LLMs) love