# Check a domain’s DNS records again

```http
POST /api/sites/{id}/domain/check
```

## Authorization

- **session**: `Authorization: Bearer <token>`. The session token from signing in (or the session cookie in a browser on the same origin).

## Path parameters

- **id** `string` (required)

## Response

**200**: It worked

- **domain** `DomainState` (required)
  - **domain** `string` (required): At most 300 characters
  - **verified** `boolean` (required)
  - **proof** `boolean | null` (required)
  - **pointing** `boolean | null` (required)
  - **checkedAt** `number | null` (required)
  - **records** `array<object>` (required)
    - **type** `"CNAME" | "TXT"`
    - **name** `string`: At most 300 characters
    - **value** `string`: At most 300 characters
  - **addresses** `array<string>` (required)
- **target** `string` (required): At most 300 characters

Other answers:

- **4XX**: Refused, with a message to show the person

## Example request

````tabs
tab: cURL
```bash
curl -X POST 'https://your-hatch-server/api/sites/{id}/domain/check' \
  -H 'Authorization: Bearer <token>'
```

tab: JavaScript
```js
const res = await fetch("https://your-hatch-server/api/sites/{id}/domain/check", {
  method: "POST",
  headers: {
    Authorization: "Bearer <token>",
  },
})
const data = await res.json()
```

tab: Python
```python
import requests

res = requests.request("POST", "https://your-hatch-server/api/sites/{id}/domain/check", headers={"Authorization": "Bearer <token>"})
data = res.json()
```

tab: Go
```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, err := http.NewRequest("POST", "https://your-hatch-server/api/sites/{id}/domain/check", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer <token>")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
```

tab: Ruby
```ruby
require "net/http"

uri = URI('https://your-hatch-server/api/sites/{id}/domain/check')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer <token>'

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(req)
end
puts res.body
```

tab: PHP
```php
<?php

$ch = curl_init('https://your-hatch-server/api/sites/{id}/domain/check');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <token>',
    ],
]);

$response = curl_exec($ch);
echo $response;
```

tab: Java
```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://your-hatch-server/api/sites/{id}/domain/check"))
    .header("Authorization", "Bearer <token>")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```
````

## Example response

````tabs
tab: 200
```json
{
  "domain": {
    "domain": "string",
    "verified": true,
    "proof": true,
    "pointing": true,
    "checkedAt": 0,
    "records": [
      {
        "type": "CNAME",
        "name": "string",
        "value": "string"
      }
    ],
    "addresses": [
      "string"
    ]
  },
  "target": "string"
}
```

tab: 4XX
```json
{
  "message": "string",
  "code": "string",
  "retryable": true,
  "requestId": "string"
}
```
````
