> For the complete documentation index, see [llms.txt](https://trust-positif.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trust-positif.gitbook.io/docs/api-reference/check-domains.md).

# POST /check — Check domains

Periksa status Nawala untuk satu atau banyak domain.

## Request

```
POST /api/v1/check
```

### Headers

| Header         | Wajib      | Deskripsi                |
| -------------- | ---------- | ------------------------ |
| `Content-Type` | Ya         | `application/json`       |
| `Accept`       | Disarankan | `application/json`       |
| `X-API-Key`    | Tidak      | API key premium/freemium |

### Body (JSON)

| Field     | Tipe   | Wajib | Deskripsi                                                 |
| --------- | ------ | ----- | --------------------------------------------------------- |
| `domains` | string | Ya    | Daftar domain (newline/comma separated), max 10.000 chars |

### Contoh body

```json
{
  "domains": "example.com\ngoogle.co.id\nblocked-site.test"
}
```

## Response sukses

**HTTP 200**

```json
{
  "success": true,
  "results": [
    {
      "Domain": "example.com",
      "Blocked": false
    },
    {
      "Domain": "google.co.id",
      "Blocked": false
    },
    {
      "Domain": "blocked-site.test",
      "Blocked": true
    }
  ],
  "count": 3,
  "stats": {
    "type": "premium",
    "quota": {
      "total": 12500,
      "remaining": 12491,
      "used": 109
    },
    "cost_per_request": 3,
    "period": "monthly",
    "package_name": "Business"
  }
}
```

### Field response

| Field               | Deskripsi                                                       |
| ------------------- | --------------------------------------------------------------- |
| `success`           | Selalu `true` jika HTTP 200                                     |
| `results`           | Array hasil dari Trust Positif (Kominfo)                        |
| `results[].Domain`  | Domain yang dicek                                               |
| `results[].Blocked` | `true` = terblokir Nawala, `false` = aman                       |
| `count`             | Jumlah item di `results`                                        |
| `stats`             | Snapshot kuota setelah request (struktur bervariasi per `type`) |

## Response error

### 422 — Validasi gagal

```json
{
  "success": false,
  "message": "Please provide at least one valid domain to check."
}
```

Penyebab umum:

* `domains` kosong atau tidak ada domain valid setelah parsing
* Lebih dari 100 domain
* String `domains` > 10.000 karakter

### 401 — API key invalid

```json
{
  "success": false,
  "message": "Invalid API key."
}
```

### 403 — IP tidak di whitelist

```json
{
  "success": false,
  "message": "IP address 203.0.113.1 is not whitelisted for this API key.",
  "code": 403,
  "whitelisted_ips": ["198.51.100.10"]
}
```

### 402 — Paket / kuota habis

```json
{
  "success": false,
  "message": "Monthly package limit exceeded. You have 2 remaining quota this month. Required: 6.",
  "code": 429,
  "quota": {
    "limit": 12500,
    "used": 12498,
    "remaining": 2,
    "required": 6,
    "type": "package",
    "package_name": "Business"
  }
}
```

### 429 — Limit harian / rate limit kuota

Freemium harian exceeded:

```json
{
  "success": false,
  "message": "Daily limit exceeded. You can check 5 more domain(s) today.",
  "code": 429,
  "rate_limit": {
    "limit": 100,
    "used": 95,
    "remaining": 5
  }
}
```

### 500 — Upstream / server error

```json
{
  "success": false,
  "message": "An error occurred while checking domains."
}
```

Atau pesan error dari server jika pengecekan gagal.

## Batas waktu

Request dapat memakan waktu hingga **60 detik** untuk batch besar (hingga 100 domain).
