Cancel a Connect Session
Stop a connect link from working
Published
DELETE
/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPAcurl -X DELETE "https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPA" \
-H "Authorization: Bearer <ORSHOT_API_KEY>"const res = await fetch("https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPA", {
method: "DELETE",
headers: {
Authorization: "Bearer <ORSHOT_API_KEY>",
},
});
const data = await res.json();import requests
response = requests.delete(
"https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPA",
headers={"Authorization": "Bearer <ORSHOT_API_KEY>"},
)
data = response.json()$ch = curl_init("https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPA");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <ORSHOT_API_KEY>",
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);require "net/http"
require "json"
uri = URI("https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPA")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer <ORSHOT_API_KEY>"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)Cancel a connect session that has not finished. The link stops working at once, and a login already in progress ends without an account. Sessions that already ended are left as they are. Calling this twice is fine.
Enterprise Only
Same access as Create a Connect Link: enabled per workspace on the Enterprise plan, for the workspace's API keys and first party clients like the Orshot MCP server. Third-party OAuth apps are refused.
Endpoint#
DELETE /social/connect-sessions/:id#
https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPARequest Example#
await fetch(
"https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPA",
{
method: "DELETE",
headers: {
Authorization: "Bearer <ORSHOT_API_KEY>",
},
},
);Response Example#
{
"data": {
"id": "cs_9kq2N0xYv3b8ZtQ1mL7wPA",
"object": "social_connect_session",
"status": "cancelled",
"platform": "instagram",
"completed_at": "2026-11-02T10:03:00.000Z",
"error": { "code": "cancelled", "message": "Cancelled by the API caller." }
}
}The full session object is returned, as in Get a Connect Session.
Error Responses#
| Code | code | Description |
|---|---|---|
| 403 | enterprise_required | Connect links are not enabled for this workspace's plan |
| 403 | first_party_only | The caller is a third-party OAuth app |
| 403 | insufficient_role | The OAuth token's person is not an owner or admin of the workspace |
| 404 | session_not_found | Unknown id or a session of another workspace |
Was this page helpful?
Ready to automate?
Start rendering images, PDFs and videos from your templates in under 2 minutes. Free plan, no credit card.
Get your API key- Image, PDF and video generation via API
- Visual editor with AI and smart layouts
- Zapier, Make, MCP and 40+ integrations
- White-label embed for your own app
- 100 free credits a month, no credit card required