Skip to main content

Error codes

This page introduces the error codes and error messages that might be returned by the SDK when you call the Chat APIs.

Possible reasons for the errors are given to assist you in debugging. If you receive an error code not included here, Agora recommends you contact support@agora.io so that the technical support team can help resolve the issue.

The error codes and error messages might be returned in the following ways:

  • The return value when a method call fails.
  • The error code reported through the onError callback.
Error codeError messagePossible reason
0EM_NO_ERRORNone
1GENERAL_ERRORThe SDK has not been successfully initialized, or the specified reason for the error is not identified when you request the server. You can try reinitializing the SDK.
2NETWORK_ERRORDisconnections between the SDK and the server happen due to the network problems.
4EXCEED_SERVICE_LIMITThe service limit is exceeded, for example, the total number of the registered users or their friends exceeds the plan limit.
100INVALID_APP_KEYThe App Key is invalid. Log in again using a valid App Key.
101INVALID_USER_NAMEThe user ID is empty, or the format of the parameter is incorrect. Use a valid user ID.
102INVALID_PASSWORDThe password entered to log in is empty or incorrect. Log in again using the correct password.
104INVALID_TOKENThe token entered to log in is empty or incorrect. Log in again using the correct token.
200USER_ALREADY_LOGINThe user has already logged in. Do not log in repeatedly.
201USER_NOT_LOGINThe user has not logged in when the method is called. Please check the your code logic.
202USER_AUTHENTICATION_FAILEDThe user authentication fails. Check whether the token has expired.
203USER_ALREADY_EXISTA user with the same user ID is already logged in. Do not register repeatedly.
204USER_NOT_FOUNDThe user is not registered when the method is called. Register before doing any other operation.
205USER_ILLEGAL_ARGUMENTAn invalid parameter is used when you call the method. For example, invalid characters are found in the specified user ID. Reset the parameter.
206USER_LOGIN_ANOTHER_DEVICEIf the user does not enable multi-device login, the user is forced to log out when logging in at another device, and the SDK returns this error code.
207USER_REMOVEDWhen the logged in user ID is deleted by the server, the SDK returns this error code.
208USER_REG_FAILEDWhen you call the server registration method, the parameter passed is empty or invalid. See User registration RESTful API.
209PUSH_UPDATECONFIGS_FAILEDThe update push configuration fails. Update the nickname and the Do Not Disturb mode. Try calling the method again.
210USER_PERMISSION_DENIEDThe user has no permission to operate. Check whether the user is banned. If the user is banned, unban the user and log in again.
213USER_BIND_ANOTHER_DEVICEIf the user sets the device login priority, that is, to log in at the device with higher priority, when the logged in user tries logging in at another device, the login fails, and the SDK returns this error code.
214USER_LOGIN_TOO_MANY_DEVICESIf a user ID has logged in at four devices, when the user tries logging in at a fifth device, the SDK returns this error code. If you want a user to log in at more than four devices, contact support@agora.io.
215USER_MUTEDIf the user is muted in the group or the chatroom, when the user sends a message, the SDK returns this error code.
216USER_KICKED_BY_CHANGE_PASSWORDIf the logged in user changes the present password, the SDK kicks the user out and returns this error code.
217USER_KICKED_BY_OTHER_DEVICEWhen the multi-device login function is enabled, if the user forces the user ID logged in at the current device to log out by calling APIs or managing the backend at another device, the SDK returns this error code.
221USER_NOT_FRIENDWhen a peer user sets not to receive messages from a user that is not a contact, if you send a message to this peer user, the SDK reports this error code. You can enable this service on Agora Console.
300SERVER_NOT_REACHABLEThe SDK disconnects from the Chat system due to network problems. Try again later.
301SERVER_TIMEOUTSome API calls require the SDK to return the execution result. This error occurs if the SDK takes too long (more than 30 seconds) to return the result.
302SERVER_BUSYThe server is currently busy. Try again later.
303SERVER_UNKNOWN_ERRORThis common error occurs when the requesting service fails. Check the log for troubleshooting.
304SERVER_GET_DNSLIST_FAILEDThe SDK fails in getting the configuration of the server that the app currently runs on. Try calling the method again.
305SERVER_SERVICE_RESTRICTEDIf the app is banned, the SDK returns this error code when the methods are called.
400FILE_NOT_FOUNDWhen the user is unable to get the log file or download the attachment, the SDK returns this error code.
401FILE_INVALIDWhen the uploaded message attachment or the shared file in the group is invalid, the SDK returns this error code.
402FILE_UPLOAD_FAILEDWhen the message attachment cannot be uploaded, the SDK returns this error code. Try uploading again.
403FILE_UPLOAD_FAILEDWhen the message attachment cannot be downloaded, the SDK returns this error code. Try downloading again.
404FILE_DELETE_FAILEDWhen getting the log file, the SDK deletes the old log file. If the old log files cannot be deleted, the SDK returns this error code.
405FILE_TOO_LARGEWhen the size of the message attachment or the group shared file exceeds the limit, the SDK returns this error code. Adjust the file size, and try uploading again.
500MESSAGE_INVALIDThe content of the message to be sent is empty, the message ID is empty, or the user ID of the sender is not the user ID that is currently logged in. Check the problems, and try sending the message again.
502MESSAGE_SEND_TRAFFIC_LIMITThe message-sending frequency is too high or the message size is too large. Agora recommends reducing the sending frequency or the message size.
504MESSAGE_RECALL_TIME_LIMITWhen a timeout occurs during message recall, the SDK returns this error code.
505SERVICE_NOT_ENABLEDWhen you try using a service that is not enabled, the SDK returns this error code.
506MESSAGE_EXPIREDIf you send a group receipt after the time limit (the default is three days), the SDK returns this error code.
507MESSAGE_ILLEGAL_WHITELISTIf all members are banned in the group or chat room and the user ID is not included in the allow list, when this user tries sending a message, the SDK returns this error code.
600GROUP_INVALID_IDWhen you call the methods related to the group and the group ID provided is invalid, the SDK returns this error code.
601GROUP_ALREADY_JOINEDWhen you call the group joining method, if the user has already joined the group, the SDK returns this error code.
602GROUP_NOT_JOINEDWhen you try sending messages or controlling a group that you have not joined, the SDK returns this error code.
603GROUP_PERMISSION_DENIEDThe user does not have permission to control the group, for example the group members do not have permission to set the group administrator. Check whether the user has administrator permissions.
604GROUP_MEMBERS_FULLThe number of the group members has reached the limit.
605GROUP_NOT_EXISTWhen you try controlling a group that does not exist, the SDK returns this error code.
700CHATROOM_INVALID_IDWhen you call the methods related to the chatroom and the chatroom ID provided is empty, the SDK returns this error code.
701CHATROOM_ALREADY_JOINEDWhen you call the chatroom-joining method, if the user has already joined the chatroom, the SDK returns this error code.
702CHATROOM_NOT_JOINEDWhen you try sending messages or controlling a chatroom that you have not joined, the SDK returns this error code.
703CHATROOM_PERMISSION_DENIEDThe user does not have permission to control the chatroom, for example, the chatroom members do not have permission to set the chatroom administrator. Check whether the user has administrator permissions.
704CHATROOM_MEMBERS_FULLThe number of the chatroom members has reached the limit.
705CHATROOM_NOT_EXISTWhen you try controlling a chatroom that does not exist, the SDK returns this error code.
900USERINFO_USERCOUNT_EXCEEDThe number of users from whom you request to retrieve the attributes exceeds the limit of 100.
901USERINFO_DATALENGTH_EXCEEDThe size of user attributes exceeds the limit, either individually or collectively. The size of attributes from each user cannot exceed 2 KB. The size of attributes from all users in an app cannot exceed 10 GB.
903TRANSLATE_INVALID_PARAMSThe parameters you pass in when calling APIs of the translation service are invalid.
904TRANSLATE_FAILThe request to translate fails.
905TRANSLATE_NOT_INITThe translation service has not been initialized.
1000CONTACT_ADD_FAILEDThe request to add a contact fails.
1001CONTACT_REACH_LIMITYou cannot add a contact because the number of your contacts has reached the limit.
1002CONTACT_REACH_LIMIT_PEERYou cannot add a contact because the number of peer contacts has reached the limit.
1100PRESENCE_PARAM_LENGTH_EXCEEDThe length of the parameters you pass in when calling APIs of the presence service exceed the limit.
1110TRANSLATE_PARAM_INVALIDThe parameters you pass in when calling APIs of the translation service are invalid.
1111TRANSLATE_SERVICE_NOT_ENABLEThe translation service has not been activated.
1112TRANSLATE_USAGE_LIMITThe usage of the translation service exceeds the limit.
1113TRANSLATE_MESSAGE_FAILThe request to retrieve the translation service fails.
1200MODERATION_FAILEDThe third-party content moderation service of Chat rates the message as "Reject".
1299THIRD_SERVER_FAILEDAnother service rather than the third-party content moderation service of Chat rates the message as "Reject".
1300REACTION_REACH_LIMITThe number of reactions exceeds the limit.
1301REACTION_HAS_BEEN_OPERATEDThe reaction to add already exists in your reaction list.
1302REACTION_OPERATION_IS_ILLEGALYou do not have the permission to perform that operation to a reaction. For example, you cannot delete a reaction if the reaction does not exist in your reaction list.
1400THREAD_NOT_EXISTThe thread does not exist.
1401THREAD_ALREADY_EXISTThe thread you are attempting to create already exists in a chat group.
1402THREAD_CREATE_MESSAGE_ILLEGALThe request to send a message in a thread fails because the parent message of the thread is recalled.
1500PUSH_NOT_SUPPORTThe third-party push service is not supported on the current device.
1501PUSH_BIND_FAILEDThe token of the third-party push service fails to upload to the server.
1502PUSH_UNBIND_FAILEDThe token of the third-party push service fails to unbind.