Switch active organization
const options = {method: 'POST'};
fetch('http://localhost:8000/api/v1/me/organizations/{id}/switch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/me/organizations/{id}/switch"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request POST \
--url http://localhost:8000/api/v1/me/organizations/{id}/switchimport requests
url = "http://localhost:8000/api/v1/me/organizations/{id}/switch"
response = requests.post(url)
print(response.text){
"success": true,
"data": {
"activeOrganizationId": "<string>",
"role": "owner"
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}Profile
Switch active organization
Set the active organization for the current session. User must be a member of the organization.
POST
/
api
/
v1
/
me
/
organizations
/
{id}
/
switch
Switch active organization
const options = {method: 'POST'};
fetch('http://localhost:8000/api/v1/me/organizations/{id}/switch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/me/organizations/{id}/switch"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request POST \
--url http://localhost:8000/api/v1/me/organizations/{id}/switchimport requests
url = "http://localhost:8000/api/v1/me/organizations/{id}/switch"
response = requests.post(url)
print(response.text){
"success": true,
"data": {
"activeOrganizationId": "<string>",
"role": "owner"
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}Was this page helpful?