List Organizations
curl --request GET \
--url https://api.bunship.com/api/v1/users/me/organizations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bunship.com/api/v1/users/me/organizations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bunship.com/api/v1/users/me/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.bunship.com/api/v1/users/me/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 => [
"Authorization: Bearer <token>"
],
]);
$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.bunship.com/api/v1/users/me/organizations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.bunship.com/api/v1/users/me/organizations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/users/me/organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"organizations": [
{
"id": "org_cld2abc123def456",
"name": "Acme Corp",
"slug": "acme-corp",
"logoUrl": "https://cdn.bunship.com/logos/acme.png",
"role": "owner",
"membershipId": "mbr_abc123",
"joinedAt": "2024-01-15T10:00:00Z"
},
{
"id": "org_xyz789ghi012345",
"name": "Widget Labs",
"slug": "widget-labs",
"logoUrl": null,
"role": "member",
"membershipId": "mbr_def456",
"joinedAt": "2024-02-01T14:30:00Z"
}
],
"total": 2
}
Organizations
List Organizations
List all organizations the current user belongs to
GET
/
api
/
v1
/
users
/
me
/
organizations
List Organizations
curl --request GET \
--url https://api.bunship.com/api/v1/users/me/organizations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bunship.com/api/v1/users/me/organizations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bunship.com/api/v1/users/me/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.bunship.com/api/v1/users/me/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 => [
"Authorization: Bearer <token>"
],
]);
$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.bunship.com/api/v1/users/me/organizations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.bunship.com/api/v1/users/me/organizations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/users/me/organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"organizations": [
{
"id": "org_cld2abc123def456",
"name": "Acme Corp",
"slug": "acme-corp",
"logoUrl": "https://cdn.bunship.com/logos/acme.png",
"role": "owner",
"membershipId": "mbr_abc123",
"joinedAt": "2024-01-15T10:00:00Z"
},
{
"id": "org_xyz789ghi012345",
"name": "Widget Labs",
"slug": "widget-labs",
"logoUrl": null,
"role": "member",
"membershipId": "mbr_def456",
"joinedAt": "2024-02-01T14:30:00Z"
}
],
"total": 2
}
Returns all organizations where the authenticated user has a membership, along with their role in each organization.
Auth
Requires a valid Bearer token.
Response
Array of organization membership objects.
Show organization properties
Show organization properties
Total number of organizations.
{
"organizations": [
{
"id": "org_cld2abc123def456",
"name": "Acme Corp",
"slug": "acme-corp",
"logoUrl": "https://cdn.bunship.com/logos/acme.png",
"role": "owner",
"membershipId": "mbr_abc123",
"joinedAt": "2024-01-15T10:00:00Z"
},
{
"id": "org_xyz789ghi012345",
"name": "Widget Labs",
"slug": "widget-labs",
"logoUrl": null,
"role": "member",
"membershipId": "mbr_def456",
"joinedAt": "2024-02-01T14:30:00Z"
}
],
"total": 2
}
Errors
| Status | Code | Description |
|---|---|---|
401 | AUTHENTICATION_ERROR | Missing or invalid Bearer token |
Example
curl https://api.bunship.com/api/v1/users/me/organizations \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
⌘I

