POST
https://api.cryptohopper.com/v1/user/email
Starts a change of the user's email address. The user gets a confirmation email at the old and at the new address and must confirm both. One request per hour is allowed.
OAuth scope:
user About scopes
code is the user's current two-factor code and may not be empty. Accounts without two-factor authentication accept any non-empty value. An address that already belongs to another account is refused.
Example request
curl -X POST "https://api.cryptohopper.com/v1/user/email" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","code":"123456"}'
const response = await fetch('https://api.cryptohopper.com/v1/user/email', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "[email protected]",
"code": "123456"
})
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/user/email",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"email": "[email protected]",
"code": "123456"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/user/email');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'code' => '123456',
]),
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Optional |
Response
{
"data": "E-mail address change request initiated."
}