curl --request POST \
--url https://hiimpria.ai/api/user/twinMembership \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"slug": "vita"
}'import requests
url = "https://hiimpria.ai/api/user/twinMembership"
payload = { "slug": "vita" }
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({slug: 'vita'})
};
fetch('https://hiimpria.ai/api/user/twinMembership', 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://hiimpria.ai/api/user/twinMembership",
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([
'slug' => 'vita'
]),
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://hiimpria.ai/api/user/twinMembership"
payload := strings.NewReader("{\n \"slug\": \"vita\"\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://hiimpria.ai/api/user/twinMembership")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"vita\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/user/twinMembership")
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 \"slug\": \"vita\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"member": true,
"membershipId": "<string>",
"guest": true
}Check the caller's membership on a public twin slug
Twin-widget identity pre-flight. Given the public slug used by /twins/, reports whether the AUTHENTICATED caller holds an active membership on that twin’s institution. The widget page uses this to route an already-signed-in visitor into the app as themselves (member) or ask them to log out first (non-member); unauthenticated visitors never call this and proceed as guests.
curl --request POST \
--url https://hiimpria.ai/api/user/twinMembership \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"slug": "vita"
}'import requests
url = "https://hiimpria.ai/api/user/twinMembership"
payload = { "slug": "vita" }
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({slug: 'vita'})
};
fetch('https://hiimpria.ai/api/user/twinMembership', 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://hiimpria.ai/api/user/twinMembership",
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([
'slug' => 'vita'
]),
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://hiimpria.ai/api/user/twinMembership"
payload := strings.NewReader("{\n \"slug\": \"vita\"\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://hiimpria.ai/api/user/twinMembership")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"vita\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/user/twinMembership")
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 \"slug\": \"vita\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"member": true,
"membershipId": "<string>",
"guest": true
}Authorizations
JWT token passed in authorization header
Body
The twin's public web-access slug (case-insensitive).
"vita"
Response
Membership resolution for the caller.
true
True when the caller holds an active membership on the twin's institution.
The caller's UserInstitution id (present only when member is true).
Present (true) when the caller is a twin-widget web user (the anonymous identity the public page creates). The page then stays on the guest widget: it never switches the digital twin or opens the full app.
Was this page helpful?