Get user organizations
curl --request GET \
--url https://api.example.com/users/{id}/organizations \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/users/{id}/organizations"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/users/{id}/organizations', 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.example.com/users/{id}/organizations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/users/{id}/organizations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/users/{id}/organizations")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/users/{id}/organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyUsers
Get User Organizations
⚠️ SECURITY: Lists all organizations a user belongs to. Requires authentication with scope “read:organization”. Supports both OAuth tokens and API keys. Returns organizations with membership details.
GET
/
users
/
{id}
/
organizations
Get user organizations
curl --request GET \
--url https://api.example.com/users/{id}/organizations \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/users/{id}/organizations"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/users/{id}/organizations', 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.example.com/users/{id}/organizations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/users/{id}/organizations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/users/{id}/organizations")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/users/{id}/organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyLists all organizations a user belongs to. Requires authentication with scope
read:organization. Supports both OAuth tokens and API keys.
Permissions
Requires authentication with scoperead:organization.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | User ID |
Authentication
Supports both:- OAuth tokens:
Authorization: Bearer <oauth_token> - API keys:
X-API-Key: sk_...
Example Request
curl -X GET https://api.timbrix.mx/users/550e8400-e29b-41d4-a716-446655440000/organizations \
-H "Authorization: Bearer <token>"
import { Timbrix } from "@timbrix/sdk"
const client = new Timbrix({ bearerToken: "<token>" })
const organizations = await client.users.getOrganizations(
"550e8400-e29b-41d4-a716-446655440000"
)
console.log(organizations)
Example Response
[
{
"id": "org_1234567890abcdef",
"name": "Acme Corporation",
"slug": "acme-corp",
"role": "owner",
"joinedAt": "2025-01-01T00:00:00Z"
},
{
"id": "org_0987654321fedcba",
"name": "Tech Pro",
"slug": "tech-startup",
"role": "admin",
"joinedAt": "2025-01-15T00:00:00Z"
}
]
Response Fields
Each organization includes:- Organization ID, name, and slug
- User’s role in the organization (owner, admin, member)
- Membership timestamp (when user joined)
Common Errors
401 Unauthorized
Authentication required. Provide a valid OAuth token.403 Forbidden
Insufficient scope. Required scope:read:organization