EHRbase Admin API

The opt-in administrative surface - 8 paths and 11 operations for physical deletion of EHRs, compositions, directories and stored queries, and for replacing or removing operational templates. Disabled by default and gated on the admin role; every operation declares 401 and 403, and template operations return 422 when compositions still reference the template. These changes are irreversible.

Operations 11

PUT /rest/admin/template/{template_id} #
DELETE /rest/admin/template/{template_id} #
PUT /rest/admin/ehr/{ehr_id} #
DELETE /rest/admin/ehr/{ehr_id} #
PUT /rest/admin/ehr/{ehr_id}/contribution/{contribution_id} #
DELETE /rest/admin/ehr/{ehr_id}/contribution/{contribution_id} Not supported since 2.0.0 #
GET /rest/admin/status #
DELETE /rest/admin/template/all #
DELETE /rest/admin/query/{qualified_query_name}/{version} #
DELETE /rest/admin/ehr/{ehr_id}/directory/{directory_id} #
DELETE /rest/admin/ehr/{ehr_id}/composition/{composition_id} #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/admin-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ehrbase-admin-api-openapi.json Raw ↑
{"openapi":"3.1.0","info":{"title":"EHRbase API","description":"EHRbase implements the [official openEHR REST API](https://specifications.openehr.org/releases/ITS-REST/latest/). Additionally, EHRbase provides a custom `status` heartbeat endpoint, an [Admin API](https://docs.ehrbase.org/docs/EHRbase/Explore/Admin-REST) (if activated) and a [Status and Metrics API](https://docs.ehrbase.org/docs/EHRbase/Explore/Status-And-Metrics) (if activated) for monitoring and maintenance.  Note: The openEHR REST API is documented in their official documentation, not here. Please refer to their separate documentation.","license":{"name":"Apache 2.0","url":"https://github.com/ehrbase/ehrbase/blob/develop/LICENSE.md"},"version":"v1"},"externalDocs":{"description":"EHRbase Documentation","url":"https://docs.ehrbase.org/"},"servers":[{"url":"https://sandkiste.ehrbase.org/ehrbase","description":"Generated server url"}],"paths":{"/rest/admin/template/{template_id}":{"put":{"tags":["Admin - Template"],"operationId":"updateTemplate","parameters":[{"name":"Accept","in":"header","description":"Client should specify expected format","required":false,"schema":{"type":"string","default":"application/xml"}},{"name":"Content-Type","in":"header","description":"Client may request content format","required":true,"schema":{"type":"string"}},{"name":"template_id","in":"path","description":"Target template id to update. The value comes from the 'template_id' property.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/xml":{"schema":{"type":"string","description":"New template content to replace old one with"}}},"required":true},"responses":{"200":{"description":"Template has been updated successfully.","headers":{"Content-Type":{"description":"Format of response","style":"simple"}},"content":{"application/xml":{"schema":{"type":"string"}}}},"401":{"description":"Client credentials are invalid or have expired.","content":{"application/xml":{"schema":{"type":"string"}}}},"403":{"description":"Client has no access permission since admin role is missing.","content":{"application/xml":{"schema":{"type":"string"}}}},"404":{"description":"Template could not be found.","content":{"application/xml":{"schema":{"type":"string"}}}},"422":{"description":"Template could not be replaced since it is used in at least one Composition.","content":{"application/xml":{"schema":{"type":"string"}}}}}},"delete":{"tags":["Admin - Template"],"operationId":"deleteTemplate","parameters":[{"name":"template_id","in":"path","description":"Target template id to delete. The value comes from the 'template_id' property.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Template has been deleted successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"401":{"description":"Client credentials are invalid or have expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"403":{"description":"Client has no access permission since admin role is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"404":{"description":"Template could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"422":{"description":"The template is still used by compositions and cannot be deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}}}}},"/rest/admin/ehr/{ehr_id}":{"put":{"tags":["Admin - EHR"],"operationId":"updateEhr","parameters":[{"name":"Accept","in":"header","description":"Client requested response content type","required":false,"schema":{"type":"string"}},{"name":"ehr_id","in":"path","description":"Target EHR id to update","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"EHR has been updated and number of updated items will be returned in the body.","headers":{"Content-Type":{"description":"Format of response","style":"simple"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}}}},"401":{"description":"Client credentials are invalid or have been expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}}}},"403":{"description":"Client is not permitted to access this resource since the admin role is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}}}},"404":{"description":"EHR with id could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}}}}}},"delete":{"tags":["Admin - EHR"],"operationId":"deleteEhr","parameters":[{"name":"ehr_id","in":"path","description":"Target EHR id to delete","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"EHR has been deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"401":{"description":"Client credentials are invalid or have been expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"403":{"description":"Client is not permitted to access this resource since the admin role is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"404":{"description":"EHR with id could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}}}}},"/rest/admin/ehr/{ehr_id}/contribution/{contribution_id}":{"put":{"tags":["Admin - Contribution"],"operationId":"updateContribution","parameters":[{"name":"ehr_id","in":"path","description":"Target EHR id to update contribution inside.","required":true,"schema":{"type":"string"}},{"name":"contribution_id","in":"path","description":"Target Contribution id to update","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Contribution has been updated successfully.","headers":{"Content-Type":{"description":"Format of response","style":"simple"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}}}},"401":{"description":"Client credentials invalid or have expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}}}},"403":{"description":"Client does not have permission to access since admin role is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}}}},"404":{"description":"EHR or Contribution could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminUpdateResponseData"}}}}}},"delete":{"tags":["Admin - Contribution"],"summary":"Not supported since 2.0.0","operationId":"deleteContribution","parameters":[{"name":"ehr_id","in":"path","description":"Target EHR id to update contribution inside.","required":true,"schema":{"type":"string"}},{"name":"contribution_id","in":"path","description":"Target Contribution id to update","required":true,"schema":{"type":"string"}}],"responses":{"501":{"description":"Contribution delete is not supported since 2.0.0.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}}}}},"/rest/admin/status":{"get":{"tags":["Admin - Heartbeat"],"operationId":"getStatus","responses":{"200":{"description":"Admin API resources available and user has permission to access.","headers":{"Content-Type":{"description":"Format of response","style":"simple"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStatusResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminStatusResponseData"}}}},"401":{"description":"Client credentials are invalid or have expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStatusResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminStatusResponseData"}}}},"403":{"description":"Client has no access permission since the admin role is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStatusResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminStatusResponseData"}}}}}}},"/rest/admin/template/all":{"delete":{"tags":["Admin - Template"],"operationId":"deleteAllTemplates","responses":{"200":{"description":"All templates have been removed successfully","headers":{"Content-Type":{"description":"Format of response","style":"simple"}},"content":{"application/json":{"schema":{"type":"object"}},"application/xml":{"schema":{"type":"object"}}}},"401":{"description":"Client credentials are invalid or have expired.","content":{"application/json":{"schema":{"type":"object"}},"application/xml":{"schema":{"type":"object"}}}},"403":{"description":"Client has no access permission since admin role is missing.","content":{"application/json":{"schema":{"type":"object"}},"application/xml":{"schema":{"type":"object"}}}},"404":{"description":"Template could not be found.","content":{"application/json":{"schema":{"type":"object"}},"application/xml":{"schema":{"type":"object"}}}},"422":{"description":"There are templates that are used by compositions and cannot be removed.","content":{"application/json":{"schema":{"type":"object"}},"application/xml":{"schema":{"type":"object"}}}}}}},"/rest/admin/query/{qualified_query_name}/{version}":{"delete":{"tags":["Admin - Stored-Query"],"operationId":"deleteStoredQuery","parameters":[{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Stored-Query has been deleted successfully"},"401":{"description":"Client credentials are invalid or have expired."},"403":{"description":"Client has no permission to access since admin role is missing."},"404":{"description":"Stored-Query could not be found."}}}},"/rest/admin/ehr/{ehr_id}/directory/{directory_id}":{"delete":{"tags":["Admin - Directory"],"operationId":"deleteDirectory","parameters":[{"name":"ehr_id","in":"path","description":"Target EHR ed to remove Directory from","required":true,"schema":{"type":"string"}},{"name":"directory_id","in":"path","description":"Target Directory id to delete","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Directory has been deleted successfully","headers":{"Content-Type":{"description":"Format of response","style":"simple"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"401":{"description":"Client credentials are invalid or have expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"403":{"description":"Client has no permission to access since admin role is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"404":{"description":"EHR or Directory could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}}}}},"/rest/admin/ehr/{ehr_id}/composition/{composition_id}":{"delete":{"tags":["Admin - Composition"],"operationId":"deleteComposition","parameters":[{"name":"ehr_id","in":"path","description":"Target EHR id to remove composition from","required":true,"schema":{"type":"string"}},{"name":"composition_id","in":"path","description":"Target Composition id to remove","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Composition has been deleted successfully.","headers":{"Content-Type":{"description":"Format of response","style":"simple"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"401":{"description":"Client credentials are invalid or have been expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"403":{"description":"Client has not permission to access this resource since admin role is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}},"404":{"description":"EHR or Composition with id could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AdminDeleteResponseData"}}}}}}}},"components":{"schemas":{"AdminUpdateResponseData":{"type":"object","properties":{"updated":{"type":"integer","format":"int32"}}},"AdminStatusResponseData":{"type":"object","properties":{"message":{"type":"string"}}},"AdminDeleteResponseData":{"type":"object","properties":{"deleted":{"type":"integer","format":"int32"}}}}}}