Verify External User
curl --request POST \
--url https://api.replyke.com/api/v6/:projectId/auth/verify-external-user \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userJwt": "<string>"
}
'import requests
url = "https://api.replyke.com/api/v6/:projectId/auth/verify-external-user"
payload = { "userJwt": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({userJwt: '<string>'})
};
fetch('https://api.replyke.com/api/v6/:projectId/auth/verify-external-user', 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.replyke.com/api/v6/:projectId/auth/verify-external-user",
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([
'userJwt' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.replyke.com/api/v6/:projectId/auth/verify-external-user"
payload := strings.NewReader("{\n \"userJwt\": \"<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))
}HttpResponse<String> response = Unirest.post("https://api.replyke.com/api/v6/:projectId/auth/verify-external-user")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userJwt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replyke.com/api/v6/:projectId/auth/verify-external-user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userJwt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"accessToken": "<string>",
"refreshToken": "<string>",
"user": {
"id": "<string>",
"email": "<string>",
"username": "<string>",
"name": "<string>",
"avatar": "<string>",
"bio": "<string>",
"location": {
"type": "<string>",
"coordinates": [
123
]
},
"birthdate": "<string>",
"metadata": {},
"suspensions": [
{}
],
"reputation": 123,
"createdAt": "<string>",
"updatedAt": "<string>"
}
}Auth Endpoints
Verify External User
Verify and authenticate a user from an external system using JWT
Verify External User
curl --request POST \
--url https://api.replyke.com/api/v6/:projectId/auth/verify-external-user \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userJwt": "<string>"
}
'import requests
url = "https://api.replyke.com/api/v6/:projectId/auth/verify-external-user"
payload = { "userJwt": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({userJwt: '<string>'})
};
fetch('https://api.replyke.com/api/v6/:projectId/auth/verify-external-user', 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.replyke.com/api/v6/:projectId/auth/verify-external-user",
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([
'userJwt' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.replyke.com/api/v6/:projectId/auth/verify-external-user"
payload := strings.NewReader("{\n \"userJwt\": \"<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))
}HttpResponse<String> response = Unirest.post("https://api.replyke.com/api/v6/:projectId/auth/verify-external-user")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userJwt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replyke.com/api/v6/:projectId/auth/verify-external-user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userJwt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"accessToken": "<string>",
"refreshToken": "<string>",
"user": {
"id": "<string>",
"email": "<string>",
"username": "<string>",
"name": "<string>",
"avatar": "<string>",
"bio": "<string>",
"location": {
"type": "<string>",
"coordinates": [
123
]
},
"birthdate": "<string>",
"metadata": {},
"suspensions": [
{}
],
"reputation": 123,
"createdAt": "<string>",
"updatedAt": "<string>"
}
}Verifies a user identity using a signed JWT from an external project. If the user exists, it updates the profile. If not, it creates the user. Returns an access token, refresh token, and user data.
Body Parameters
string
required
Signed JWT issued by the external project containing user identity information
Response
boolean
Indicates whether the verification was successful
string
JWT access token for authenticating API requests
string
JWT refresh token for obtaining new access tokens
User Object
The verified or newly created user object
Show properties
Show properties
string
Unique user identifier
string
User’s email address
string
User’s username
string
User’s full name
string
URL to user’s avatar image
string
User’s biography
string
User’s birthdate in ISO 8601 format
object
Custom public metadata
array
Array of active suspensions
number
User’s reputation score
string
Account creation timestamp
string
Last update timestamp
Error Responses
Missing JWT - 400 Bad Request
Missing JWT - 400 Bad Request
{
"error": "Missing userJwt",
"code": "auth/missing-jwt"
}
Missing Keys - 403 Forbidden
Missing Keys - 403 Forbidden
{
"error": "Missing JWT keys",
"code": "auth/missing-keys"
}
Invalid Token - 403 Forbidden
Invalid Token - 403 Forbidden
{
"error": "Invalid token",
"code": "auth/invalid-token"
}
Project Mismatch - 403 Forbidden
Project Mismatch - 403 Forbidden
{
"error": "Project ID mismatch",
"code": "auth/project-mismatch"
}
Unexpected Missing User - 500 Internal Server Error
Unexpected Missing User - 500 Internal Server Error
{
"error": "Unexpected error fetching user after login",
"code": "auth/missing-user"
}
Server Error - 500 Internal Server Error
Server Error - 500 Internal Server Error
{
"error": "Internal server error",
"code": "auth/server-error",
"details": "<Error message>"
}
Notes
- The JWT is verified using the current or previous public key associated with the project.
- On success, a secure HttpOnly cookie (
replyke-refresh-jwt) is set. - The user is updated or created based on
foreignIdand optionallyemail. - Response includes tokens and user profile, including suspension info.

