Invite a User to a Portal
Purpose
To invite a user to a portal.
Request Details
Request URL
{api-domain}/crm/{version}/{personality_module}/{record_id}/actions/portal_invite
Where, personality_module is the API name of the module for which the portal was created
record_id is the ID of the record that you want to invite to the portal
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoCRM.settings.clientportal.ALL
(or)
Scope=ZohoCRM.settings.clientportal.CREATE
Parameters
- user_type_idinteger, mandatory
The ID of the user type you want to assign this user with. Use the Get User Types API for this ID.
- typestring, mandatory
Represents whether the user is invited the first time or is re-invited. The possible values are invite and reinvite.
- languagestring, optional
The language code of the user you want to invite to the portal. The default value is en_US. The supported values are "en_US", "en_GB", "bg_BG", "zh_CN", "zh_TW", "hr_HR", "ar_EG", "in_ID", "cs_CZ", "da_DK", "nl_NL", "fr_FR", "de_DE", "hu_HU", "hi_IN", "it_IT", "ja_JP", "pl_PL","pt_BR", "pt_PT", "ru_RU", "es_ES", "sv_SE", "th_TH", "tr_TR", "vi_VN", "ko_KR", and "iw_IL".
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v4/Contacts/3652397000000388085/actions/portal_invite?user_type_id=3652397000006231003&type=invite&language=en_US"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Possible Errors
- REQUIRED_PARAM_MISSINGHTTP 400
You have not specified one or more mandatory parameters.
Resolution: "type" and "user_type_id" are mandatory parameters. Refer to the "details" key in the error response to know what is missing and include it in the request. - DUPLICATE_DATAHTTP 400
The invitation you sent failed as a portal user exists with the same email ID.
Resolution: Invite the right user to the portal. - INVALID_DATAHTTP 400
Reasons:
The language code is invalid.
The invitation you sent failed as the user is not a client or a customer.
The user_type_id is invalid.
The personality module's record ID is invalid.
Resolutions:
Refer to the key "language" in the "Input JSON" section for the allowed language codes.
Invite only clients or customers to this user type, not users from your domain.
Specify the right user_type_id.
Specify the right record ID of the personality module's record. Use the Get Records API to get this ID.
- NOT_REVIEWEDHTTP 400
You cannot send portal invitation since the record is under the review process.
Resolution: Send the invitation either to an approved record or wait until this record completes the review process. - NOT_APPROVEDHTTP 400
The user record you are trying to invite is not approved, yet.
Resolution: Contact your administrator to approve the record. - CANNOT_PROCESSHTTP 400
The user you are trying to invite is already invited or the record is under GDPR process.
Resolution: Use the value reinvite for the "type" parameter to reinvite the user. - LICENSE_LIMIT_EXCEEDEDHTTP 400
You have exceeded the portal user license limit.
Resolution: Contact support@zohocrm.com to purchase more user licenses. - RECORD_LOCKEDHTTP 400
You cannot perform this operation as the record is locked.
Resolution: Please wait until the record is unlocked. - NO_PERMISSIONHTTP 403
You do not have permission to the module.
Resolution: Contact your administrator.
Sample Response
Copied{
"portal_invite": [
{
"code": "SUCCESS",
"details": {
"record_id": "3652397000000388085"
},
"message": "An Invite has been sent to the personality.",
"status": "success"
}
]
}