# Records

1. **Create New Records**

Creates records using the provided zone and list of record DTOs.

* **POST** `/api/v1/white-label-logic/records?zone={zone_uuid}`

This API endpoint enables the creation of new records within a specific zone identified by its UUID. Users can send a POST request with the desired zone UUID in the URL parameter and provide the details of the new records in the request body. The request body should consist of an array of objects, each representing a record with parameters like type, name, and value.

Upon successful creation, the response will include a timestamp indicating the time of the response, the number of records created (size), and an array of data objects representing the newly created records. Each data object contains details such as the UUID of the record, its type, name, value, and the UUID of the associated zone.

#### Parameters <a href="#parameters" id="parameters"></a>

| **Name**             | **Type** | **Description**          |
| -------------------- | -------- | ------------------------ |
| `authorizationToken` | Header   | The authorization token. |
| `zone`               | Query    | The zone identifier.     |

**Request Body**

```json
[
    {
    "type": "LINK",
    "name": "Test",
    "value": "www.freename.io",
    "ttl": 300
    },
    {
    "type": "SOA",
    "name": "Test2",
    "value": "www.freename.io",
    "ttl": 300
    }
]
```

**Response Body**&#x20;

**201 Created**

```json
{
    "timestamp": "2024-05-29T11:54:16.229586",
    "size": 2,
    "data": [
        {
            "uuid": "1cea6347-ea43-43a6-b307-64cae8ab2a45",
            "type": "LINK",
            "name": "Test",
            "value": "www.freename.io",
            "ttl": 300,
            "zoneUuid": "001b380b-c544-4159-ac03-60e8dbf83f2e"
        },
        {
            "uuid": "fe8ed7ec-e281-46b9-a87d-028b063a7681",
            "type": "SOA",
            "name": "Test2",
            "value": "www.freename.io",
            "ttl": 300,
            "zoneUuid": "001b380b-c544-4159-ac03-60e8dbf83f2e"
        }
    ]
}
```

2. **Fetch Record by UUID**

Fetches a specific record based on the provided record UUID.

* **GET** `/api/v1/white-label-logic/records/{record_uuid}`

#### Parameters <a href="#parameters.1" id="parameters.1"></a>

| **Name**             | **Type** | **Description**                  |
| -------------------- | -------- | -------------------------------- |
| `authorizationToken` | Header   | The authorization token.         |
| `uuid`               | Path     | The UUID of the record to fetch. |

This API endpoint allows users to fetch a record by its unique identifier (UUID). By sending a GET request with the record UUID in the URL parameter, the response will provide details of the requested record.

In the example response provided, the timestamp indicates the time of the response, and the data field contains information about the record, including its UUID, type, name, value, zone UUID (identifying the zone to which the record belongs), time to live (TTL), serial number, refresh interval, retry interval, expire time, version, master name (mname), and responsible person's name (rname).

**Response Body**

**200 OK**

```json
{
    "timestamp": "2024-05-29T11:56:22.049784",
    "data": {
        "uuid": "1cea6347-ea43-43a6-b307-64cae8ab2a45",
        "type": "LINK",
        "name": "Testt",
        "value": "www.freename.io",
        "ttl": 300,
        "zoneUuid": "001b380b-c544-4159-ac03-60e8dbf83f2e"
    }
}
```

3. &#x20;**Update Records**

Updates record details for a given zone.

* **PUT** `/api/v1/white-label-logic/records?record={record_uuid}`

This endpoint allows users to update a single existing record given its uuid. Users need to provide a record along with updated details such as type, name, value, TTL, serial, refresh, retry, expire, version, mname, and rname.

**Request Body**

```json
{
    "name": "Test Update",
    "value": "Test Update",
    "ttl": 0,
    "priority": 0,
    "serial": 0,
    "refresh": 0,
    "retry": 0,
    "expire": 0,
    "version": "",
    "mname": "MName",
    "rname": "RName"
}
```

**Response Body**

**200 OK**

```json
{
    "timestamp": "2024-05-29T11:59:14.616422",
    "data": {
        "uuid": "1cea6347-ea43-43a6-b307-64cae8ab2a45",
        "type": "LINK",
        "name": "Test Update",
        "value": "Test Update",
        "ttl": 0,
        "priority": 0,
        "serial": 0,
        "refresh": 0,
        "retry": 0,
        "expire": 0,
        "version": "",
        "mname": "MName",
        "rname": "RName",
        "zoneUuid": "001b380b-c544-4159-ac03-60e8dbf83f2e"
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://freename-1.gitbook.io/freename-apis/web3-white-label-apis/white-label-controller/records.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
