# Cancel a Connect Session

> Stop a connect link from working

- **URL**: https://orshot.com/docs/api-reference/social-connect-session-cancel

---

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.

Same access as [Create a Connect Link](https://orshot.com/docs/api-reference/social-connect-session-create):
enabled per workspace on the Enterprise plan, for the workspace's API keys and
first party clients like the [Orshot MCP server](https://orshot.com/agents).
Third-party OAuth apps are refused.

## Endpoint

### DELETE /social/connect-sessions/:id

```markdown tab="Endpoint"
https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPA
```

## Request Example

```js
await fetch(
  "https://api.orshot.com/v1/social/connect-sessions/cs_9kq2N0xYv3b8ZtQ1mL7wPA",
  {
    method: "DELETE",
    headers: {
      Authorization: "Bearer <ORSHOT_API_KEY>",
    },
  },
);
```

## Response Example

```json
{
  "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](https://orshot.com/docs/api-reference/social-connect-session-get).

## 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 |