Switch user organisation
import requests
url = "https://platform.ankra.app/api/v1/org/organisation/switch"
payload = { "organisation_id": "550e8400-e29b-41d4-a716-446655440000" }
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({organisation_id: '550e8400-e29b-41d4-a716-446655440000'})
};
fetch('https://platform.ankra.app/api/v1/org/organisation/switch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/organisation/switch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"organisation_id": "550e8400-e29b-41d4-a716-446655440000"
}
'{
"message": "User switched to organisation",
"success": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Organisation API
Switch user organisation
POST
/
api
/
v1
/
org
/
organisation
/
switch
Switch user organisation
import requests
url = "https://platform.ankra.app/api/v1/org/organisation/switch"
payload = { "organisation_id": "550e8400-e29b-41d4-a716-446655440000" }
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({organisation_id: '550e8400-e29b-41d4-a716-446655440000'})
};
fetch('https://platform.ankra.app/api/v1/org/organisation/switch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/organisation/switch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"organisation_id": "550e8400-e29b-41d4-a716-446655440000"
}
'{
"message": "User switched to organisation",
"success": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Target organisation ID to switch to
Example:
"550e8400-e29b-41d4-a716-446655440000"