Get current organization
curl --request GET \
--url https://api.example.com/api/organization/current \
--header 'Authorization: <authorization>' \
--header 'organization-id: <organization-id>'import requests
url = "https://api.example.com/api/organization/current"
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'organization-id': '<organization-id>'}
};
fetch('https://api.example.com/api/organization/current', 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/api/organization/current",
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: <authorization>",
"organization-id: <organization-id>"
],
]);
$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/api/organization/current"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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/api/organization/current")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/organization/current")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
response = http.request(request)
puts response.read_body{
"id": 1,
"organizationId": "org_123456",
"initializedAt": "2024-01-01T00:00:00.000Z",
"seededAt": "2024-01-01T01:00:00.000Z",
"builtAt": "2024-01-01T02:00:00.000Z",
"metadata": [
{
"id": 1,
"tenantId": 101,
"name": "Acme Inc.",
"location": "US",
"baseCurrency": "USD",
"language": "en-US",
"timezone": "America/New_York",
"dateFormat": "MM/DD/YYYY",
"fiscalYear": "January",
"industry": "Technology",
"taxNumber": "12-3456789",
"primaryColor": "#4285F4",
"logoKey": "organizations/acme-logo-123456.png",
"logoUri": "https://...",
"address": "123 Main St, New York, NY"
}
],
"isReady": true,
"isBuildRunning": false,
"isUpgradeRunning": false,
"databaseBatch": "batch_001"
}Organization
Get current organization
GET
/
api
/
organization
/
current
Get current organization
curl --request GET \
--url https://api.example.com/api/organization/current \
--header 'Authorization: <authorization>' \
--header 'organization-id: <organization-id>'import requests
url = "https://api.example.com/api/organization/current"
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'organization-id': '<organization-id>'}
};
fetch('https://api.example.com/api/organization/current', 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/api/organization/current",
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: <authorization>",
"organization-id: <organization-id>"
],
]);
$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/api/organization/current"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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/api/organization/current")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/organization/current")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
response = http.request(request)
puts response.read_body{
"id": 1,
"organizationId": "org_123456",
"initializedAt": "2024-01-01T00:00:00.000Z",
"seededAt": "2024-01-01T01:00:00.000Z",
"builtAt": "2024-01-01T02:00:00.000Z",
"metadata": [
{
"id": 1,
"tenantId": 101,
"name": "Acme Inc.",
"location": "US",
"baseCurrency": "USD",
"language": "en-US",
"timezone": "America/New_York",
"dateFormat": "MM/DD/YYYY",
"fiscalYear": "January",
"industry": "Technology",
"taxNumber": "12-3456789",
"primaryColor": "#4285F4",
"logoKey": "organizations/acme-logo-123456.png",
"logoUri": "https://...",
"address": "123 Main St, New York, NY"
}
],
"isReady": true,
"isBuildRunning": false,
"isUpgradeRunning": false,
"databaseBatch": "batch_001"
}Headers
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
Example:
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Response
200 - application/json
Returns the current organization
Internal numeric ID of the organization
Example:
1
Unique string identifier for the organization
Example:
"org_123456"
Date when the organization was initialized
Example:
"2024-01-01T00:00:00.000Z"
Date when the organization was seeded
Example:
"2024-01-01T01:00:00.000Z"
Date when the organization was built
Example:
"2024-01-01T02:00:00.000Z"
Organization metadata
Show child attributes
Show child attributes
Whether the organization is ready
Example:
true
Whether a build process is currently running
Example:
false
Whether an upgrade process is currently running
Example:
false
Database batch identifier, if any
Example:
"batch_001"