Skip to main content

Groups

Overview

Groups are the standard form of interacting within the Cotalker environment and are primarily accessed through the Main Menu Bar and Group Panel.

Group types:

  • Standard groups contain channels used for communicating with other users.
  • Workflow or Task groups, like standard groups, have communication channels but are associated with workflow tasks and their states.
  • Link groups direct you to anywhere within or outside the Cotalker environment.
  • Category groups bring together other groups to form sub-menus on the Main Menu Bar.

Get Groups

Returns all channels within the company.

GET /groups

Endpoint URL

https://www.cotalker.com/api/v2/groups

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Query Parameters

ParameterDescriptionTypeRequiredNotes
createdReturns groups with the indicated creation date in the createdAt field.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_gtReturns groups created after the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_gteReturns groups with a value in the createdAt field equal to or greater than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_ltReturns groups created before the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_lteReturns groups with a value in the createdAt field equal to or less than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
countAdds the counter field with the total amount of groups within the company.booleanOptional
groupTypeReturns groups specified by type.stringOptionalAvailable values: link (link groups), task (workflow or task groups), and channel (standard groups)
hasCatergoriesFilters category groups, i.e., groups displayed in sub-menus on the Main Menu Bar.booleanOptionaltrue displays categorized groups. false displays uncategorized groups.
isActiveReturns groups according to their isActive status.stringOptionalOptions are: all, true, false
isLinkReturns all link groups found in the company.booleanOptional
isTaskGroupReturns all task groups found in the company.booleanOptional
debugAdds the debug field with error notifications.stringOptionalOption: true
limitLimits the amount of groups returned in the response.numberOptionalBy default, the limit is set to 10.
modifiedReturns groups with the indicated modification date in the modifiedAt field.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modified_gtReturns groups modified after the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modified_gteReturns groups with a value in the modifiedAt field equal to or greater than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
orderByOrders the groups by ascendeing or descending order according to their modifiedAt field.stringOptionalOptions: asc, desc
pageMakes the response display data from the indicated page number.numberOptionalBest used in combination with the "limit" parameter.
sortBySorts groups in the response according to the modifiedAt field.stringOptionalmodifiedAt is the only value available.
searchReturns groups that match the keywords in the groups.search field array.stringOptional

Request Samples

This default request gets all the groups in the company.

curl --location --request GET 'https://www.cotalker.com/api/v2/groups' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Sample

Responses follow the COTGroup data model.


Get a Group by Id

Returns the group indicated by the Id.

GET /groups/{id}

Endpoint URL

https://www.cotalker.com/api/v2/groups/{id}

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the group that is to be returned.ObjectId<COTGroup>Required

Headers

HeaderDescriptionRequiredValues
AdminGrants access to request the endpoint.Requiredtrue
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Query Parameters

ParameterDescriptionTypeRequiredNotes
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Sample

curl --location --request GET 'https://www.cotalker.com/api/v2/groups/618a9a1c881d93046349c820' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Sample

The response follows the COTGroup data model.


Create a New Group

Creates a new group within the company.

POST /groups

Endpoint URL

https://www.cotalker.com/api/v2/groups

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN
AdminGrants administrative access to create a group.Requiredtrue
Content-TypeIndicates the body's format.Requiredapplication/json

Query Parameters

ParameterDescriptionTypeRequiredNotes
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Body

Only required fields are listed below. For a complete schema description, please go to the COTGroup data model. Unrequired fields that are not submitted are either filled in automatically or left blank.

ElementDescriptionTypeRequiredNotes
nameDisplayThe Group name users will see on the platform.stringRequired
nameCodeThe group's unique identification name.stringRequiredMaximum 60 characters; only lowercase letters, numbers, and underscores allowed; must be unique.

Request Sample

Channel created with the minimum required fields:

curl --location --request POST 'https://www.cotalker.com/api/v2/groups' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"nameDisplay": "The Best Group Ever!",
"nameCode": "best_group"
}'

Response Sample

Go to COTGroup for a complete description of the response.

{
"apperance": {
"textColor": "#ffffff"
},
"image": {
"icon": "https://placeholdit.imgix.net/~text?txtsize=50&bg=ffeeeetxtclr=bbcccc&txt=i%20CoTalker&w=20&h=20"
},
"createChannels": {
"requiredPermission": [],
"requiredPermissionsV2": [],
},
"link": {
"requiredPermission": [],
"requiredPermissionsV2": []
},
"isActive": true,
"color": "#000000",
"search": [
"the",
"best",
"group",
"ever"
],
"hideChannelsByProperties": [],
"channelsWithoutCategoryLocation": "top",
"groupSort": "a-z",
"groupSortDirection": "asc",
"innerSort": "lastMessage",
"innerSortDirection": "desc",
"_id": "619e51fee8b60a63b678aa94",
"nameDisplay": "The Best Group Ever!",
"nameCode": "best_group",
"company": "619e51f3e7e198f18fe56a01",
"createdAt": "2021-11-24T14:11:26.195Z",
"actions": [],
"modifiedAt": "2021-11-24T14:11:26.199Z",
"weight": 135,
"__v": 0
}

Update a Group

Updates or edits an existing channel's information.

PATCH /groups/{id}

Endpoint URL

https://www.cotalker.com/api/v2/groups/{id}

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the group that is to be modified.ObjectId<COTGroup>Required

Headers

HeaderDescriptionRequiredValues
AdminGrants administrative access to modify a group.Requiredtrue
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN
Content-TypeSets the body's format.Requiredapplication/json

Query Parameters

ParameterDescriptionTypeRequiredNotes
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Body

Only the fields that are being updated or added are required to be put into the body. For a complete schema description, please go to the COTGroup data model.

Request Sample

Updating a group's channel creation settings:

curl --location --request PATCH 'https://www.cotalker.com/api/v2/groups/619e51fee8b60a63b678aa94' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"createChannels": {
"active": true,
"requiredPermissionsV2": [
"admin-groups-write"
]
}
}'

Response Sample

Go to COTGroup for a complete description of the response.

{
"apperance": {
"textColor": "#ffffff"
},
"image": {
"icon": "https://placeholdit.imgix.net/~text?txtsize=50&bg=ffeeeetxtclr=bbcccc&txt=i%20CoTalker&w=20&h=20"
},
"createChannels": {
"requiredPermission": [],
"requiredPermissionsV2": [
"admin-groups-write"
],
"active": true
},
"link": {
"requiredPermission": [],
"requiredPermissionsV2": []
},
"isActive": true,
"color": "#000000",
"search": [
"the",
"best",
"group",
"ever"
],
"hideChannelsByProperties": [],
"channelsWithoutCategoryLocation": "top",
"groupSort": "a-z",
"groupSortDirection": "asc",
"innerSort": "lastMessage",
"innerSortDirection": "desc",
"_id": "619e51fee8b60a63b678aa94",
"nameDisplay": "The Best Group Ever!",
"nameCode": "best_group",
"company": "619e51f3e7e198f18fe56a01",
"createdAt": "2021-11-24T14:11:26.195Z",
"actions": [],
"modifiedAt": "2021-11-24T14:11:26.199Z",
"weight": 135,
"__v": 0
}