Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

If you want to associate friends with your users, you must handle friend management in your app.
Once two users are friends (i.e. they have accepted each other as friends), then you can associate them as friends in CometChat.

Available operations

MethodEndpointDescription
POST/users/{uid}/friendsAdd friends for a user
GET/users/{uid}/friendsList all friends of a user
DELETE/users/{uid}/friendsRemove friends from a user

Friend properties

The following table lists the properties that the Friends API supports
ParametersTypeDescription
acceptedarray of strings(optional) Indicates an array of UIDs that are to be made friends. Maximum of 25 users can be passed in the accepted array.

Error handling

Error CodeDescription
AUTH_ERR_EMPTY_APIKEYAPI key is missing from the request headers
AUTH_ERR_APIKEY_NOT_FOUNDThe provided API key is invalid
ERR_UID_NOT_FOUNDThe specified user UID does not exist
For the complete list of error codes, see Error Guide.