🌐Zone

The Zone Controller API handles DNS zone management, enabling actions like creation, updates, transfers, and detailed searches.

1. Fetch Zone Details

  • GET /api/v1/zones/{uuid}

  • Obtain details of a specific zone by its UUID.

Request Headers

Name

Description

Authorization

Required: Bearer Token

Path Parameters

Parameter

Type

Description

uuid

string

[Required] The UUID of the zone to fetch.

Response

200 OK

{
    "timestamp": "2024-05-29T08:36:46.576325",
    "data": {
        "uuid": "000d1482-dae2-4e05-aaa1-3988a14a1d5a",
        "status": "OK",
        "name": "selling.cryptocoin",
        "asciiName": "selling.cryptocoin",
        "records": [
            {
                "uuid": "772e7a11-e34c-46a2-99fd-69b2aaa90fb4",
                "type": "NS",
                "name": "@",
                "value": "ns2.noto.network.",
                "ttl": 21600
            },
            {
                "uuid": "4a3f2431-0e40-4029-8a3e-b5c1bee421c1",
                "type": "A",
                "name": "selling.cryptocoin.",
                "value": "34.22.218.53",
                "ttl": 60
            },
            {
                "uuid": "5ba5deba-c42e-43b1-b322-3139c7d1b865",
                "type": "NS",
                "name": "@",
                "value": "ns1.noto.network.",
                "ttl": 21600
            },
            {
                "uuid": "af1835ef-62aa-41b0-999e-59ec6552733f",
                "type": "A",
                "name": "selling.cryptocoin.",
                "value": "34.22.218.51",
                "ttl": 60
            },
            {
                "uuid": "89a0e534-8a13-4cbd-9100-ac156d93ed0b",
                "type": "A",
                "name": "selling.cryptocoin.",
                "value": "34.22.218.54",
                "ttl": 60
            },
            {
                "uuid": "f66d2d12-a837-4f8c-8db2-27f81fff58de",
                "type": "SOA",
                "name": "selling.cryptocoin.",
                "value": "",
                "ttl": 3600,
                "serial": 2020080302,
                "refresh": 7200,
                "retry": 3600,
                "expire": 1209600,
                "mname": "selling.cryptocoin.",
                "rname": "hostmaster.selling.cryptocoin."
            }
        ],
        "registrar": {
            "name": "Freename",
            "street": "Samstagernstrasse 41",
            "city": "Wollerau",
            "postalCode": "8832",
            "country": "Switzerland",
            "phone": "",
            "email": "info@freename.io",
            "web": "https://freename.io",
            "walletAddress": "0xA1E885789C85FEFc76CC30236608B4A19A77e988"
        },
        "registrant": {
            "name": "Freename",
            "street": "Samstagernstrasse 41",
            "city": "Wollerau",
            "postalCode": "8832",
            "country": "Switzerland",
            "phone": "",
            "email": "info@freename.io",
            "web": "https://freename.io",
            "walletAddress": "0xA1E885789C85FEFc76CC30236608B4A19A77e988"
        }
    }
}

2. Fetch Zones with Pagination

  • GET /api/v1/zones

  • Include query parameters for pagination and sorting: page, pageSize, and sortBy.

  • Example: /api/v1/zones?page=1&pageSize=3&sortBy=created_at

Name

Description

Authorization

Required: Bearer Token

Query Parameters

Parameter

Type

Description

page

integer

The page number to retrieve. Default is 0.

pageSize

integer

The number of zones per page. Default is 25.

sortBy

string

The field to sort zones by. Default is "name".

Response

200 OK

3. Create Zone

  • POST /api/v1/zones

  • Create a new zone with the provided details.

  • Example: /api/v1/zones?mint=false

Request Headers

Name

Description

Authorization

Required: Bearer Token

Query Parameters

Parameter

Type

Description

mint

boolean

[Optional] Indicates whether to mint the zone. Default is false.

Request Body

Response

201 Created

Minting address and chain are mandatory if minting is set to true.

4. Update Zone Status

Modifies the status of a zone identified by the provided UUID. Acceptable statuses include 'OK', 'INACTIVE', 'LOCK', 'PENDING', and 'ERROR'.

  • PATCH /api/v1/zones/{uuid}/?status={new_status}

  • Update the status of a specific zone identified by its UUID.

  • Example: /api/v1/zones/{uuid}/?status=INACTIVE

Request Headers

Name

Description

Authorization

Required: Bearer Token

Path Parameters

Parameter

Type

Description

uuid

string

[Required] The UUID of the zone to modify.

Query Parameters

Parameter

Type

Description

status

string

[Required] The new status of the zone. Acceptable values are 'OK', 'INACTIVE', 'LOCK', 'PENDING', and 'ERROR'.

Response

200 OK

5. Fetch Zones of Logged User

  • GET /api/v1/zones/self

  • Retrieve zones owned by the logged-in user.

  • Example: /api/v1/zones/self?page=1&pageSize=3&sortBy=name

Request Headers

Name

Description

Authorization

Required: Bearer Token

Query Parameters

Parameter

Type

Description

page

integer

The page number to retrieve. Default is 0.

pageSize

integer

The number of zones per page. Default is 25.

sortBy

string

The field to sort zones by. Default is "name".

Response

200 OK

6. Fetch Zone by Name

Given that this endpoint will function as a 'Whois' controller, we can discontinue the use of the custom 'Whois' controller we previously implemented.

  • GET /api/v1/zones/name/{zone_name}

  • Retrieve zone details by its name.

  • Example /api/v1/zones/name/selling.cryptocoin

Request Headers

Name

Description

Authorization

Required: Bearer Token

Path Parameters

Parameter

Type

Description

name

string

[Required] The name of the zone to fetch.

Response

200 OK

7. Check Name Availability

  • GET /api/v1/zones/availability/{zone_name}

  • Check the availability of a zone name.

  • Example: api/v1/zones/availability/selling.cryptocoin

Path Parameters

Parameter

Type

Description

name

string

[Required] The name of the zone to check availability for.

Response

200 OK

8. Transfer Zone

  • PATCH /api/v1/zones/transfer/{uuid}

  • Transfers zone from one registrar/registrant to another by uuid.

Request Headers

Name

Description

Authorization

Required: Bearer Token

Path Parameters

Parameter

Type

Description

uuid

string

[Required] The UUID of the zone to transfer.

Request Body

Response

200 OK

9. Search Zone

  • POST /api/v1/zones/search

  • Fetches zones based on the provided search criteria.

  • Example: /api/v1/zones/search?page=1&pageSize=2&sortBy=zone.created_at

Request Headers

Name

Description

Authorization

Required: Bearer Token

Request Body

Request Body Parameters

Parameter

Type

Description

field

string

The field name to search for (e.g. zone.uuid , registry.name , registrar.postal_code , …)

value

string

The value to search for.

criteria

enum

The criteria type for the search. Possible values: LIKE, NOT_LIKE, EQUAL, NOT_EQUAL, GREATER_THAN, GREATER_EQUAL, LESS_THAN, LESS_EQUAL, IS_NULL, IS_NOT_NULL.

List of fields available to search

Query Parameters

Parameter

Type

Description

page

integer

The page number to retrieve. Default is 0.

pageSize

integer

The number of zones per page. Default is 25.

sortBy

string

The field to sort the results by. Default is 'zone.name'.

Response

200 OK

10. Mint Zone

  • POST /api/v1/zones/minting

  • Starts minting process of a zone

Request Headers

Name

Description

Authorization

Required: Bearer Token

Request Body

Response Body

  1. Check Minting Status

  • GET /api/v1/zones/minting/{zoneName}

This API endpoint allows users to check the status of the minting process for a specific zone identified by its name. By sending a GET request with the zone name as a parameter, the response will indicate the current status of the minting process.

Request Headers

Name

Description

Bearer Token

[Required] The authorization token for accessing the API.

Response

If the status is in PENDING, the transaction hash is not displayed. Once the transaction is COMPLETE, the transaction hash is also provided.

Last updated