End a session
curl --request DELETE \
--url https://api.phone-harness.com/sessions/{sid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.phone-harness.com/sessions/{sid}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.phone-harness.com/sessions/{sid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"released": true,
"cleanup_pending": false
}{
"released": false,
"cleanup_pending": true
}{
"error": "<string>",
"code": "<string>",
"state": "<string>",
"unsupported": true,
"outcome": "unknown",
"id": "<string>",
"request_key": "<string>",
"cleanup_complete": true,
"balance_cents": 123,
"session": "<string>",
"session_limit": 123,
"active_session_count": 123,
"available_session_slots": 123
}{
"error": "<string>",
"code": "<string>",
"state": "<string>",
"unsupported": true,
"outcome": "unknown",
"id": "<string>",
"request_key": "<string>",
"cleanup_complete": true,
"balance_cents": 123,
"session": "<string>",
"session_limit": 123,
"active_session_count": 123,
"available_session_slots": 123
}{
"error": "<string>",
"code": "<string>",
"state": "<string>",
"unsupported": true,
"outcome": "unknown",
"id": "<string>",
"request_key": "<string>",
"cleanup_complete": true,
"balance_cents": 123,
"session": "<string>",
"session_limit": 123,
"active_session_count": 123,
"available_session_slots": 123
}{
"error": "<string>",
"code": "<string>",
"state": "<string>",
"unsupported": true,
"outcome": "unknown",
"id": "<string>",
"request_key": "<string>",
"cleanup_complete": true,
"balance_cents": 123,
"session": "<string>",
"session_limit": 123,
"active_session_count": 123,
"available_session_slots": 123
}Sessions
End a session
Request closure of an owned session. New API operations stop and billable use ends at recorded closure. Capacity stays occupied until cleanup is confirmed. Repeating after the session is removed may return 404; use the create receipt to confirm cleanup.
DELETE
https://api.phone-harness.com
/
sessions
/
{sid}
End a session
curl --request DELETE \
--url https://api.phone-harness.com/sessions/{sid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.phone-harness.com/sessions/{sid}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.phone-harness.com/sessions/{sid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"released": true,
"cleanup_pending": false
}{
"released": false,
"cleanup_pending": true
}{
"error": "<string>",
"code": "<string>",
"state": "<string>",
"unsupported": true,
"outcome": "unknown",
"id": "<string>",
"request_key": "<string>",
"cleanup_complete": true,
"balance_cents": 123,
"session": "<string>",
"session_limit": 123,
"active_session_count": 123,
"available_session_slots": 123
}{
"error": "<string>",
"code": "<string>",
"state": "<string>",
"unsupported": true,
"outcome": "unknown",
"id": "<string>",
"request_key": "<string>",
"cleanup_complete": true,
"balance_cents": 123,
"session": "<string>",
"session_limit": 123,
"active_session_count": 123,
"available_session_slots": 123
}{
"error": "<string>",
"code": "<string>",
"state": "<string>",
"unsupported": true,
"outcome": "unknown",
"id": "<string>",
"request_key": "<string>",
"cleanup_complete": true,
"balance_cents": 123,
"session": "<string>",
"session_limit": 123,
"active_session_count": 123,
"available_session_slots": 123
}{
"error": "<string>",
"code": "<string>",
"state": "<string>",
"unsupported": true,
"outcome": "unknown",
"id": "<string>",
"request_key": "<string>",
"cleanup_complete": true,
"balance_cents": 123,
"session": "<string>",
"session_limit": 123,
"active_session_count": 123,
"available_session_slots": 123
}Authorizations
Phone Harness account API key (pck_…). The dashboard may use a Clerk session JWT with the same header. Never put an account key in a URL.
Path Parameters
Session ID returned by POST /sessions.