Switch company profile
curl --request POST \
--url https://api.exowpee.com/v1/auth/switch-user-profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_profile_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/auth/switch-user-profile"
payload = { "user_profile_id": "<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({user_profile_id: '<string>'})
};
fetch('https://api.exowpee.com/v1/auth/switch-user-profile', 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.exowpee.com/v1/auth/switch-user-profile",
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([
'user_profile_id' => '<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.exowpee.com/v1/auth/switch-user-profile"
payload := strings.NewReader("{\n \"user_profile_id\": \"<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.exowpee.com/v1/auth/switch-user-profile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_profile_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/auth/switch-user-profile")
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 \"user_profile_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"auth": {
"access_token": "<string>",
"token_type": "bearer",
"expires_in": 123
},
"user": {
"is_seller": true,
"is_cashier": true,
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone_number": "<string>",
"type": "<string>",
"is_active": true,
"email_verified_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"current_user_profile_id": "<string>",
"user_profiles": "<array>"
}
}{
"message": "<string>",
"errors": {}
}Your account and notifications
Switch company profile
Lets a person switch to another of their company profiles and continue working there.
POST
/
auth
/
switch-user-profile
Switch company profile
curl --request POST \
--url https://api.exowpee.com/v1/auth/switch-user-profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_profile_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/auth/switch-user-profile"
payload = { "user_profile_id": "<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({user_profile_id: '<string>'})
};
fetch('https://api.exowpee.com/v1/auth/switch-user-profile', 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.exowpee.com/v1/auth/switch-user-profile",
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([
'user_profile_id' => '<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.exowpee.com/v1/auth/switch-user-profile"
payload := strings.NewReader("{\n \"user_profile_id\": \"<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.exowpee.com/v1/auth/switch-user-profile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_profile_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/auth/switch-user-profile")
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 \"user_profile_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"auth": {
"access_token": "<string>",
"token_type": "bearer",
"expires_in": 123
},
"user": {
"is_seller": true,
"is_cashier": true,
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone_number": "<string>",
"type": "<string>",
"is_active": true,
"email_verified_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"current_user_profile_id": "<string>",
"user_profiles": "<array>"
}
}{
"message": "<string>",
"errors": {}
}For: Everyone
Conditions
- Only a signed-in member can call it; agent accounts cannot.
- The assignment must belong to the signed-in member, be active, and belong to a company.
- The member’s membership in that company must be active, and the company itself must be active.
- Ends the member’s earlier sessions of that kind of space (company, client or organization) on every device; sessions in the other kinds of space are kept.
- Issues a new access token carrying the chosen assignment, its profile and company.
- Resets the refresh read-set of the chosen assignment, so the client refresh state starts empty (meta_data becomes empty).
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Identifier of the company profile assignment to switch to (27-character KSUID). Required; must exist and belong to the signed-in member, be active and be usable (active membership and company).