Skip to main content

API Documentation

Welcome to the Medbackend API documentation! This guide covers the REST and GraphQL APIs available for extending and integrating with Medbackend.

API Sections

1. Webhooks

Real-time notifications for FHIR operations with HMAC signing, automatic retries, and delivery logging.

Key Features:

  • Pre-request and post-response hooks
  • HMAC-SHA256 request signing
  • Automatic retry with exponential backoff
  • Per-operation URL configuration
  • Comprehensive delivery logging

2. OpenAI-Compatible API

OpenAI-compatible API layer for integrating LLM capabilities into your healthcare applications.

Key Features:

  • Drop-in replacement for OpenAI SDK
  • Automatic FHIR Communication storage
  • Full audit trail for AI interactions
  • Multi-provider support (OpenAI, Anthropic, Azure, Ollama)
  • Streaming support

Quick Start

Authentication

All API requests require authentication via JWT tokens. See the Authentication documentation for setup instructions.

POST /graphql HTTP/1.1
Authorization: Bearer <your-jwt-token>
Content-Type: application/json

Base URL

https://your-medbackend-instance.com/graphql

Common Patterns

GraphQL Queries

query {
# Your query here
}

GraphQL Mutations

mutation {
# Your mutation here
}

Error Handling

API errors follow a consistent format:

{
"errors": [
{
"message": "Error description",
"extensions": {
"code": "ERROR_CODE",
"details": {}
}
}
]
}