---
title: "Disable a line"
description: "Flip a line's enabled flag to false. Never charges, never rejects on billing."
---

# Disable a line

Turn a line off by setting its `enabled` flag to `false`. The endpoint returns the full line object with the new state.

Disable never charges the reseller and never rejects on billing checks. In `users` billing mode the slot is freed immediately (the active-users count reads live from the users table), so you can re-provision another line in its place right after.

The endpoint does not touch `admin_enabled`. Once a line is disabled here, the reseller UI shows it as off and the streaming engine refuses to authorize new sessions for it.

## Endpoint

`POST https://<your-panel-domain>/panel-api/v1/lines/{id}/disable`

## Authentication

Bearer token in the `Authorization` header. See [Panel API authentication](/docs/?page=panel-api-authentication).

## Required scope

`lines:write`.

## Idempotency

Required. Send an `Idempotency-Key` header on every call. Retrying the same key returns the cached response; a missing header returns `400 missing_idempotency_key`.

## Path parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| `id` | int | The line id to disable. |

## Request body

Empty. Send an empty JSON body `{}` (or no body at all).

## Response

`200 OK` with the full line object. `enabled` will be `false`.

```json
{
  "id": 172504294,
  "username": "u_a1b2c3d4",
  "password": "eb6cb0b6",
  "member_id": 100,
  "exp_date": 1788885054,
  "max_connections": 1,
  "is_trial": false,
  "is_restreamer": false,
  "enabled": false,
  "admin_enabled": true,
  "bouquets": [],
  "created_at": 1786206654
}
```

## Examples

### cURL

```bash
curl -X POST https://<your-panel-domain>/panel-api/v1/lines/172504294/disable \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Idempotency-Key: line-172504294-disable-2026-08-08"
```

### PHP SDK

```php
require __DIR__ . '/api-panel-php-sdk-1.0.0/autoload.php';
use XtreamAI\PanelApi\PanelApiClient;

$client = new PanelApiClient(baseUrl: 'https://<your-panel-domain>', token: '<your-api-key>');
$line = $client->lines->disable(172504294, idempotencyKey: 'line-172504294-disable-2026-08-08');
echo $line->enabled ? 'still enabled' : 'disabled', PHP_EOL;
```

### Python SDK

```python
from xtream_ai_panel_api import PanelApiClient

client = PanelApiClient(base_url="https://<your-panel-domain>", token="<your-api-key>")
line = client.lines.disable(172504294, idempotency_key="line-172504294-disable-2026-08-08")
print(line.enabled)
```

## Errors

| HTTP | Error slug | When it happens | How to fix |
| ---- | ---------- | --------------- | ---------- |
| 400 | `missing_idempotency_key` | The `Idempotency-Key` header was not sent. | Send a per-intent key on every write. |
| 401 | `invalid_key` | Token is unknown, expired, disabled, or deleted. | Check the token or issue a new one. |
| 403 | `insufficient_scope` | Token lacks `lines:write`. | Issue a key with the scope. |
| 404 | `not_found` | The line id does not exist, or a reseller key targeted a line it does not own. | Verify the id and ownership. |
| 409 | `idempotency_conflict` | Same key was reused with a different body. | Use a fresh key. |
| 409 | `idempotency_in_flight` | Same key is still processing. | Retry after a moment. |
| 429 | `rate_limited` | The key hit its per-minute cap. | Back off and retry after `Retry-After` seconds. |

## See also

- [Enable a line](/docs/?page=xai-ref-lines-enable)
- [Update a line](/docs/?page=xai-ref-lines-update) (to move `admin_enabled`)
- [Delete a line](/docs/?page=xai-ref-lines-delete)
- [Panel API lines overview](/docs/?page=xai-ref-lines-list)
