# Revoke one of my sessions

End a single device session on your own account. The device is signed out
server-side: its session row is deactivated **and** its refresh-token families
are revoked, so its next request is rejected whatever the client does with this
response.

Both halves matter. Deactivating the row alone would leave the device holding a
valid refresh token, and it would sign itself straight back in — a dashboard
that reports a lockout which never happened is worse than no dashboard.

## Revoke a session by id

### Path parameters

| Field | Type | Required | Description |
|  --- | --- | --- | --- |
| `session_id` | string | required | The `dsess_…` id from [List my sessions](/docs/api-reference/sessions/list). |


Only your own sessions can be revoked here. An id belonging to anyone else
returns `404`, the same as an id that does not exist — the response does not
reveal that someone else's session is real.

The session issuing this request cannot be revoked here: it returns `422`
with `CURRENT_SESSION_REVOKE_DENIED`. Sign out instead. To keep the current
device and end the rest, use [Revoke all my other sessions](/docs/api-reference/sessions/revoke-all).

### Returns

| Field | Type | Description |
|  --- | --- | --- |
| `revoked` | boolean | True when the session was ended. |
| `session_id` | string | The `dsess_…` id that was revoked. |
| `revoked_count` | integer | `0` here — populated only by the all-others revoke. |


Request

```bash
curl -X DELETE "https://api.aitronos.com/v1/auth/sessions/dsess_31bb70c9d2e14f6a8b90cd12ef34ab56" \
  -H "Authorization: Bearer $FREDDY_TOKEN"
```


```python
# pip install aitronos-sdk
from aitronos import Aitronos

client = Aitronos(api_key="", token="your-bearer-token")

client.auth.revoke_session(session_id="dsess_31bb70c9d2e14f6a8b90cd12ef34ab56")
```


```python
import requests

BASE = "https://api.aitronos.com/v1"
headers = {"Authorization": "Bearer your-bearer-token"}

result = requests.delete(
    f"{BASE}/auth/sessions/dsess_31bb70c9d2e14f6a8b90cd12ef34ab56", headers=headers
).json()
print(result["revoked"])
```


```javascript
const BASE = "https://api.aitronos.com/v1";
const headers = { Authorization: "Bearer your-bearer-token" };

const result = await fetch(
  `${BASE}/auth/sessions/dsess_31bb70c9d2e14f6a8b90cd12ef34ab56`,
  { method: "DELETE", headers },
).then((r) => r.json());
console.log(result.revoked);
```

200 OK

```json
{
  "revoked": true,
  "session_id": "dsess_31bb70c9d2e14f6a8b90cd12ef34ab56",
  "revoked_count": 0
}
```

404 Not Found

```json
{
  "success": false,
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "message": "Session not found",
    "type": "client_error",
    "status": 404,
    "details": {
      "session_id": "dsess_31bb70c9d2e14f6a8b90cd12ef34ab56"
    },
    "trace_id": "req_abc123xyz",
    "timestamp": "2026-08-06T09:14:02Z"
  }
}
```

422 Current session

```json
{
  "success": false,
  "error": {
    "code": "CURRENT_SESSION_REVOKE_DENIED",
    "message": "Cannot end the session you are using. Sign out instead.",
    "system_message": "Cannot revoke the current session. Sign out instead.",
    "type": "validation_error",
    "status": 422,
    "details": {
      "session_id": "dsess_31bb70c9d2e14f6a8b90cd12ef34ab56"
    },
    "trace_id": "req_abc123xyz",
    "timestamp": "2026-08-06T09:14:02Z"
  }
}
```

401 Unauthorized

```json
{
  "success": false,
  "error": {
    "code": "AUTHENTICATION_REQUIRED",
    "message": "Authentication required.",
    "type": "client_error",
    "status": 401,
    "details": {},
    "trace_id": "req_abc123xyz",
    "timestamp": "2026-08-06T09:14:02Z"
  }
}
```

## Use Cases

### **End a session on a device you no longer have**

A lost phone or a shared machine you forgot to sign out of.

### **Act on an unfamiliar entry**

Paired with [List my sessions](/docs/api-reference/sessions/list), this is the one-click response to a
device or location that is not yours.

## Related Resources

- [List my sessions](/docs/api-reference/sessions/list)
- [Revoke all my other sessions](/docs/api-reference/sessions/revoke-all)
- [Revoke a member's session (admin)](/docs/api-reference/sessions/revoke-org)