# DELETE /api/auth/sessions/:id

Canonical URL: https://developers.iagenify.com/ar/api/auth/revoke-session/
Language: ar

`DELETE https://api.iagenify.com/api/auth/sessions/:id`

أبطل جلسة نشطة واحدة يملكها الحساب المُصادَق عليه.

Status: Bearer أو مفتاح API · إجراء إتلافي · JSON

## طلب HTTP {#http}

```bash
curl https://api.iagenify.com/api/auth/sessions/SESSION_ID \
  -X DELETE \
  -H "Authorization: Bearer $IAGENIFY_TOKEN"
```

## JavaScript {#javascript}

```javascript
const response = await fetch("https://api.iagenify.com/api/auth/sessions/SESSION_ID", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.IAGENIFY_TOKEN}` },
});
const result = await response.json();
if (!response.ok) throw new Error(result.error);
```

## Python {#python}

```python
import os, requests

response = requests.request(
    "DELETE",
    "https://api.iagenify.com/api/auth/sessions/SESSION_ID",
    headers={"Authorization": "Bearer " + os.environ["IAGENIFY_TOKEN"]},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## معلَمة المسار {#path}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `id` | string | مطلوب | معرّف الجلسة المعاد من نقطة نهاية عرض الجلسات. |

## استجابة ناجحة {#response}

```javascript
{ ok: true }
```

## الأخطاء {#errors}

| الرمز | الحالة | المعنى |
| --- | --- | --- |
| session_not_found | 404 | لا تنتمي أي جلسة بهذا المعرّف إلى هذا الحساب. |
