Get Organization
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}', 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/app/v1/organizations/{organizationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/app/v1/organizations/{organizationId}"
req, _ := http.NewRequest("GET", url, nil)
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/app/v1/organizations/{organizationId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyOrganizations
Get Organization
Get an organization by ID
GET
/
app
/
v1
/
organizations
/
{organizationId}
Get Organization
curl --request GET \
--url https://api.example.com/app/v1/organizations/{organizationId}import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/app/v1/organizations/{organizationId}', 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/app/v1/organizations/{organizationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/app/v1/organizations/{organizationId}"
req, _ := http.NewRequest("GET", url, nil)
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/app/v1/organizations/{organizationId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyRetrieves a specific organization by its ID. The authenticated user must be a member of the organization.
Path Parameters
Organization ID
Response
Returns the Organization object.{
"id": "org123",
"name": "Acme Corp",
"slug": "acme-corp",
"description": "Acme Corporation main organization",
"status": "active",
"settings": {
"timezone": "America/New_York",
"locales": ["en-US", "es-ES"],
"features": {
"assetOptimization": true,
"advancedPermissions": true
}
},
"roles": {
"role123": "Editor",
"role456": "Viewer"
},
"metadata": {
"createdBy": "user123",
"maxProjects": 10
},
"subscription": {
"tierId": "tier_pro",
"status": "active",
"currentPeriodStart": "2024-03-01T00:00:00Z",
"currentPeriodEnd": "2024-04-01T00:00:00Z"
},
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z"
}
Error Responses
Organization Not Found
{
"error": {
"code": "NOT_FOUND",
"message": "Organization org123 was not found"
}
}
Code Examples
curl -X GET "https://api.metabind.ai/app/v1/organizations/org123" \
-H "Authorization: Bearer YOUR_JWT"
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123',
{
headers: {
'Authorization': 'Bearer YOUR_JWT'
}
}
);
const organization = await response.json();
console.log(`Organization: ${organization.name}`);
console.log(`Subscription tier: ${organization.subscription.tierId}`);
let url = URL(string: "https://api.metabind.ai/app/v1/organizations/org123")!
var request = URLRequest(url: url)
request.setValue("Bearer YOUR_JWT", forHTTPHeaderField: "Authorization")
let (data, _) = try await URLSession.shared.data(for: request)
let organization = try JSONDecoder().decode(Organization.self, from: data)
print("Organization: \(organization.name)")
val response = client.get("https://api.metabind.ai/app/v1/organizations/org123") {
header("Authorization", "Bearer YOUR_JWT")
}
val organization = response.body<Organization>()
println("Organization: ${organization.name}")
println("Subscription tier: ${organization.subscription.tierId}")
⌘I