---
title: "Toggle Service Api"
method: POST
path: "/api/servers/toggle"
tags: ["Server Management"]
---

# Toggle Service Api

`POST /api/servers/toggle`

Toggle a service's enabled/disabled state via JWT authentication (External API).

This endpoint provides the same functionality as POST /api/internal/toggle
but uses modern JWT Bearer token authentication.

**Authentication:** JWT Bearer token (via nginx X-User header)
**Authorization:** Requires valid JWT token from auth system

**Request body (form data):**
- `path` (required): Service path
- `new_state` (required): New state (true=enabled, false=disabled)

**Response:**
Returns the updated service status.

**Example:**
```bash
curl -X POST https://registry.example.com/api/servers/toggle \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -F "path=/myservice" \
  -F "new_state=true"
```

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/ascending-llc/apis/mcp-gateway-registry.md) · [All operations](https://skmtc.net/ascending-llc/apis/mcp-gateway-registry/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ascending-llc/mcp-gateway-registry/versions/31381943e2e7/schema)
