Skip to main content

Set account email

Method#

/security/email#

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/security/email

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

Method used to register an email on your WhatsApp account. This email could be used later to recovery the security PIN code of your account.

caution

This API is available only for mobile instances.


Attributes#

Required#

AttributesTypeDescription
emailstringEmail to be registered on your WhatsApp account

Request Body#

{
"email": "example@email.com"
}

Response#

200#

AttributesTypeDescription
successbooleanDefines if the request was executed successfully
messagestringIn case of success, it may request email verification (VERIFY_EMAIL). This way, an email will be sent to the address provided in the request, containing a code that must be used in the verify email API to complete the registration. In case of failure, it returns a message regarding the error

Example#

{
"success": true,
"message": "VERIFY_EMAIL"
}

400#

Invalid request. Check if the data you are sending is in accordance with the documentation above.

405#

In this case, make sure you are correctly sending the method specification, i.e., check if you sent the POST or GET as specified at the beginning of this topic.

415#

If you receive a 415 error, make sure to add the "Content-Type" of the object you are sending to the headers of the request, mostly "application/json"

Code#