POST /api/groups

create a group for the authenticated user

Success Response Code: 201

Params

Param name Description
group
optional

Value: Must be a Hash
group[name]
required

name of the group


Value: Must be a String
group[description]
optional

description of the group


Value: Must be a String
group[permission_mode]
optional

permission mode of the group (default=public). 'external_contributor' not allowed if external contributor functionality is disabled for the community


Value: Must be one of: <code>external_contributor</code>, <code>private</code>, <code>public</code>.
group[avatars]
optional

urls for various sizes of group avatar pictures


Value: Must be a String
group[allow_access_request]
optional

whether non-members can request membership (not applicable to public groups) (default=false)


Value: Must be a String
group[chat]
optional

whether the group will support chat messages


Value: Must be one of: <code>true</code>, <code>false</code>.
group[post]
optional

whether the group will support post messages


Value: Must be one of: <code>true</code>, <code>false</code>.

Response Fields

id unique ID of the group Integer
name name of the group String
url url to view the group permalink page String
avatars urls for various sizes of group avatar pictures Hash<String, Url>
private whether the group is private Boolean
external_contributor whether the group allows external contributors Boolean
state state of the group (e.g. archived, active) String
permission permission mode of the group (e.g. external_contributor, private, public) String
member_count number of members in the group (returns null if private group that member has not joined) Integer
description group's description String
role_key the current user's role in the group, or null if user is not in group ["admin", "member"]
can_request_membership whether the current user can make a membership request for the group Boolean
can_cancel_membership_request whether the current user can cancel a pending membership request for the group Boolean
can_join whether the current user can join the group Boolean
can_leave whether the current user can leave the group Boolean
chat_enabled whether the group supports chat messages Boolean
post_enabled whether the group supports post messages Boolean

Example Curl Commands

curl -X POST -d "group[name]=Socialcast%20Developers&group[description]=For%20developers%20of%20socialcast" -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/groups.json

Examples

POST /api/groups.json
{
  "group": {
    "allow_access_request": "false",
    "chat": "false",
    "description": "Test description in group",
    "email_on_chat_default": "true",
    "email_on_post_default": "true",
    "external_contributor_group": "false",
    "name": "Test group name",
    "not_in_company_stream": "true",
    "one_to_one_chat_group": "false",
    "permission_mode": "private",
    "post": "true",
    "private": "true",
    "profile_photo_id": "3"
  }
}
201
{
  "group": {
    "id": 12,
    "name": "Test group name",
    "html_name": "Test group name",
    "url": "https://socialcast.socialcast.test/groups/12-testgroupname",
    "type": "Group",
    "avatars": {
      "is_system_default": false,
      "id": 3,
      "square16": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/3/rails_square16.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170722T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=1ddecdc5e092e4764a6cddc8571d9d7623247f10602a8a601a7a7256258caf8e",
      "square30": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/3/rails_square30.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170722T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=b7ff51b77727083d29defba30e394b090d95b4e4202a858f6010efdfede3b718",
      "square45": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/3/rails_square45.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170722T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=241ae616afad10db94cedcc641d84928a4b3a0a5135ffda8a3b61ac389906098",
      "square70": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/3/rails_square70.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170722T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=ef936fe971e749542f75ec006e0ebb6bcf9658d12eaccbcd4e5aab6d5b8d0712",
      "square140": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/3/rails_square140.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170722T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=51b5974bc67da55cc4ab40dac82d34e1c1bf5caf370479acf6bb819006f34c45",
      "original": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/3/rails.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170722T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=908ae9dea532207d010afc559f614ed10851e972490385bb3aafb19a1c0c68b0"
    },
    "username": "Testgroupname",
    "groupname": "Testgroupname",
    "private": true,
    "external_contributor": false,
    "chat_enabled": false,
    "post_enabled": true,
    "activity_url": "https://socialcast.socialcast.test/groups/12-testgroupname/messages_activity",
    "admin_ids": [
      8
    ],
    "description": "Test description in group",
    "state": "active",
    "permission": "private",
    "group_type": "standard",
    "member_count": 0,
    "role_key": "admin",
    "can_request_membership": false,
    "can_cancel_membership_request": false,
    "can_join": false,
    "can_leave": false,
    "can_administer": true,
    "chat_stream_id": null,
    "post_stream_id": 122
  }
}