PUT /api/groups/:group_id

update a group for the authenticated user

Warning:

When converting a public or private group to an external group, all linked projects and challenges will be removed from the group.

Success Response Code: 200

Params

Param name Description
group_id
required

id of the group


Value: Must be a Integer
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

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"]
rule_managed whether the group membership is auto-managed using membership rules Boolean
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 PUT -d "group[description]=For%20developers%20of%20Socialcast" -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/groups/12.json

Examples

PUT /api/groups/2.json
{
  "group": {
    "allow_access_request": "false",
    "description": "Test changed description -- http://socialcast.com",
    "email_on_chat_default": "true",
    "email_on_post_default": "true",
    "name": "test&grøup2changed",
    "not_in_company_stream": "true",
    "permission_mode": "public",
    "private": "false",
    "profile_photo_id": "2"
  }
}
200
{
  "group": {
    "id": 2,
    "name": "test&grøup2changed",
    "html_name": "test&amp;grøup2changed",
    "url": "https://socialcast.socialcast.test/groups/2-testgr%C3%B8up2changed",
    "type": "Group",
    "avatars": {
      "is_system_default": false,
      "id": 2,
      "square16": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/2/rails_square16.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170917T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=930f70b7b044271c1e0a7ce8032b60f945f041493b865f799b545b2b40a2714b",
      "square30": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/2/rails_square30.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170917T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=bea3bb6afa6620bb1c02dcf798bd31ce1868e7fdf1a0fd364114be0aadd2cbec",
      "square45": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/2/rails_square45.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170917T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=bcabdf5cc158d95cd3e5ed47244d8272a92afaf0fd8336950487fead73befdea",
      "square70": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/2/rails_square70.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170917T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=284e2aae95f466df59681aa11688354aa4b3cdf37e3bbfc993d54cd6db4ec655",
      "square140": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/2/rails_square140.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170917T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=7d5223befd21841b3b01695b43bd359e1dffa25c91be6c433f714c5c1033a651",
      "original": "https://s3.amazonaws.com/socialcast_test/tenants/1/profile_photos/2/rails.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=stubbed-akid%2F20170917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170917T234500Z&X-Amz-Expires=518400&X-Amz-SignedHeaders=host&X-Amz-Signature=108658ae3f266c33acbc74683d80b4ae27a5169fc100d1c2c3fe8cf21e2a35b9"
    },
    "username": "testgrøup2changed",
    "groupname": "testgrøup2changed",
    "private": false,
    "external_contributor": false,
    "chat_enabled": false,
    "post_enabled": true,
    "activity_url": "https://socialcast.socialcast.test/groups/2-testgr%C3%B8up2changed/messages_activity",
    "admin_ids": [
      11
    ],
    "description": "Test changed description -- http://socialcast.com",
    "html_description": "<div class=\"markdown-body\"><p>Test changed description -- <a href=\"http://socialcast.com\" title=\"http://socialcast.com\">http://socialcast.com</a></p></div>",
    "state": "active",
    "permission": "public",
    "group_type": "standard",
    "member_count": 2,
    "role_key": null,
    "rule_managed": false,
    "can_request_membership": false,
    "can_cancel_membership_request": false,
    "can_join": true,
    "can_leave": false,
    "can_administer": true,
    "chat_stream_id": null,
    "post_stream_id": null
  }
}