Learn how to integrate your practice management system with Askara to receive clinical notes automatically when they are generated from audio transcriptions.
When a healthcare professional records an audio consultation in Askara, the system transcribes it and generates a clinical note using AI. Your system can receive these notes automatically via webhook or retrieve them by polling the API.
- Receive notification - Via webhook (push) or polling (pull)
- Retrieve note - Get note content and metadata via API
- Import to your system - Save the note in your database
Webhooks provide real-time notifications when notes are generated. Askara sends an HTTP POST request to your endpoint.
Advantages:
- Real-time synchronization
- No polling overhead
- Efficient resource usage
Endpoint: POST /webhooks
-> API Reference: Create Webhook
{
"url": "https://your-system.com/api/askara/webhook",
"subscriptions": "new_note"
}Fields:
url(required) - Public HTTP(S) URL of your endpointsubscriptions(required) - Comma-separated list of events, as a single string (for examplenew_note,new_document). Do not add spaces around the commas: unknown or malformed event names are ignored without an error.
Webhooks are registered per healthcare professional: the user who authorizes your application registers their own webhook, and receives events only for their own notes. Your OAuth2 client needs the write:webhooks scope.
The webhook is enabled on creation. If you register the same url again with the same account, Askara adds the new subscriptions to the existing webhook instead of creating a second one.
The response contains the webhook uuid and its secret. Store the secret: you need it to verify the signature of every request Askara sends you (see Verify the Webhook Signature).
When a note is generated, Askara sends a POST request to your webhook URL.
Webhook Payload Structure:
{
"events": [{
"id": "note-uuid",
"resource_type": "note",
"action": "new_note",
"metadata": {
"note": {
"uuid": "08b647ed-c4b4-48a6-8095-c907cf44c239",
"content": "Patient presents with...",
"type": "consultation_summary",
"patient": "//api.askara.ai/patients/c4bcc8b5-b828-4dbc-a621-668540cb6812",
"createdAt": "2026-02-24T10:30:00+00:00",
"updatedAt": "2026-02-24T10:30:00+00:00",
"validatedAt": null,
"contentModified": false
}
},
"links": [],
"resource_metadata": {
"user_id": "6ac32d28-7c31-4542-af58-43dd32d6b051",
"organization_id": "73cf49ad-1f17-442e-be53-8ce0327a6063"
}
}],
"meta": {
"webhook_id": "your-webhook-uuid"
}
}patient is a reference to the patient resource (the identifier is the last segment), not an embedded object.
Important:
- Respond with a
2xxstatus within 5 seconds: Askara considers any other answer, or no answer, as a failed delivery - Askara sends each notification once and does not retry a failed delivery (see Retry Behavior), so also poll as described below if you cannot afford to miss a note
- Process the note asynchronously (don't block the response)
- Use the note
uuidfor deduplication
Every webhook request carries a Webhook-Signature header. Its value is the HMAC-SHA256 of the raw request body, keyed with your webhook secret, encoded as a lowercase hexadecimal string (no prefix).
To verify a request:
- Read the raw request body exactly as received, before any JSON parsing.
- Compute
HMAC-SHA256(secret, rawBody)and encode it in hexadecimal. - Compare it with the
Webhook-Signatureheader using a constant-time comparison. Reject the request if they differ.
const crypto = require('crypto');
function isValidAskaraSignature(rawBody, signatureHeader, secret) {
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
const received = Buffer.from(signatureHeader || '', 'utf8');
const computed = Buffer.from(expected, 'utf8');
return received.length === computed.length && crypto.timingSafeEqual(received, computed);
}The signature covers the body only: it contains no timestamp. Use the note uuid to ignore requests you have already processed.
If you need additional data not included in the webhook payload (e.g., associated audio or user information), fetch the full note via API.
Endpoint: GET /notes/{uuid}
If webhooks aren't feasible, poll periodically for new notes.
Endpoint: GET /notes
Useful query parameters:
patient=<patient-uuid>- Filter by patientaudio=<audio-uuid>- Filter by source audiocreatedAt[gte]=2026-02-17- Notes created on or after this date (gt,lt,lteandbetweenare also available)order[createdAt]=desc- Sort by newest first
Recommended polling interval: 30-60 seconds
Askara tries to deliver each webhook once. If your endpoint does not answer within 5 seconds, is unreachable, or answers with a status code outside 2xx, the delivery is recorded as failed and Askara does not retry it automatically.
To make sure you never miss a note:
- keep your endpoint available and answer quickly;
- poll
GET /notesperiodically (see Polling), for example withcreatedAt[gte]set to the date of the last note you imported, to catch the notes whose notification you missed.
To synchronize notes, your OAuth2 client must request this scope:
read:notes- Retrieve note informationwrite:webhooks- Register your webhook
const express = require('express');
const app = express();
// Keep the raw body: the signature is computed on it (see "Verify the Webhook Signature")
app.use(express.json({ verify: (req, _res, buf) => { req.rawBody = buf; } }));
app.post('/api/askara/webhook', async (req, res) => {
if (!isValidAskaraSignature(req.rawBody, req.get('Webhook-Signature'), process.env.ASKARA_WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature');
}
// Respond quickly to avoid timeout
res.status(200).send('OK');
// Process asynchronously
for (const event of req.body.events) {
if (event.action === 'new_note') {
const note = event.metadata.note;
try {
// Import note to your system
await saveToSystem({
uuid: note.uuid,
content: note.content,
patientUuid: note.patient.split('/').pop(), // "patient" is a reference ending with the patient uuid
createdAt: note.createdAt
});
console.log(`Successfully imported note ${note.uuid}`);
} catch (error) {
console.error(`Failed to import note ${note.uuid}:`, error);
}
}
}
});- Validate webhook signatures - Check the
Webhook-Signatureheader on every request (see Verify the Webhook Signature) - Process asynchronously - Don't block webhook responses while processing
- Handle duplicates - Use note UUID to prevent duplicate imports
- Implement idempotency - Same note UUID should produce the same result
- Log failures - Include detailed error information for troubleshooting
- Verify your webhook URL is publicly accessible
- Check that your endpoint responds with a
2xxstatus within 5 seconds - Check that the healthcare professional who owns the note registered a webhook with the
new_notesubscription: events are only sent to the webhook of the note's author - Check that your endpoint is reachable from the internet: Askara does not call URLs that resolve to a private network
- If the problem persists, contact our team with the note
uuidand the approximate time of the event
- Check OAuth2 token hasn't expired
- Verify you have the
read:notesscope - Confirm the audio transcription has completed before expecting a note
- API Reference - Explore all endpoints
- Document Synchronization - Synchronize validated documents
- OAuth2 Authentication - Secure your integration
- Rate Limiting - Understand API limits