curl --request POST \
--url https://platform.trylath.com/auth/identity/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accessToken": "<string>",
"email": "<string>",
"phone": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accessToken: '<string>', email: '<string>', phone: '<string>'})
};
fetch('https://platform.trylath.com/auth/identity/add', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/auth/identity/add"
payload = {
"accessToken": "<string>",
"email": "<string>",
"phone": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.trylath.com/auth/identity/add"
payload := strings.NewReader("{\n \"accessToken\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"activityId": "<string>",
"result": {
"challengeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresAt": "2023-11-07T05:31:56Z",
"delivery": "queued",
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}auth.identity.add
Starts attaching a new address to the signed-in user: an email (a code is sent to it) or a phone number in E.164 (a code by SMS, once the environment’s number has an active carrier registration; until then channel_unavailable names the fix). Exactly one of email or phone. The user’s access token is the proof. An address that already belongs to another user is refused with identity_taken, which tells a signed-in user that the address is registered; that is accepted here because the caller is already a member and limited to 5 attempts an hour. This is how account recovery works: sign in with an address you still control, add the new one, then remove the lost one.
curl --request POST \
--url https://platform.trylath.com/auth/identity/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accessToken": "<string>",
"email": "<string>",
"phone": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accessToken: '<string>', email: '<string>', phone: '<string>'})
};
fetch('https://platform.trylath.com/auth/identity/add', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/auth/identity/add"
payload = {
"accessToken": "<string>",
"email": "<string>",
"phone": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.trylath.com/auth/identity/add"
payload := strings.NewReader("{\n \"accessToken\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"activityId": "<string>",
"result": {
"challengeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresAt": "2023-11-07T05:31:56Z",
"delivery": "queued",
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Authorizations
A Lath API key: lath_live_sk… or lath_test_sk… on a server, lath_live_pk… or lath_test_pk… in a browser.
Headers
Replays the stored response for the same key and input; refuses different input.
Was this page helpful?

