Delete session by id
curl --request DELETE \
--url https://app.hipp.health/api/v1/sessions/{sessionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.hipp.health/api/v1/sessions/{sessionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.hipp.health/api/v1/sessions/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.hipp.health/api/v1/sessions/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.hipp.health/api/v1/sessions/{sessionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.hipp.health/api/v1/sessions/{sessionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.hipp.health/api/v1/sessions/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Session deleted successfully"
}{
"error": "Cannot modify or delete a session that has encounters.",
"statusCode": 400
}{
"error": "API key required",
"statusCode": 401
}{
"error": "Access denied",
"statusCode": 403
}{
"error": "Session not found",
"statusCode": 404
}{
"error": "Method not allowed",
"statusCode": 405
}Sessions
Delete Session
Delete a session (appointment) by its public id, scoped to the authenticated organization. A frozen session — one with a non-archived encounter, a non-archived note, or a completed cancellation — cannot be deleted and returns 400. On success, dependent overrides, cancellations and history are removed together with the session.
DELETE
/
v1
/
sessions
/
{sessionId}
Delete session by id
curl --request DELETE \
--url https://app.hipp.health/api/v1/sessions/{sessionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.hipp.health/api/v1/sessions/{sessionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.hipp.health/api/v1/sessions/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.hipp.health/api/v1/sessions/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.hipp.health/api/v1/sessions/{sessionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.hipp.health/api/v1/sessions/{sessionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.hipp.health/api/v1/sessions/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Session deleted successfully"
}{
"error": "Cannot modify or delete a session that has encounters.",
"statusCode": 400
}{
"error": "API key required",
"statusCode": 401
}{
"error": "Access denied",
"statusCode": 403
}{
"error": "Session not found",
"statusCode": 404
}{
"error": "Method not allowed",
"statusCode": 405
}Delete Session
Delete a single session (appointment) by its public id. The session must belong to the organization that owns the API key.Headers
Authorization: Bearer <your-api-key>
Deletion rules
A session can only be deleted when it is not frozen — that is, when it has no recorded clinical work:- Encounters — if the session has any non-archived encounter, deletion is blocked.
- Notes (activities) — if the session has any non-archived activity, deletion is blocked.
- Completed cancellations — if the session has a completed cancellation, deletion is blocked. Cancellations still mid-workflow (pending, searching, etc.) do not block it.
Success Response (200)
{
"message": "Session deleted successfully"
}
Error Responses
400 - Bad Request
Returned when the session is frozen and cannot be deleted because it has recorded clinical work.{
"error": "Cannot modify or delete a session that has encounters.",
"statusCode": 400
}
Cannot modify or delete a session that has notes., and for a completed cancellation it is Cannot modify or delete a session that has a completed cancellation.
An invalid sessionId (for example one containing a null byte) is instead returned as a validation list, where each path is an array of segments:
{
"message": "Validation Error",
"statusCode": 400,
"validationErrors": [
{
"code": "custom",
"path": ["sessionId"],
"message": "sessionId is invalid"
}
]
}
401 - Unauthorized
{
"error": "API key required",
"statusCode": 401
}
403 - Forbidden
{
"error": "Access denied",
"statusCode": 403
}
404 - Not Found
Returned when no session with the given id exists in the organization.{
"error": "Session not found",
"statusCode": 404
}
Examples
cURL
curl -X DELETE "https://app.hipp.health/api/v1/sessions/apt_1a2b3c4d5e" \
-H "Authorization: Bearer your-api-key"
JavaScript
const deleteSession = async (sessionId) => {
const response = await fetch(
`https://app.hipp.health/api/v1/sessions/${sessionId}`,
{
method: "DELETE",
headers: {
Authorization: "Bearer your-api-key",
},
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || error.message || "Failed to delete session");
}
return response.json();
};
// Usage
try {
const result = await deleteSession("apt_1a2b3c4d5e");
console.log(result.message);
} catch (error) {
console.error("Error deleting session:", error.message);
}
Authorizations
API key authentication. Include your API key in the Authorization header as 'Bearer '
Path Parameters
Session public identifier
Minimum string length:
1Response
Session deleted successfully
Example:
"Session deleted successfully"