Constraints, Rate limits and Errors

Constraints, Rate limits and Errors:

Properties and Constraints:

API Keys: Properties and Constraints

ItemProperty or ConstraintNotes
API Keys100 characters (UTF8mb4 Characters)This covers all the languages and even emojis. (One emoji uses two characters).
Maximum number of APIs keys that can be created for an app25

Users and Groups: Properties and Constraints

ItemProperty or ConstraintNotes
Character limits for UIDs and GUIDs100 characters
Maximum users in a group (v3)100000
Maximum groups a user can be a part of2000
Maximum number of friends for a user1000
Maximum tokens for a userNo limits
Maximum Number of Bot users that can be created25
Maximum number of groupsNo limits
Maximum number of unread messages per userNo limits
Maximum number of users that can be created for an appNo limits
User and Group ID100 characters, alpha-dash (a-z, 0-9 with -and _) without spaces .CometChat forces the UID to all lowercase.
User and Group name100 characters, UTF8mb4 setThis covers all the languages and even emojis.
User and Group avatarMust be a URL, limit of 3000 charactersCometChat doesn’t save the image on its servers.. There is no limit on the image resolution. It depends on the implementation.
User profileMust be a URL, limit of 3000 charactersSame as above
User and Group metadataThe API limit for the POST request length is 10 KB. Hence, the user’s metadata information must fit in the same limit and must not exceed 5 KB.
User and Group tagA user can have up to 25 tags with 100 characters per tag. The tags can be in any language. The character set must be UTF8mb4
Group passwordString up to 100 characters
Group description255 characters, UTF8mb4 set
Maximum active presence subscriptionsThe presence subscription will be active until 1000 users are online for a single app. if more than 1000 users go online, the presence notification starting from the 1001st user will not be sent to other users.Note, this is the higher limit applicable across subscription for friends, users with certain roles and all users
Typing indicators for groupsTyping indicator will be sent for a group of up to 1000 online users.
Unread message counts for groupsFor a group with more than 300 members, the conversations and unread message counts are not updated.
Delivery and read receipts for groupsDelivery and read receipts will be sent for a group of up to 300 online users.

Roles: Properties and Constraints

ItemProperty or ConstraintNotes
Maximum number of Roles that can be createdMaximum 25
Role UID100 characters, alpha-dash (a-z, 0-9 with -and _) without spacesCometChat forces the UID to lowercase.
Role name100 characters, UTF8mb4This covers all the languages and even emojis.
Role description255 characters, UTF8mb4 set, any language.
MetadataNo limit

Messages: Properties and Constraints

ItemProperty or ConstraintNotes
Maximum file attachment size100 MB per messageIncludes not just the file size but entire POST body (including chat text and custom data)
Message data (Applicable for API calls)Data is an arbitrary JSON structure. It accepts utf8mb4. It can have any user defined properties. but the below properties have meaning for CometChat: text, attachments, custom_data, metadata.
Note: The attachment size is separate. Here, the attachment is only the attachment properties (such as URL, size, etc.). The size must not exceed 65KB for the data object and 5kb for the metadata object.
Message tagsA message can have up to 25 tags with 100 characters per tag. The tags can be in any language. The character set must be UTF8mb4.
User and Group conversation tagsA conversation can have up to 25 tags with 100 characters per tag. The tags can be in any language. The character set must be UTF8mb4.
Does CometChat keep soft deleted messages in its database?Yes

Calling: Properties and Constraints

ItemProperty or ConstraintNotes
Maximum users in a call50
Default frame rate for video calls30 FPS
Resolution for video callsMaximum - 720p, Minimum - 180pThis depends on the layout selected and the bandwidth available at the user’s end
Media encryption usedSRTP
Audio codec usedOPUS
Video codec usedH.264

Rate Limits:

Groups

  1. GUID must be less than 64 characters & must be alpha-numeric-dash.
  2. Groups (with all features) can be as large as 300 members.
  3. Groups (without delivery & read receipts & typing indicators) can be as large as 50,000 members and can have up to 10,000 concurrent members.

Users

  1. UID must be less than 64 characters & must be alpha-numeric-dash.
  2. A user can have up to 500 friends.
  3. Presence subscription for all users is limited to 1000 users.

Messages

  1. Messages must be less than 2048 characters.

Voice & Video Calling

  1. Up to 4 users can participate in a single voice or video call.

API

  1. API calls for core operations are rate limited to 10000 requests per min. Core operations include user connection, create/delete user, create/join group cumulatively.
  2. API calls for standard operations are rate limited to 20000 requests per min. Standard operations include all other operations cumulatively.

Bots

  1. UID must be less than 50 characters.

Webhooks

  1. id must be less than 50 characters & must be alpha-numeric-dash.

Errors:

Error CodeError Description
Auth Errors
AUTH_ERR_EMPTY_APPIDIndicates empty appId in the headers.
AUTH_ERR_INVALID_APPIDIndicates invalid appId or it does not exist in a region.
AUTH_ERR_EMPTY_APIKEYIndicates empty API Key in the headers.
AUTH_ERR_APIKEY_NOT_FOUNDIndicates incorrect API Key in the headers.
AUTH_ERR_NO_ACCESSIndicates API Key in the headers can not be used to perform the action.

For example, the API key with authOnly scope cannot be used to create a user.
AUTH_ERR_EMPTY_AUTH_TOKENIndicates empty auth token in the headers.
AUTH_ERR_AUTH_TOKEN_NOT_FOUNDIndicates incorrect auth token.
ERR_AUTH_TOKENS_NOT_FOUNDIndicates that no authentication tokens exist for the provided UID. This usually happens after you have flushed all the tokens.
API Key Errors
ERR_APIKEY_NOT_FOUNDIndicates that the api key does not exists.
ERR_APIKEY_NO_SELF_ACTIONIndicates that the API key in the headers is same as the API key in the path param and it is performing action on it self.
The API Key should not update/delete itself.
Auth Token Errors
ERR_AUTH_TOKEN_NOT_FOUNDIndicates that the auth token does not exists.
ERR_AUTH_TOKEN_DELETE_FAILEDIndicates that the API failed to delete the auth token.
ERR_AUTH_TOKENS_DELETE_FAILEDIndicates that the API failed to delete the auth tokens associated with the UID
ERR_AUTHTOKEN_UNAVAILABLEIndicates that the auth token is mapped with another device.
ERR_AUTHTOKEN_NOT_ACCESSIBLEIndicates that the auth token is mapped with another user.
Subscription Errors
ERR_PLAN_RESTRICTIONIndicates that the feature is not available with the plan.
ERR_SUBSCRIPTION_EXPIREDIndicates that the subscription has expired and must resubscribe to continue using the service.
ERR_PLAN_QUOTA_RESTRICTIONIndicates that the allowed limit for the feature has reached.
Role Errors
ERR_ROLE_NOT_FOUNDIndicates that the role does not exist.
ERR_ROLE_DELETE_FAILEDIndicates that the API failed to delete the role.
ERR_ROLE_DELETE_DENIEDIndicates that the API cannot delete the role as the default role can not be deleted.
User Errors
ERR_UID_NOT_FOUNDIndicates any one of the following:

1. UID does not exist.
2. User is soft deleted.
ERR_UID_ALREADY_EXISTSIndicates that the User associated with the UID already exists.
ERR_UID_DELETE_FAILEDIndicates that the API failed to delete the user.
ERR_FRIEND_LIMIT_EXCEEDEDindicates that the maximum number of friends for the user with the provided UID exceeds the allowed limit.
Bots Errors
ERR_BOT_NOT_FOUNDIndicates that a bot is not associated with the UID.
ERR_BOT_ALREADY_EXISTSIndicates that a bot is already associated with the UID.
Group Errors
ERR_GUID_NOT_FOUNDIndicates that the GUID does not exist.
ERR_GUID_ALREADY_EXISTSThis indicates that the provided GUID already exists in our system.
ERR_EMPTY_GROUP_PASSIndicates one from the below:

1. Empty password for password type group to create group API.
2. Empty password for pasword type group to join group API.
ERR_GROUP_DELETE_FAILEDIndicates that the API failed to delete the group.
ERR_NOT_A_MEMBERIndicates that the user is not a member of the group.
ERR_WRONG_GROUP_PASSIndicates password mismatch for the password type group.
ERR_ALREADY_JOINEDIndicates that the user has already joined the group.
ERR_GROUP_NOT_JOINEDIndicates that the user is trying to access the group feature without joining it.
ERR_GROUP_JOIN_NOT_ALLOWEDIndicates that the user is trying to join the private group.
ERR_JOINED_GROUP_LIMIT_EXCEEDEDIndicates that the joined group limit for the user with the provided UID exceeds the allowed maximum group limit.
ERR_MEMBER_DELETE_FAILEDIndicates that the API has failed to remove a user from the group.
ERR_NO_VACANCYIndicates that the group is full.
ERR_SAME_SCOPEIndicates that the existing and new scope are same.
ERR_MEMBER_SCOPE_CHANGE_FAILEDIndicates that the has failed to change the scope.
ERR_NOT_A_BANNED_USERIndicates that the API is trying to unban non-banned user.
ERR_BANNED_GROUPMEMBERIndicates that the banned user is trying to access the group features.
ERR_ALREADY_BANNEDIndicates that the API is trying to ban an already banned user.
ERR_MEMBER_BAN_FAILEDIndicates that the API has failed to ban a user from the group.
ERR_MEMBER_UNBAN_FAILEDIndicates that the API has failed to unban a user for the group.
ERR_GROUP_NO_CLEARANCEIndicates that the user does not have permission to perform the action in the group.
For example, user with participant scope can not kick users with admin or moderator scope.
ERR_GROUP_NO_ADMIN_SCOPEIndicates that the user does not have admin scope in the group.
ERR_GROUP_NO_MODERATOR_SCOPEIndicates that the user does not have moderator scope in the group.
ERR_GROUP_NO_SCOPE_CLEARANCEIndicates that the user does not have permission to change scope of other user.
ERR_GROUP_NO_SELF_ACTIONIndicates that the user is not allowed to perform action on himself.
For example, changing his own scope.
ERR_GROUP_OWNER_DEMOTE_FORBIDDENIndicates that the user with provided UID does not have enough clearance to perform the specified action.
ERR_OWNER_EXIT_FORBIDDENIndicates that the owner with the provided UID cannot leave the group with the provided GUID. Kindly transfer ownership before leaving the group.
Message Errors
ERR_EMPTY_RECEIVERIndicates that the receiver cannot be empty.
ERR_INVALID_RECEIVER_TYPEIndicates that the invalid receiver type.
ERR_CONVERSATION_NOT_FOUNDIndicates that the conversation id does not exists.
ERR_CONVERSATION_NOT_ACCESSIBLEIndicates that the conversation id not accessible to the user.

1. A user can access his own one-to-one conversations.
2. A user can access the group conversations if he is member of the group.
ERR_CONVERSATION_MISMATCHIndicates that the message with the provided message ID does not belong to the conversation with the provided conversation ID.
ERR_USER_MESSAGE_DELETE_FAILEDIndicates that the API has failed to delete a one-to-one message.
ERR_MESSAGE_ID_NOT_FOUNDIndicates that the message does not exist.
ERR_INVALID_MESSAGE_DATAIndicates invalid message body.
ERR_EMPTY_MESSAGE_TEXTIndicates empty messages text for a text message.
ERR_INVALID_MESSAGE_TEXTIndicates that the message text should be string.
ERR_EMPTY_MESSAGE_CATEGORYIndicates message category cannot be empty.
ERR_INVALID_MESSAGE_CATEGORYIndicates invalid message category.
ERR_EMPTY_MESSAGE_TYPEIndicates message type cannot be empty.
ERR_INVALID_MESSAGE_TYPEIndicates invalid message type.
ERR_EMPTY_MESSAGE_FILEIndicates empty FILE for the media message.
ERR_MESSAGE_NOT_A_SENDERIndicates that only sender can edit/delete the message.
ERR_MESSAGE_NOT_A_RECEIVER indicates that the user with the provided UID is not a recipient of the message with the provided message ID.
ERR_MESSAGE_NO_ACCESSIndicates user does not have access to the message.

1. For one-to-one message user should either be sender or receiver of the message.
2. For group message user should be the member of the group.
ERR_MESSAGE_ACTION_NOT_ALLOWEDIndicates that the message can not be edited or deleted.
For example, Action messages cannot be edited or deleted by the API.
ERR_EMPTY_CUSTOM_DATAIndicates data.customData can not be empty for custom message.
ERR_INVALID_MEDIA_MESSAGEIndicates invalid media message.
ERR_INVALID_CUSTOM_DATAIndicates invalid data.customData. The customData should be valid JSON.
ERR_INVALID_METADATAIndicates invalid data.metadata. The metadata should be valid JSON.
ERR_WRONG_MESSAGE_THREADIndicates conversation mismatch for parent and a new threaded message.
ERR_MESSAGE_THREAD_NESTINGIndicates nested message threading.
ERR_WRONG_MESSAGE_THREAD_CATEGORYIndicates conversation mismatch for parent and a new threaded message.
ERR_ROLE_ACCESS_DENIEDIndicates that the operation is restricted by role-based access control.
ERR_MESSAGE_MENTIONS_LIMIT_EXCEEDEDIndicates that you have exceeded the limit of mentions per message.
ERR_INVALID_CATEGORYIndicates that the selected category is invalid.
ERR_MESSAGE_REACTION_ALREADY_ADDEDIndicates that the user with the provided UID has already reacted with the provided reaction to the message with the provided ID.
ERR_MESSAGE_REACTION_NOT_FOUNDIndicates that the the provided reaction ID for the message with the provided message ID is missing from the user with the provided UID.
Calling Errors
ERR_CALLING_SELFIndicates user is initiating call with himself.
ERR_CALL_BUSY_SELFIndicates initiator of the call is participant of another ongoing call.
ERR_CALL_BUSY_GROUPIndicates that for a group call, the group has and existing ongoing call.
ERR_CALL_BUSY_USERIndicates that the recipient of the call is already busy on another call.
ERR_EMPTY_CALL_SESSION_IDIndicates empty session id.
ERR_CALL_SESSION_NOT_FOUNDIndicates that the call does not exist.
ERR_CALL_TERMINATEDIndicates that a call is terminated.
The error response is generated when a user tries to update the status of an ended call.
ERR_CALL_GROUP_ALREADY_JOINEDIndicates that the user is already a member of the group call.
ERR_CALL_GROUP_ALREADY_LEFTIndicates that the user trying to leave the group call has already left the call.
ERR_CALL_INVALID_INITIndicates that call status cannot be updated to initiated.
ERR_CALL_USER_ALREADY_JOINEDIndicates that the one-to-one call was already joined by the recipient of the call.
ERR_CALL_GROUP_INVALID_STATUSIndicates invalid call status for a group call.

For example, group call cannot have a busy status.
ERR_CALL_ONGOING_TO_INVALIDIndicates updating invalid status for an ongoing call.

For example, ongoing call can not become a busy call.
ERR_CALL_NOT_A_PARTIndicates that the user is not part of the call.

For example, a third user tries to join a one-to-one call.
ERR_CALL_EMPTY_JOINED_ATIndicates that the joinedAt body param is required to join a group.
ERR_CALL_NOT_STARTEDIndicates that status of call cannot be changed from initiated to ended directly.
Friends Errors
ERR_ALREADY_FRIENDIndicates that the users are already friends.
ERR_NOT_A_FRIENDIndicates unfriending non-friended users.
ERR_CANNOT_FORM_SELF_RELATIONIndicates user cannot friend himself.
ERR_FAILED_TO_ADD_FRIENDIndicates that the API has failed to add friend.
Block Users Errors
ERR_CANNOT_BLOCK_SELFIndicates that user cannot block himself.
ERR_BLOCKED_RECEIVERIndicates user has blocked the receiver of the message/call.
ERR_BLOCKED_SENDERIndicates that the iniator of the call is blocked by the recipient.
Extension Errors
ERR_EXTENSION_NOT_FOUNDIndicates extension does not exist.
ERR_BLOCKED_BY_EXTENSIONIndicates that the message is blocked by the extension.

For example, human moderation extension can block the message sending.
Webhook Errors
ERR_WEBHOOK_NOT_FOUNDIndicates that the webhook does not exist.
ERR_BLOCKED_BY_WEBHOOKIndicates that the message is blocked by the extension.
ERR_TRIGGER_NOT_FOUNDIndicates trigger does not exist.
General Errors
ERR_INVALID_API_VERSIONIndicates invalid API version.
ERR_API_NOT_FOUNDIndicates one from the list below:

1. API endpoint does not exist.
2. The endpoint does not use HTTP request method using which API is called.
ERR_MISSION_FAILEDIndicates one from the list below:

1. Fatal error.
2. Database Connection Timeout.
ERR_BAD_REQUESTIndicates the failed validations for the body params.
ERR_OPERATION_FAILEDIndicates database operation failure.
ERR_EXCEPTIONIndicates incorrectly/poorly handled exception.
ERR_TOO_MANY_REQUESTSIndicates rate limiting.
ERR_BAD_ERROR_RESPONSEIndicates one from the list below:

1. The API developer has used unknown error code.
2. The API developer hasn't reassigned the error code.
ERR_SERVICE_TIMEOUTIndicates that the intermediate service timed out while fetching or processing the request.
Websocket Errors
ERR_WS_INIT_FAILEDIndicates failure at Web Socket Server.
ERR_WS_APP_INIT_FAILEDIndicates App creation failure at Web Socket Server.
ERR_WS_APP_DESTROY_FAILEDIndicates App delete failure at Web Socket Server.
ERR_WS_ROLE_CREATION_FAILEDIndicates role creation failure at Web Socket Server.
ERR_WS_ROLE_DELETION_FAILEDIndicates role deletion failure at Web Socket Server.
ERR_WS_USER_CREATION_FAILEDIndicates user creation failure at Web Socket Server.
ERR_WS_USER_UPDATION_FAILEDIndicates user updation failure at Web Socket Server.
ERR_WS_GROUP_CREATION_FAILEDIndicates group creation failure at Web Socket Server.
ERR_WS_GROUP_DELETION_FAILEDIndicates group deletion failure at Web Socket Server.
ERR_WS_GROUP_JOIN_FAILEDIndicates group member join failure at Web Socket Server.