Prevail API: Cancel Sessions
Cancel Sessions (Self-Service)
PATCH https://prevail.ai/api/v1/sessions/[:remote_session_id]/cancel
Cancels a Session request submitted by your Organization. The Session must belong to your Organization and be in a state
of initial
, scheduled
, or ready
. Your Organization must have Self-Service enabled to cancel previously scheduled Sessions. Only Prevail Staff can enable Self-Service for your Organization. Set cancel_without_email
to true
to prevent automatic cancellation emails from being sent to Session participants. When cancelled, the Session state
is updated to canceled
Query Parameters
remote_session_id string required
The unique identifier for the Session to cancel.
- Use the GET Sessions endpoint to retrieve a list of Sessions and their
remote_session_id
values.
cancel_without_email boolean optional
Determines whether cancellation email notifications are sent to participants. If assigned the value
true
, participants do not receive cancellation email notifications. If assigned the value false
, participants receive cancellation email notifications. If omitted, the default value is false
. Authorization
Bearer Token {{jwt_signed}}
Authenticates the request. Replace with your access token.
Headers
Content-Type application/json
Specifies the format of the request body.
Accept application/json
Specifies the expected format of the response body.
Example Request
cURL
curl -X PATCH "https://prevail.ai/api/v1/sessions/example_remote_session_id/cancel?cancel_without_email=true" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
JavaScript
// Cancel a session using fetch API
const sessionId = 'example_remote_session_id';
const cancelWithoutEmail = true;
const response = await fetch(
`https://prevail.ai/api/v1/sessions/${sessionId}/cancel?cancel_without_email=${cancelWithoutEmail}`,
{
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
}
);
const data = await response.json();
console.log(data);
Python
import requests
session_id = 'example_remote_session_id'
url = f'https://prevail.ai/api/v1/sessions/{session_id}/cancel'
params = {'cancel_without_email': 'true'}
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.patch(url, headers=headers, params=params)
data = response.json()
print(data)
HTTP
PATCH https://prevail.ai/api/v1/sessions/example_remote_session_id/cancel?cancel_without_email=true
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Accept: application/json
Example Response
Field | Value | Description |
---|---|---|
session_state | initial | Session Request is created and awaiting review by the Prevail Scheduling Team. The session_url and remote_session_id are null . |
session_state | scheduled | Session is scheduled. Applies to Organizations that submit Session requests. The Session join URL and remote_session_id are assigned. |
session_state | ready | Session is scheduled. Applies to self-service Organizations. The Session join URL and remote_session_id are assigned. |
session_state | active | Session is in progress. Participants can join using the Session join URL. |
session_state | canceled | Session was canceled. The Session join URL is disabled and participants can no longer join. |
{
"messages": "Session successfully canceled."
}