Exchange login handoff
curl --request POST \
--url https://api.ecomailhub.younegotiate.com/auth/login-as/exchange \
--header 'Content-Type: application/json' \
--data '
{
"handoff_token": "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
}
'import requests
url = "https://api.ecomailhub.younegotiate.com/auth/login-as/exchange"
payload = { "handoff_token": "01234567890123456789012345678901234567890123456789012345678901234567890123456789" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
handoff_token: '01234567890123456789012345678901234567890123456789012345678901234567890123456789'
})
};
fetch('https://api.ecomailhub.younegotiate.com/auth/login-as/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ecomailhub.younegotiate.com/auth/login-as/exchange",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'handoff_token' => '01234567890123456789012345678901234567890123456789012345678901234567890123456789'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ecomailhub.younegotiate.com/auth/login-as/exchange"
payload := strings.NewReader("{\n \"handoff_token\": \"01234567890123456789012345678901234567890123456789012345678901234567890123456789\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ecomailhub.younegotiate.com/auth/login-as/exchange")
.header("Content-Type", "application/json")
.body("{\n \"handoff_token\": \"01234567890123456789012345678901234567890123456789012345678901234567890123456789\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ecomailhub.younegotiate.com/auth/login-as/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"handoff_token\": \"01234567890123456789012345678901234567890123456789012345678901234567890123456789\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Logged in as ecomailhub user.",
"data": {
"id": 42,
"name": "MailHub Manager",
"email": "mailhub.manager@example.com"
},
"meta": {
"access_token": "1|access-token",
"refresh_token": "refresh-token",
"token_type": "Bearer",
"access_token_expires_at": null,
"refresh_token_expires_at": "2026-07-19T19:00:00.000000Z"
}
}{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email field is required."
]
}
}{
"message": "Too Many Attempts."
}Exchange login handoff
Exchange a short-lived, single-use Superadmin handoff for a non-remembered EcoMail Hub access and refresh token pair. Invalid, expired, reused, wrong-portal, and deleted-user handoffs are rejected with the same validation response.
POST
/
auth
/
login-as
/
exchange
Exchange login handoff
curl --request POST \
--url https://api.ecomailhub.younegotiate.com/auth/login-as/exchange \
--header 'Content-Type: application/json' \
--data '
{
"handoff_token": "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
}
'import requests
url = "https://api.ecomailhub.younegotiate.com/auth/login-as/exchange"
payload = { "handoff_token": "01234567890123456789012345678901234567890123456789012345678901234567890123456789" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
handoff_token: '01234567890123456789012345678901234567890123456789012345678901234567890123456789'
})
};
fetch('https://api.ecomailhub.younegotiate.com/auth/login-as/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ecomailhub.younegotiate.com/auth/login-as/exchange",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'handoff_token' => '01234567890123456789012345678901234567890123456789012345678901234567890123456789'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ecomailhub.younegotiate.com/auth/login-as/exchange"
payload := strings.NewReader("{\n \"handoff_token\": \"01234567890123456789012345678901234567890123456789012345678901234567890123456789\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ecomailhub.younegotiate.com/auth/login-as/exchange")
.header("Content-Type", "application/json")
.body("{\n \"handoff_token\": \"01234567890123456789012345678901234567890123456789012345678901234567890123456789\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ecomailhub.younegotiate.com/auth/login-as/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"handoff_token\": \"01234567890123456789012345678901234567890123456789012345678901234567890123456789\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Logged in as ecomailhub user.",
"data": {
"id": 42,
"name": "MailHub Manager",
"email": "mailhub.manager@example.com"
},
"meta": {
"access_token": "1|access-token",
"refresh_token": "refresh-token",
"token_type": "Bearer",
"access_token_expires_at": null,
"refresh_token_expires_at": "2026-07-19T19:00:00.000000Z"
}
}{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email field is required."
]
}
}{
"message": "Too Many Attempts."
}Body
application/json
Plaintext handoff received from the Superadmin login-as endpoint. It is single-use and must be exchanged before its expiry timestamp.
Required string length:
80Last modified on July 19, 2026
Was this page helpful?
⌘I

