Groups

Overview

Central to the main use cases of Kwil, the Groups functionality allows users to create their own organizations within a data-moat. This is very effective for organizing moats based on topic of discussion, and allows users to curate their own feeds with only topics that are pertinent to them.

Groups can be made either public or private. In a public group, any user can join and post, while moderators can edit group data, rules, and events. In a private group, only moderators can post to the feed.

Creating A Group

To create a group, you must send a POST request to the /createGroup endpoint. Groups are unique to the moat that they exist on, so it is recommended to first check if the group exists (otherwise it will be rejected):

curl https://demo.kwil.xyz/{GROUP_NAME}/ifGroupExists
curl -d {data} -X POST https://demo.kwil.xyz/createGroup

Data:

{
    data: {
        groupName: GROUP_NAME,
        public: BOOLEAN,
        description: SOME_GROUP_DESCRIPTION,
        tags: [GROUP_TAGS],
        photoHash: PHOTO_HASH,
        bannerHash: BANNER_HASH,
        links: [LINKS],
        rules: [RULES],
        color: SOME_HEX_COLOR,
        timestamp: DATE_OBJECT,
        username: USERNAME,
        moderators: [USERNAME],
    },
    photo: BASE64_IMG_DATA,
    banner: BASE64_IMG_DATA,
    signature: sign(data) 
}

Last updated