Organization (FHIR R4)
A formally or informally recognised grouping of people or organisations formed for healthcare purposes. Read-only in the public API — represents the healthcare organisation that owns the data. All resources are scoped to a single organisation per API key.
This reference is generated from the canonical Huli Public API OpenAPI specification and the server's FHIR R4 CapabilityStatement — do not edit it directly.
FHIR R4 Specification
Official spec: Organization — HL7 FHIR R4
Supported Interactions
- read — Read a single resource by ID (
GET /fhir/R4/{Resource}/{id}) - search-type — Search resources with query parameters (
GET /fhir/R4/{Resource}?...)
Scopes
Scopes are shared across FHIR releases — the same system/Organization.* scope grants Organization access on both /fhir/R4 and /fhir/R5.
- system/Organization.rs — see scope reference
Search Parameters
| Parameter | Type | Notes |
|---|---|---|
_id | token | Exact match. For identifiers use `system |
Endpoints
Search Organization
Search Organization resources. A SMART client sees only its own authenticated organization, so the searchset Bundle carries at most that one organization. An _id that does not match the caller's organization yields an empty Bundle.
/fhir/R4/OrganizationRequired scope: system/Organization.rs
Query Parameters
| name | type | required | description |
|---|---|---|---|
| _id | string | optional | Organization resource ID (UUID). |
Response — 200
{
"resourceType": "Bundle",
"type": "searchset",
"total": 1,
"entry": [
{
"fullUrl": "Organization/bb0e8400-e29b-41d4-a716-446655440050",
"resource": {
"resourceType": "Organization",
"id": "bb0e8400-e29b-41d4-a716-446655440050",
"active": true,
"name": "Centro Medico Huli"
},
"search": {
"mode": "match"
}
}
]
}
Code Samples
TOKEN=$(curl -s -X POST https://api.huli.ai/auth/token \
-d "grant_type=client_credentials" \
-d "client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer" \
-d "client_assertion=${CLIENT_ASSERTION}" \
-d "scope=system/Organization.rs" \
| jq -r .access_token)
curl -X GET https://api.huli.ai/fhir/R4/Organization \
-H "Authorization: Bearer ${TOKEN}"
const token = process.env.HULI_ACCESS_TOKEN ?? "";
const response = await fetch(
`https://api.huli.ai/fhir/R4/Organization`,
{
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
}
);
if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);
const data: unknown = await response.json();
import os
import requests
token = os.environ["HULI_ACCESS_TOKEN"]
headers = {"Authorization": f"Bearer {token}"}
resp = requests.get(
f"https://api.huli.ai/fhir/R4/Organization",
headers=headers,
)
resp.raise_for_status()
print(resp.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class searchOrganizationExample {
public static void main(String[] args) throws Exception {
String token = System.getenv("HULI_ACCESS_TOKEN");
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.huli.ai/fhir/R4/Organization"))
.header("Authorization", "Bearer " + token)
.header("Accept", "application/fhir+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("status: " + response.statusCode());
System.out.println(response.body());
}
}
import (
"fmt"
"net/http"
"os"
)
func searchOrganizationExample() {
token := os.Getenv("HULI_ACCESS_TOKEN")
req, _ := http.NewRequest("GET", "https://api.huli.ai/fhir/R4/Organization", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
fmt.Println("error:", err)
return
}
defer resp.Body.Close()
fmt.Println("status:", resp.Status)
}
Errors
| Code | Status | Description |
|---|---|---|
| HPB-00101 | 400 | Validation error |
| HPB-00106 | 401 | Authentication failed |
| HPB-00104 | 403 | Insufficient scope |
| HPB-00105 | 429 | Rate limit exceeded |
Read Organization
Retrieve a single Organization resource by its ID. This is a read-only resource.
/fhir/R4/Organization/{id}Required scope: system/Organization.rs
Response — 200
{
"resourceType": "Organization",
"id": "bb0e8400-e29b-41d4-a716-446655440050",
"active": true,
"name": "Centro Medico Huli",
"type": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/organization-type",
"code": "prov",
"display": "Healthcare Provider"
}
]
}
],
"telecom": [
{
"system": "phone",
"value": "+52-555-0300"
}
],
"address": [
{
"line": [
"Av. Insurgentes Sur 1000"
],
"city": "Ciudad de Mexico",
"state": "CDMX",
"postalCode": "03100",
"country": "MX"
}
]
}
Code Samples
TOKEN=$(curl -s -X POST https://api.huli.ai/auth/token \
-d "grant_type=client_credentials" \
-d "client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer" \
-d "client_assertion=${CLIENT_ASSERTION}" \
-d "scope=system/Organization.rs" \
| jq -r .access_token)
curl -X GET https://api.huli.ai/fhir/R4/Organization/${RESOURCE_ID} \
-H "Authorization: Bearer ${TOKEN}"
const token = process.env.HULI_ACCESS_TOKEN ?? "";
const response = await fetch(
`https://api.huli.ai/fhir/R4/Organization/${id}`,
{
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
}
);
if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);
const data: unknown = await response.json();
import os
import requests
token = os.environ["HULI_ACCESS_TOKEN"]
headers = {"Authorization": f"Bearer {token}"}
resp = requests.get(
f"https://api.huli.ai/fhir/R4/Organization/{resource_id}",
headers=headers,
)
resp.raise_for_status()
print(resp.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class getOrganizationExample {
public static void main(String[] args) throws Exception {
String token = System.getenv("HULI_ACCESS_TOKEN");
String resourceId = "RESOURCE_ID";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.huli.ai/fhir/R4/Organization/" + resourceId))
.header("Authorization", "Bearer " + token)
.header("Accept", "application/fhir+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("status: " + response.statusCode());
System.out.println(response.body());
}
}
import (
"fmt"
"net/http"
"os"
)
func getOrganizationExample() {
token := os.Getenv("HULI_ACCESS_TOKEN")
req, _ := http.NewRequest("GET", "https://api.huli.ai/fhir/R4/Organization/"+resourceID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
fmt.Println("error:", err)
return
}
defer resp.Body.Close()
fmt.Println("status:", resp.Status)
}
Errors
| Code | Status | Description |
|---|---|---|
| HPB-00106 | 401 | Authentication failed |
| HPB-00104 | 403 | Insufficient scope |
| HPB-00102 | 404 | Resource not found |
| HPB-00105 | 429 | Rate limit exceeded |