---
title: dots.v2.actionGateway.sessions.bySession_urn().delete()
description: Delete a Session
product: Reference
url: https://docs.digitalocean.com/reference/dots/reference/action-gateway/sessions-delete/
last_updated: "2026-11-18"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# dots.v2.actionGateway.sessions.bySession_urn().delete()

Generated on 18 Nov 2026 from DoTs version [`v1.25.0`](https://github.com/digitalocean/dots/releases/tag/v1.25.0)

deprecated

## Usage

```typescript
client.v2.actionGateway.sessions.bySession_urn(session_urn).delete(requestConfiguration?: RequestConfiguration<object>): Promise<undefined | Empty_response>
```

## Description

Deprecated: use DELETE /v2/action-gateway/endpoints/{endpoint_id} for endpoints. This route continues to accept legacy session URNs and delete legacy sessions. Deletes the session and its policy. Succeeds without deleting anything when the session does not exist or you cannot delete it, so repeating a delete also succeeds. A malformed `session_urn` is rejected with 400. When the session is a version of an endpoint, this deletes that version, and deleting the endpoint’s last live version also deletes the endpoint. Deleting the last live version with DELETE /v2/action-gateway/endpoint-versions/{version_id} instead keeps the endpoint, with no live version.

## Parameters

`session_urn` string required

Example: `do:managed_agent_session:2b3c9f0e-1a4d-4e5f-8a7b-6c5d4e3f2a1b`

URN of the session, for example `do:managed_agent_session:<uuid>`.

## Request Sample

## Show Request Sample

```typescript
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.actionGateway.sessions
    .bySession_urn("do:managed_agent_session:2b3c9f0e-1a4d-4e5f-8a7b-6c5d4e3f2a1b").delete();
```

## Response Example

## Show Response Example

```json
{}
```

## More Information

See [`/v2/action-gateway/sessions/{session_urn}`](https://docs.digitalocean.com/reference/api/reference/action-gateway/index.html.md#sessions_delete) in the API reference for additional detail on responses, headers, parameters, and more.