Skip to main content

Endpoint

group.create
Creates a new group for organizing bookmarks.

Authentication

Requires authentication via session cookie.

Request

Response

Returns the created group object.
id
string
required
Unique identifier for the created group
name
string
required
Group name
color
string
required
Hex color code for the group
userId
string
required
ID of the user who owns the group
createdAt
date
required
Timestamp when the group was created
updatedAt
date
required
Timestamp when the group was last updated

Example

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

const group = await client.group.create({
  name: "Development Resources",
  color: "#3b82f6"
});

console.log(group);
// {
//   id: "grp_123",
//   name: "Development Resources",
//   color: "#3b82f6",
//   userId: "usr_456",
//   createdAt: Date,
//   updatedAt: Date
// }

Schema

const createGroupSchema = z.object({
  name: z.string(),
  color: z.string(),
});

Source

  • Schema: lib/schema.ts:107
  • Implementation: server/procedures/bookmarks.ts:149
  • Router: server/router.ts:39