curl --request PUT \
--url https://scribe.skeptrune.com/api/me/default-org \
--header 'Content-Type: application/json' \
--cookie scribe_session= \
--data '
{
"orgId": "org_4kBnQpR7sT2vWxYz01ab"
}
'import requests
url = "https://scribe.skeptrune.com/api/me/default-org"
payload = { "orgId": "org_4kBnQpR7sT2vWxYz01ab" }
headers = {
"cookie": "scribe_session=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'scribe_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({orgId: 'org_4kBnQpR7sT2vWxYz01ab'})
};
fetch('https://scribe.skeptrune.com/api/me/default-org', 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://scribe.skeptrune.com/api/me/default-org",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'orgId' => 'org_4kBnQpR7sT2vWxYz01ab'
]),
CURLOPT_COOKIE => "scribe_session=",
CURLOPT_HTTPHEADER => [
"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://scribe.skeptrune.com/api/me/default-org"
payload := strings.NewReader("{\n \"orgId\": \"org_4kBnQpR7sT2vWxYz01ab\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "scribe_session=")
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.put("https://scribe.skeptrune.com/api/me/default-org")
.header("cookie", "scribe_session=")
.header("Content-Type", "application/json")
.body("{\n \"orgId\": \"org_4kBnQpR7sT2vWxYz01ab\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe.skeptrune.com/api/me/default-org")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["cookie"] = 'scribe_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"orgId\": \"org_4kBnQpR7sT2vWxYz01ab\"\n}"
response = http.request(request)
puts response.read_body{
"user": {
"id": "usr_V1StGXR8_Z5jdHi6BmyT",
"email": "[email protected]",
"name": "Ada Lovelace",
"handle": "ada",
"avatarUrl": "/api/uploads/users/usr_V1StGXR8_Z5jdHi6BmyT/avatar",
"createdAt": 1752624000000,
"updatedAt": 1752624000000
},
"orgs": [
{
"id": "org_4kBnQpR7sT2vWxYz01ab",
"name": "Acme Inc.",
"slug": "acme",
"iconUrl": "/api/uploads/orgs/org_4kBnQpR7sT2vWxYz01ab/icon",
"role": "member"
}
],
"currentOrgId": "org_4kBnQpR7sT2vWxYz01ab",
"defaultOrgId": "org_4kBnQpR7sT2vWxYz01ab"
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}Set my default organization
Makes one of the caller’s organizations their default: the organization requests fall back to when no X-Org-Id selection is sent, and the one the app opens after sign-in. The target must be an organization the caller is a member of. Requires a user session — agent identities have no default organization.
curl --request PUT \
--url https://scribe.skeptrune.com/api/me/default-org \
--header 'Content-Type: application/json' \
--cookie scribe_session= \
--data '
{
"orgId": "org_4kBnQpR7sT2vWxYz01ab"
}
'import requests
url = "https://scribe.skeptrune.com/api/me/default-org"
payload = { "orgId": "org_4kBnQpR7sT2vWxYz01ab" }
headers = {
"cookie": "scribe_session=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'scribe_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({orgId: 'org_4kBnQpR7sT2vWxYz01ab'})
};
fetch('https://scribe.skeptrune.com/api/me/default-org', 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://scribe.skeptrune.com/api/me/default-org",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'orgId' => 'org_4kBnQpR7sT2vWxYz01ab'
]),
CURLOPT_COOKIE => "scribe_session=",
CURLOPT_HTTPHEADER => [
"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://scribe.skeptrune.com/api/me/default-org"
payload := strings.NewReader("{\n \"orgId\": \"org_4kBnQpR7sT2vWxYz01ab\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "scribe_session=")
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.put("https://scribe.skeptrune.com/api/me/default-org")
.header("cookie", "scribe_session=")
.header("Content-Type", "application/json")
.body("{\n \"orgId\": \"org_4kBnQpR7sT2vWxYz01ab\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe.skeptrune.com/api/me/default-org")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["cookie"] = 'scribe_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"orgId\": \"org_4kBnQpR7sT2vWxYz01ab\"\n}"
response = http.request(request)
puts response.read_body{
"user": {
"id": "usr_V1StGXR8_Z5jdHi6BmyT",
"email": "[email protected]",
"name": "Ada Lovelace",
"handle": "ada",
"avatarUrl": "/api/uploads/users/usr_V1StGXR8_Z5jdHi6BmyT/avatar",
"createdAt": 1752624000000,
"updatedAt": 1752624000000
},
"orgs": [
{
"id": "org_4kBnQpR7sT2vWxYz01ab",
"name": "Acme Inc.",
"slug": "acme",
"iconUrl": "/api/uploads/orgs/org_4kBnQpR7sT2vWxYz01ab/icon",
"role": "member"
}
],
"currentOrgId": "org_4kBnQpR7sT2vWxYz01ab",
"defaultOrgId": "org_4kBnQpR7sT2vWxYz01ab"
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}Authorizations
Browser session cookie set by the WorkOS sign-in flow.
Body
The organization to make the default.
Choose which of the caller’s organizations is their default.
Id of one of the caller’s organizations to make their default.
1"org_4kBnQpR7sT2vWxYz01ab"
Response
The refreshed profile with the new default organization.
Profile of the authenticated user plus their organization memberships.
A Scribe user profile.
Show child attributes
Show child attributes
{
"id": "usr_V1StGXR8_Z5jdHi6BmyT",
"email": "[email protected]",
"name": "Ada Lovelace",
"handle": "ada",
"avatarUrl": "/api/uploads/users/usr_V1StGXR8_Z5jdHi6BmyT/avatar",
"createdAt": 1752624000000,
"updatedAt": 1752624000000
}
All organizations the user belongs to.
Show child attributes
Show child attributes
[
{
"id": "org_4kBnQpR7sT2vWxYz01ab",
"name": "Acme Inc.",
"slug": "acme",
"iconUrl": "/api/uploads/orgs/org_4kBnQpR7sT2vWxYz01ab/icon",
"role": "member"
}
]
Id of the organization the request is scoped to (via the X-Org-Id header or ?orgId). Without an explicit selection it falls back to the default organization, then to the first membership; empty for accounts without an organization.
"org_4kBnQpR7sT2vWxYz01ab"
Id of the organization sessions fall back to when no X-Org-Id selection is sent (set via PUT /api/me/default-org). Null only when the user belongs to no organization or their default organization was just deleted.
"org_4kBnQpR7sT2vWxYz01ab"