Aurabox REST API by aurabx/skills
npx skills add https://github.com/aurabx/skills --skill 'Aurabox REST API'为 Aurabox Cloud REST API 生成正确、可运行的客户端代码。了解完整的 API 接口——包括患者、病例、研究——涵盖身份验证、分页和错误处理。可生成符合 Python、TypeScript/JavaScript、PHP 和 curl 语言习惯的代码。
https://au.aurabox.cloud
所有请求都需要在 Authorization 请求头中包含 Bearer 令牌:
Authorization: Bearer {YOUR_AUTH_KEY}
Content-Type: application/json
Accept: application/json
API 密钥在 Aurabox 网页界面中生成。它们的作用域限定于一个团队领域。
安全提示:API 密钥是敏感信息。切勿将其提交到源代码控制中。请使用环境变量或密钥管理器。
提供机器可读的规范:
https://au.aurabox.app/docs/openapi.yaml广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
https://au.aurabox.app/docs/collection.json在已认证的团队领域内对患者记录进行完整的增删改查操作。
{
"id": "003fb6c7-a399-46de-8199-ac51e031bd10",
"given_names": "Jessica",
"family_name": "Jones",
"date_of_birth": "1985-06-15",
"sex": "female",
"address": {
"street": "123 Main Street",
"city": "Sydney",
"region": "NSW",
"postcode": "2000",
"country": "au"
},
"status": "active",
"archived": false,
"created_at": "2025-01-15T10:30:00.000000Z",
"updated_at": "2025-01-15T10:30:00.000000Z"
}
| 方法 | 路径 | 描述 |
|---|---|---|
GET | /api/v1/patients | 列出患者(可分页、可搜索、可排序) |
POST | /api/v1/patients | 创建患者 |
GET | /api/v1/patients/{id} | 检索患者 |
PUT | /api/v1/patients/{id} | 更新患者 |
DELETE | /api/v1/patients/{id} | 删除患者 |
| 参数 | 类型 | 值 |
|---|---|---|
per_page | integer | 1-100 |
search | string | 最多 255 个字符 |
sort | string | name, created_at, updated_at, date_of_birth |
direction | string | asc, desc |
archived | boolean | true, false |
| 字段 | 类型 | 是否必需(创建) | 备注 |
|---|---|---|---|
given_names | string | 是 | 最多 255 个字符 |
family_name | string | 是 | 最多 255 个字符 |
date_of_birth | string | 是 | 日期格式,必须早于今天 |
sex | string | 是 | male, female, other, unknown |
address | object | 否 | 包含 street, city, region, postcode(最多 20 个字符), country(最多 2 个字符,ISO 代码) |
病例是已移除身份信息的患者。仅存储标签和非识别性元数据。
{
"id": "003fb6c7-a399-46de-8199-ac51e031bd10",
"label": "CASE-00142",
"status": "deidentified",
"archived": false,
"created_at": "2025-01-15T10:30:00.000000Z",
"updated_at": "2025-01-15T10:30:00.000000Z"
}
| 方法 | 路径 | 描述 |
|---|---|---|
GET | /api/v1/cases | 列出病例(可分页、可搜索、可排序) |
POST | /api/v1/cases | 创建病例 |
GET | /api/v1/cases/{patient_id} | 显示病例 |
PUT | /api/v1/cases/{patient_id} | 更新病例 |
DELETE | /api/v1/cases/{patient_id} | 删除病例 |
| 参数 | 类型 | 值 |
|---|---|---|
per_page | integer | 1-100 |
search | string | 最多 255 个字符(搜索标签) |
sort | string | label, created_at, updated_at, date_of_birth |
direction | string | asc, desc |
archived | boolean | true, false |
| 字段 | 类型 | 是否必需(创建) | 备注 |
|---|---|---|---|
label | string | 是 | 最多 255 个字符 |
sex | string | 否 | male, female, other, unknown |
date_of_birth | string | 否 | 日期格式,必须早于今天 |
研究嵌套在患者之下。每个研究代表一项医学影像研究(例如 CT 扫描、MRI、X 光)。
| 方法 | 路径 | 描述 |
|---|---|---|
GET | /api/v1/patients/{patient_id}/studies | 列出患者的研究 |
POST | /api/v1/patients/{patient_id}/studies | 创建研究 |
GET | /api/v1/patients/{patient_id}/studies/{id} | 检索研究 |
PUT | /api/v1/patients/{patient_id}/studies/{id} | 更新研究 |
DELETE | /api/v1/patients/{patient_id}/studies/{id} | 删除研究 |
所有列表端点都使用 Laravel 风格的分页返回分页响应:
{
"data": [ ... ],
"links": {
"first": "https://au.aurabox.cloud/api/v1/patients?page=1",
"last": "https://au.aurabox.cloud/api/v1/patients?page=5",
"prev": null,
"next": "https://au.aurabox.cloud/api/v1/patients?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"per_page": 25,
"to": 25,
"total": 112
}
}
要进行分页,请跟随 links.next 的 URL 或递增 page 查询参数。
import requests
import os
BASE_URL = "https://au.aurabox.cloud"
class AuraboxClient:
"""Client for the Aurabox REST API."""
def __init__(self, api_key: str):
self.base_url = BASE_URL
self.session = requests.Session()
self.session.headers.update({
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
"Accept": "application/json",
})
def _request(self, method: str, path: str, **kwargs) -> dict:
url = f"{self.base_url}{path}"
response = self.session.request(method, url, **kwargs)
response.raise_for_status()
if response.status_code == 204:
return {}
return response.json()
# --- Patients ---
def list_patients(self, search: str = None, per_page: int = 25,
sort: str = "created_at", direction: str = "desc",
archived: bool = False) -> dict:
params = {"per_page": per_page, "sort": sort,
"direction": direction, "archived": archived}
if search:
params["search"] = search
return self._request("GET", "/api/v1/patients", params=params)
def get_patient(self, patient_id: str) -> dict:
return self._request("GET", f"/api/v1/patients/{patient_id}")
def create_patient(self, given_names: str, family_name: str,
date_of_birth: str, sex: str,
address: dict = None) -> dict:
body = {
"given_names": given_names,
"family_name": family_name,
"date_of_birth": date_of_birth,
"sex": sex,
}
if address:
body["address"] = address
return self._request("POST", "/api/v1/patients", json=body)
def update_patient(self, patient_id: str, **fields) -> dict:
return self._request("PUT", f"/api/v1/patients/{patient_id}", json=fields)
def delete_patient(self, patient_id: str) -> dict:
return self._request("DELETE", f"/api/v1/patients/{patient_id}")
# --- Cases (de-identified patients) ---
def list_cases(self, search: str = None, per_page: int = 25,
sort: str = "created_at", direction: str = "desc",
archived: bool = False) -> dict:
params = {"per_page": per_page, "sort": sort,
"direction": direction, "archived": archived}
if search:
params["search"] = search
return self._request("GET", "/api/v1/cases", params=params)
def get_case(self, case_id: str) -> dict:
return self._request("GET", f"/api/v1/cases/{case_id}")
def create_case(self, label: str, sex: str = None,
date_of_birth: str = None) -> dict:
body = {"label": label}
if sex:
body["sex"] = sex
if date_of_birth:
body["date_of_birth"] = date_of_birth
return self._request("POST", "/api/v1/cases", json=body)
def update_case(self, case_id: str, **fields) -> dict:
return self._request("PUT", f"/api/v1/cases/{case_id}", json=fields)
def delete_case(self, case_id: str) -> dict:
return self._request("DELETE", f"/api/v1/cases/{case_id}")
# --- Studies (nested under patients) ---
def list_studies(self, patient_id: str) -> dict:
return self._request("GET", f"/api/v1/patients/{patient_id}/studies")
def get_study(self, patient_id: str, study_id: str) -> dict:
return self._request("GET",
f"/api/v1/patients/{patient_id}/studies/{study_id}")
def create_study(self, patient_id: str, **fields) -> dict:
return self._request("POST",
f"/api/v1/patients/{patient_id}/studies", json=fields)
def update_study(self, patient_id: str, study_id: str, **fields) -> dict:
return self._request("PUT",
f"/api/v1/patients/{patient_id}/studies/{study_id}", json=fields)
def delete_study(self, patient_id: str, study_id: str) -> dict:
return self._request("DELETE",
f"/api/v1/patients/{patient_id}/studies/{study_id}")
# --- Pagination helper ---
def paginate(self, method, *args, **kwargs):
"""Iterate through all pages of a paginated endpoint."""
response = method(*args, **kwargs)
while True:
yield from response.get("data", [])
next_url = response.get("links", {}).get("next")
if not next_url:
break
response = self.session.get(next_url).json()
# Usage
client = AuraboxClient(api_key=os.environ["AURABOX_API_KEY"])
patients = client.list_patients(search="Jones")
const AURABOX_BASE_URL = "https://au.aurabox.cloud";
class AuraboxClient {
private baseUrl: string;
private headers: Record<string, string>;
constructor(apiKey: string) {
this.baseUrl = AURABOX_BASE_URL;
this.headers = {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
Accept: "application/json",
};
}
private async request<T>(
method: string,
path: string,
options?: { body?: unknown; params?: Record<string, unknown> },
): Promise<T> {
let url = `${this.baseUrl}${path}`;
if (options?.params) {
const searchParams = new URLSearchParams();
for (const [key, value] of Object.entries(options.params)) {
if (value !== undefined && value !== null) {
searchParams.set(key, String(value));
}
}
const qs = searchParams.toString();
if (qs) url += `?${qs}`;
}
const response = await fetch(url, {
method,
headers: this.headers,
body: options?.body ? JSON.stringify(options.body) : undefined,
});
if (!response.ok) {
throw new Error(`Aurabox API error: ${response.status} ${response.statusText}`);
}
if (response.status === 204) return {} as T;
return response.json();
}
// Patients
listPatients(params?: ListParams) {
return this.request<PaginatedResponse<Patient>>("GET", "/api/v1/patients", { params });
}
getPatient(id: string) {
return this.request<{ data: Patient }>("GET", `/api/v1/patients/${id}`);
}
createPatient(patient: CreatePatient) {
return this.request<{ data: Patient }>("POST", "/api/v1/patients", { body: patient });
}
updatePatient(id: string, fields: Partial<CreatePatient>) {
return this.request<{ data: Patient }>("PUT", `/api/v1/patients/${id}`, { body: fields });
}
deletePatient(id: string) {
return this.request<void>("DELETE", `/api/v1/patients/${id}`);
}
// Cases
listCases(params?: ListParams) {
return this.request<PaginatedResponse<Case>>("GET", "/api/v1/cases", { params });
}
getCase(id: string) {
return this.request<{ data: Case }>("GET", `/api/v1/cases/${id}`);
}
createCase(caseData: CreateCase) {
return this.request<{ data: Case }>("POST", "/api/v1/cases", { body: caseData });
}
// Studies
listStudies(patientId: string) {
return this.request<PaginatedResponse<Study>>("GET",
`/api/v1/patients/${patientId}/studies`);
}
getStudy(patientId: string, studyId: string) {
return this.request<{ data: Study }>("GET",
`/api/v1/patients/${patientId}/studies/${studyId}`);
}
}
// Types
interface Patient {
id: string;
given_names: string;
family_name: string;
date_of_birth: string;
sex: "male" | "female" | "other" | "unknown";
address?: Address;
status: string;
archived: boolean;
created_at: string;
updated_at: string;
}
interface Case {
id: string;
label: string;
status: "deidentified";
archived: boolean;
created_at: string;
updated_at: string;
}
interface Study {
id: string;
[key: string]: unknown; // Study fields vary
}
interface Address {
street?: string;
city?: string;
region?: string;
postcode?: string;
country?: string;
}
interface CreatePatient {
given_names: string;
family_name: string;
date_of_birth: string;
sex: "male" | "female" | "other" | "unknown";
address?: Address;
}
interface CreateCase {
label: string;
sex?: "male" | "female" | "other" | "unknown";
date_of_birth?: string;
}
interface ListParams {
per_page?: number;
search?: string;
sort?: string;
direction?: "asc" | "desc";
archived?: boolean;
}
interface PaginatedResponse<T> {
data: T[];
links: { first: string; last: string; prev: string | null; next: string | null };
meta: { current_page: number; from: number; last_page: number; per_page: number; to: number; total: number };
}
# List patients
curl -s "https://au.aurabox.cloud/api/v1/patients" \
-H "Authorization: Bearer $AURABOX_API_KEY" \
-H "Accept: application/json" | jq
# Create a case
curl -s -X POST "https://au.aurabox.cloud/api/v1/cases" \
-H "Authorization: Bearer $AURABOX_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"label": "STUDY-2025-001"}' | jq
# Get studies for a patient
curl -s "https://au.aurabox.cloud/api/v1/patients/{patient_id}/studies" \
-H "Authorization: Bearer $AURABOX_API_KEY" \
-H "Accept: application/json" | jq
API 返回标准的 HTTP 状态码:
| 代码 | 含义 |
|---|---|
200 | 成功 |
201 | 已创建 |
204 | 已删除(无内容) |
401 | 未授权(API 密钥错误或缺失) |
404 | 未找到 |
422 | 验证错误(检查响应体获取详情) |
429 | 请求频率受限 |
500 | 服务器错误 |
错误响应包含一个 message 字段:
{
"message": "Not found"
}
验证错误包含字段级别的详细信息:
{
"message": "The given data was invalid.",
"errors": {
"given_names": ["The given names field is required."],
"family_name": ["The family name field is required."]
}
}
# Python: paginate through all patients
all_patients = list(client.paginate(client.list_patients))
# Find active patients named "Smith"
results = client.list_patients(search="Smith", archived=False)
# Create cases for a research cohort
import csv
with open("cohort.csv") as f:
for row in csv.DictReader(f):
client.create_case(
label=row["study_id"],
sex=row.get("sex"),
date_of_birth=row.get("dob"),
)
id 字段。patient_id。您无法全局查询研究。date_of_birth 为未来日期。address.country 字段仅接受 ISO 3166-1 alpha-2 代码(例如 au)。每周安装量
0
代码仓库
GitHub 星标数
6
首次出现时间
1970年1月1日
安全审计
Generates correct, working client code for the Aurabox Cloud REST API. Knows the full API surface -- patients, cases, studies -- including authentication, pagination, and error handling. Produces idiomatic code in Python, TypeScript/JavaScript, PHP, and curl.
https://au.aurabox.cloud
All requests require a Bearer token in the Authorization header:
Authorization: Bearer {YOUR_AUTH_KEY}
Content-Type: application/json
Accept: application/json
API keys are generated in the Aurabox web interface. They are scoped to a team realm.
Security : API keys are sensitive. Never commit them to source control. Use environment variables or a secrets manager.
Machine-readable specs are available:
https://au.aurabox.app/docs/openapi.yamlhttps://au.aurabox.app/docs/collection.jsonFull CRUD for patient records within the authenticated team realm.
{
"id": "003fb6c7-a399-46de-8199-ac51e031bd10",
"given_names": "Jessica",
"family_name": "Jones",
"date_of_birth": "1985-06-15",
"sex": "female",
"address": {
"street": "123 Main Street",
"city": "Sydney",
"region": "NSW",
"postcode": "2000",
"country": "au"
},
"status": "active",
"archived": false,
"created_at": "2025-01-15T10:30:00.000000Z",
"updated_at": "2025-01-15T10:30:00.000000Z"
}
| Method | Path | Description |
|---|---|---|
GET | /api/v1/patients | List patients (paginated, searchable, sortable) |
POST | /api/v1/patients | Create a patient |
GET | /api/v1/patients/{id} | Retrieve a patient |
PUT |
| Parameter | Type | Values |
|---|---|---|
per_page | integer | 1-100 |
search | string | Max 255 chars |
sort | string | name, created_at, updated_at, date_of_birth |
| Field | Type | Required (create) | Notes |
|---|---|---|---|
given_names | string | Yes | Max 255 chars |
family_name | string | Yes | Max 255 chars |
date_of_birth | string | Yes | Date format, must be before today |
sex | string | Yes | male, , , |
Cases are patients whose identity has been removed. Only a label and non-identifying metadata are stored.
{
"id": "003fb6c7-a399-46de-8199-ac51e031bd10",
"label": "CASE-00142",
"status": "deidentified",
"archived": false,
"created_at": "2025-01-15T10:30:00.000000Z",
"updated_at": "2025-01-15T10:30:00.000000Z"
}
| Method | Path | Description |
|---|---|---|
GET | /api/v1/cases | List cases (paginated, searchable, sortable) |
POST | /api/v1/cases | Create a case |
GET | /api/v1/cases/{patient_id} | Show a case |
PUT |
| Parameter | Type | Values |
|---|---|---|
per_page | integer | 1-100 |
search | string | Max 255 chars (searches label) |
sort | string | label, created_at, updated_at, date_of_birth |
| Field | Type | Required (create) | Notes |
|---|---|---|---|
label | string | Yes | Max 255 chars |
sex | string | No | male, female, other, unknown |
date_of_birth |
Studies are nested under patients. Each study represents a medical imaging study (e.g., a CT scan, MRI, X-ray).
| Method | Path | Description |
|---|---|---|
GET | /api/v1/patients/{patient_id}/studies | List studies for a patient |
POST | /api/v1/patients/{patient_id}/studies | Create a study |
GET | /api/v1/patients/{patient_id}/studies/{id} | Retrieve a study |
PUT |
All list endpoints return paginated responses using Laravel-style pagination:
{
"data": [ ... ],
"links": {
"first": "https://au.aurabox.cloud/api/v1/patients?page=1",
"last": "https://au.aurabox.cloud/api/v1/patients?page=5",
"prev": null,
"next": "https://au.aurabox.cloud/api/v1/patients?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"per_page": 25,
"to": 25,
"total": 112
}
}
To paginate, follow the links.next URL or increment the page query parameter.
import requests
import os
BASE_URL = "https://au.aurabox.cloud"
class AuraboxClient:
"""Client for the Aurabox REST API."""
def __init__(self, api_key: str):
self.base_url = BASE_URL
self.session = requests.Session()
self.session.headers.update({
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
"Accept": "application/json",
})
def _request(self, method: str, path: str, **kwargs) -> dict:
url = f"{self.base_url}{path}"
response = self.session.request(method, url, **kwargs)
response.raise_for_status()
if response.status_code == 204:
return {}
return response.json()
# --- Patients ---
def list_patients(self, search: str = None, per_page: int = 25,
sort: str = "created_at", direction: str = "desc",
archived: bool = False) -> dict:
params = {"per_page": per_page, "sort": sort,
"direction": direction, "archived": archived}
if search:
params["search"] = search
return self._request("GET", "/api/v1/patients", params=params)
def get_patient(self, patient_id: str) -> dict:
return self._request("GET", f"/api/v1/patients/{patient_id}")
def create_patient(self, given_names: str, family_name: str,
date_of_birth: str, sex: str,
address: dict = None) -> dict:
body = {
"given_names": given_names,
"family_name": family_name,
"date_of_birth": date_of_birth,
"sex": sex,
}
if address:
body["address"] = address
return self._request("POST", "/api/v1/patients", json=body)
def update_patient(self, patient_id: str, **fields) -> dict:
return self._request("PUT", f"/api/v1/patients/{patient_id}", json=fields)
def delete_patient(self, patient_id: str) -> dict:
return self._request("DELETE", f"/api/v1/patients/{patient_id}")
# --- Cases (de-identified patients) ---
def list_cases(self, search: str = None, per_page: int = 25,
sort: str = "created_at", direction: str = "desc",
archived: bool = False) -> dict:
params = {"per_page": per_page, "sort": sort,
"direction": direction, "archived": archived}
if search:
params["search"] = search
return self._request("GET", "/api/v1/cases", params=params)
def get_case(self, case_id: str) -> dict:
return self._request("GET", f"/api/v1/cases/{case_id}")
def create_case(self, label: str, sex: str = None,
date_of_birth: str = None) -> dict:
body = {"label": label}
if sex:
body["sex"] = sex
if date_of_birth:
body["date_of_birth"] = date_of_birth
return self._request("POST", "/api/v1/cases", json=body)
def update_case(self, case_id: str, **fields) -> dict:
return self._request("PUT", f"/api/v1/cases/{case_id}", json=fields)
def delete_case(self, case_id: str) -> dict:
return self._request("DELETE", f"/api/v1/cases/{case_id}")
# --- Studies (nested under patients) ---
def list_studies(self, patient_id: str) -> dict:
return self._request("GET", f"/api/v1/patients/{patient_id}/studies")
def get_study(self, patient_id: str, study_id: str) -> dict:
return self._request("GET",
f"/api/v1/patients/{patient_id}/studies/{study_id}")
def create_study(self, patient_id: str, **fields) -> dict:
return self._request("POST",
f"/api/v1/patients/{patient_id}/studies", json=fields)
def update_study(self, patient_id: str, study_id: str, **fields) -> dict:
return self._request("PUT",
f"/api/v1/patients/{patient_id}/studies/{study_id}", json=fields)
def delete_study(self, patient_id: str, study_id: str) -> dict:
return self._request("DELETE",
f"/api/v1/patients/{patient_id}/studies/{study_id}")
# --- Pagination helper ---
def paginate(self, method, *args, **kwargs):
"""Iterate through all pages of a paginated endpoint."""
response = method(*args, **kwargs)
while True:
yield from response.get("data", [])
next_url = response.get("links", {}).get("next")
if not next_url:
break
response = self.session.get(next_url).json()
# Usage
client = AuraboxClient(api_key=os.environ["AURABOX_API_KEY"])
patients = client.list_patients(search="Jones")
const AURABOX_BASE_URL = "https://au.aurabox.cloud";
class AuraboxClient {
private baseUrl: string;
private headers: Record<string, string>;
constructor(apiKey: string) {
this.baseUrl = AURABOX_BASE_URL;
this.headers = {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
Accept: "application/json",
};
}
private async request<T>(
method: string,
path: string,
options?: { body?: unknown; params?: Record<string, unknown> },
): Promise<T> {
let url = `${this.baseUrl}${path}`;
if (options?.params) {
const searchParams = new URLSearchParams();
for (const [key, value] of Object.entries(options.params)) {
if (value !== undefined && value !== null) {
searchParams.set(key, String(value));
}
}
const qs = searchParams.toString();
if (qs) url += `?${qs}`;
}
const response = await fetch(url, {
method,
headers: this.headers,
body: options?.body ? JSON.stringify(options.body) : undefined,
});
if (!response.ok) {
throw new Error(`Aurabox API error: ${response.status} ${response.statusText}`);
}
if (response.status === 204) return {} as T;
return response.json();
}
// Patients
listPatients(params?: ListParams) {
return this.request<PaginatedResponse<Patient>>("GET", "/api/v1/patients", { params });
}
getPatient(id: string) {
return this.request<{ data: Patient }>("GET", `/api/v1/patients/${id}`);
}
createPatient(patient: CreatePatient) {
return this.request<{ data: Patient }>("POST", "/api/v1/patients", { body: patient });
}
updatePatient(id: string, fields: Partial<CreatePatient>) {
return this.request<{ data: Patient }>("PUT", `/api/v1/patients/${id}`, { body: fields });
}
deletePatient(id: string) {
return this.request<void>("DELETE", `/api/v1/patients/${id}`);
}
// Cases
listCases(params?: ListParams) {
return this.request<PaginatedResponse<Case>>("GET", "/api/v1/cases", { params });
}
getCase(id: string) {
return this.request<{ data: Case }>("GET", `/api/v1/cases/${id}`);
}
createCase(caseData: CreateCase) {
return this.request<{ data: Case }>("POST", "/api/v1/cases", { body: caseData });
}
// Studies
listStudies(patientId: string) {
return this.request<PaginatedResponse<Study>>("GET",
`/api/v1/patients/${patientId}/studies`);
}
getStudy(patientId: string, studyId: string) {
return this.request<{ data: Study }>("GET",
`/api/v1/patients/${patientId}/studies/${studyId}`);
}
}
// Types
interface Patient {
id: string;
given_names: string;
family_name: string;
date_of_birth: string;
sex: "male" | "female" | "other" | "unknown";
address?: Address;
status: string;
archived: boolean;
created_at: string;
updated_at: string;
}
interface Case {
id: string;
label: string;
status: "deidentified";
archived: boolean;
created_at: string;
updated_at: string;
}
interface Study {
id: string;
[key: string]: unknown; // Study fields vary
}
interface Address {
street?: string;
city?: string;
region?: string;
postcode?: string;
country?: string;
}
interface CreatePatient {
given_names: string;
family_name: string;
date_of_birth: string;
sex: "male" | "female" | "other" | "unknown";
address?: Address;
}
interface CreateCase {
label: string;
sex?: "male" | "female" | "other" | "unknown";
date_of_birth?: string;
}
interface ListParams {
per_page?: number;
search?: string;
sort?: string;
direction?: "asc" | "desc";
archived?: boolean;
}
interface PaginatedResponse<T> {
data: T[];
links: { first: string; last: string; prev: string | null; next: string | null };
meta: { current_page: number; from: number; last_page: number; per_page: number; to: number; total: number };
}
# List patients
curl -s "https://au.aurabox.cloud/api/v1/patients" \
-H "Authorization: Bearer $AURABOX_API_KEY" \
-H "Accept: application/json" | jq
# Create a case
curl -s -X POST "https://au.aurabox.cloud/api/v1/cases" \
-H "Authorization: Bearer $AURABOX_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"label": "STUDY-2025-001"}' | jq
# Get studies for a patient
curl -s "https://au.aurabox.cloud/api/v1/patients/{patient_id}/studies" \
-H "Authorization: Bearer $AURABOX_API_KEY" \
-H "Accept: application/json" | jq
The API returns standard HTTP status codes:
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
204 | Deleted (no content) |
401 | Unauthorized (bad or missing API key) |
404 | Not found |
422 | Validation error (check response body for details) |
Error responses include a message field:
{
"message": "Not found"
}
Validation errors include field-level detail:
{
"message": "The given data was invalid.",
"errors": {
"given_names": ["The given names field is required."],
"family_name": ["The family name field is required."]
}
}
# Python: paginate through all patients
all_patients = list(client.paginate(client.list_patients))
# Find active patients named "Smith"
results = client.list_patients(search="Smith", archived=False)
# Create cases for a research cohort
import csv
with open("cohort.csv") as f:
for row in csv.DictReader(f):
client.create_case(
label=row["study_id"],
sex=row.get("sex"),
date_of_birth=row.get("dob"),
)
id field from API responses.patient_id in the URL path. You cannot query studies globally.date_of_birth.address.country field accepts ISO 3166-1 alpha-2 codes only (e.g., au).Weekly Installs
0
Repository
GitHub Stars
6
First Seen
Jan 1, 1970
Security Audits
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
73,200 周安装
/api/v1/patients/{id} |
| Update a patient |
DELETE | /api/v1/patients/{id} | Delete a patient |
direction| string |
asc, desc |
archived | boolean | true, false |
femaleotherunknownaddress | object | No | Contains street, city, region, postcode (max 20), country (max 2, ISO) |
/api/v1/cases/{patient_id} |
| Update a case |
DELETE | /api/v1/cases/{patient_id} | Delete a case |
direction |
| string |
asc, desc |
archived | boolean | true, false |
| string |
| No |
| Date format, must be before today |
/api/v1/patients/{patient_id}/studies/{id} |
| Update a study |
DELETE | /api/v1/patients/{patient_id}/studies/{id} | Delete a study |
429| Rate limited |
500 | Server error |