Remove a specialty from the tenant's configuration
DELETE/tenant-specialties/:id
Permanently removes a tenant specialty record from the tenant's configuration. This is a hard delete — the row is removed, not flagged inactive — and cannot be undone.
What it does: Deletes the tenant specialty identified by {id} under the tenant identified by the tenant-id header. If the specialty is still referenced by a practitioner-specialty or facility-specialty association, the delete is rejected by a database-level constraint and surfaces as 400 (see below) rather than succeeding or cascading. Deleting a specialty that is only referenced by a tenant-group-specialty association is not blocked and will leave that association pointing at a deleted record.
When to use: Use this when a specialty is no longer applicable to the tenant and should be removed from all specialty selection surfaces. Verify the specialty is not actively assigned to a practitioner or facility before calling, since the request will otherwise fail. This operation is not idempotent: calling it a second time for the same id returns 404, not another 204.
How to call it: Supply the required tenant-id header and the tenant specialty id as a path segment (an opaque, server-assigned string). Requires the DELETE_TENANT_SPECIALTY permission.
What you get back: Returns 204 with no response body on success. Returns 404 if no specialty with the given id exists for the supplied tenant-id. Returns 400 if the specialty is still referenced by a practitioner-specialty or facility-specialty association.
Request
Responses
- 204
- 400
- 401
- 403
- 404
- 500
The tenant specialty was permanently deleted.
Missing tenant-id header, or the specialty is still referenced by a practitioner-specialty or facility-specialty association and cannot be deleted.
Unauthorized - the request is missing a valid JWT.
Forbidden - the caller lacks the DELETE_TENANT_SPECIALTY permission for this tenant.
No tenant specialty exists with the given id for the supplied tenant-id.
Internal Server Error - an unexpected error occurred while deleting the record.