# Admin API<no value>

Admin endpoints require an admin token (configurable via `--admin-token`).

## Add Instance

```bash
POST /api/v1/admin/instances
```

**Request body:**

```json
{
  "url": "https://my-instance.example.com",
  "type": "searxng",
  "name": "My SearXNG"
}
```

## Update Instance

```bash
PUT /api/v1/admin/instances/:id
```

**Request body** (all fields optional):

```json
{
  "name": "New Name",
  "type": "searxng"
}
```

## Remove Instance

```bash
DELETE /api/v1/admin/instances/:id
```

## Force Health Check

```bash
POST /api/v1/admin/instances/:id/check
```

Triggers an immediate health check for the specified instance. Useful for testing or when you need an up-to-date status immediately.

## Export All Instances

```bash
GET /api/v1/admin/instances/export
```

Returns the full directory as a JSON array. Useful for backups.

## Import Instances

```bash
POST /api/v1/admin/instances/import
```

**Request body:** JSON array of instance objects.

```json
[
  {
    "url": "https://instance-a.example.com",
    "type": "searxng",
    "name": "Instance A"
  },
  {
    "url": "https://instance-b.example.com",
    "type": "invidious",
    "name": "Instance B"
  }
]
```
