Luna Health API / API Reference / Get webhook configuration Get webhook configuration GET /webhooks/config
Retrieves the current webhook configuration for the organization including URL, enabled status, and subscription events. Does not return the secret key for security reasons.
Code samples Node.js const fetch = require('node-fetch');
async function callApi() {
const apiKey = 'YOUR_API_KEY';
const url = `https://account.lunahealth.app/api/webhooks/config`;
try {
const response = await fetch(url, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
const data = await response.json();
console.log(data);
return data;
} catch (error) {
console.error('Error calling API:', error);
throw error;
}
}
callApi();Python import requests
def call_api():
api_key = 'YOUR_API_KEY'
url = 'https://account.lunahealth.app/api/webhooks/config'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
params = {
}
try:
response = requests.get(
url,
headers=headers,
params=params
)
response.raise_for_status()
data = response.json()
print(data)
return data
except requests.exceptions.RequestException as e:
print(f'Error calling API: {e}')
raise
call_api()Responses Status Description 200Successful response 400Invalid input data 401Authorization not provided 403Insufficient access 404Not found 500Internal server error
200 — Successful responseResponse fields Name Type Required Description idstring No — webhook_urlstring No — has_secret_keyboolean Yes — enabledboolean Yes — send_biomarker_updatesboolean Yes — send_lab_test_updatesboolean Yes — created_atstring No — updated_atstring No —
Example response {
"id": "string",
"webhook_url": "string",
"has_secret_key": true,
"enabled": true,
"send_biomarker_updates": true,
"send_lab_test_updates": true,
"created_at": "string",
"updated_at": "string"
}400 — Invalid input dataResponse fields Name Type Required Description messagestring Yes The error message codestring Yes The error code issuesarray<object> No An array of issues that were responsible for the error
Example response {
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}401 — Authorization not providedResponse fields Name Type Required Description messagestring Yes The error message codestring Yes The error code issuesarray<object> No An array of issues that were responsible for the error
Example response {
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}403 — Insufficient accessResponse fields Name Type Required Description messagestring Yes The error message codestring Yes The error code issuesarray<object> No An array of issues that were responsible for the error
Example response {
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}404 — Not foundResponse fields Name Type Required Description messagestring Yes The error message codestring Yes The error code issuesarray<object> No An array of issues that were responsible for the error
Example response {
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}500 — Internal server errorResponse fields Name Type Required Description messagestring Yes The error message codestring Yes The error code issuesarray<object> No An array of issues that were responsible for the error
Example response {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Open in interactive reference →