# Record

This document provides details on the endpoints available for managing records within the system. These endpoints facilitate operations such as fetching records, creating new records, updating record information, and deleting records.

**1. Update Records**

* **PUT** `/api/v1/records/{recordUuid}`

Updates existing records.

**Example Request Body:**

```json
{
    "name": "Name Update",
    "value": "Value Update",
    "ttl": 3300
}
```

**Response:**

```json
{
    "timestamp": "2024-08-21T11:55:34.303687703",
    "data": {
        "uuid": "000200ad-54eb-4fbb-9742-1a4ad4e43bdd",
        "type": "SOA",
        "name": "Name Update",
        "value": "Value Update",
        "ttl": 3300,
        "priority": 0,
        "serial": 0,
        "refresh": 0,
        "retry": 0,
        "expire": 0,
        "version": "Version",
        "mname": "MName",
        "rname": "RName",
        "zoneUuid": "381cc903-d838-4e63-b113-e271d57ef2dc"
    }
}
```

&#x20;

**2. Create New Records**

* **POST** `/api/v1/records?zone={zone_uuid}`

Creates new records within a specific zone identified by its UUID.

**Example Request Body:**

```json
[
    {
        "type": "NS",
        "name": "test.ch",
        "value": "ns2.test.ch"
    }
]
```

**Response:**

```json
{
    "timestamp": "2024-04-08T13:53:57.410035779",
    "size": 1,
    "data": [
        {
            "uuid": "765f81b6-3107-4305-9564-bf373ae89001",
            "type": "NS",
            "name": "test.ch",
            "value": "ns2.test.ch",
            "zoneUuid": "000186ee-0d4a-410b-9e5a-5f6782881ceb"
        }
    ]
}
```

**Record types:**

```
A,
AAAA,
MX,
CNAME,
NS,
SOA,
TXT,
PTR,
TOKEN,
PROFILE,
LINK,
OTHER
```

**3. Fetch Record by UUID**

* **GET** `/api/v1/records/{record_uuid}`

Fetches a record by its UUID.

**Response:**

```json
{
    "timestamp": "2024-04-08T10:15:18.761587107",
    "data": {
        "uuid": "00002c83-280a-43f7-9874-ee9076cb6275",
        "type": "SOA",
        "name": "fffffff.com",
        "value": "ns1.fffffff.com hostmaster.fffffff.com 2024030601 3600 600 1209600 86400",
        "zoneUuid": "456548cb-f94f-4b64-8948-7a4b553a80d7",
        "ttl": 3300,
        "serial": 2024030601,
        "refresh": 3600,
        "retry": 600,
        "expire": 1209600,
        "version": "1.0",
        "mname": "ns1.fffffff.com",
        "rname": "hostmaster.fffffff.com"
    }
}
```

**4. Delete Record**

* **DELETE** `/api/v1/records/{record_uuid}`

Deletes a record by its UUID.

**Example Response:**

```json
{}
```


---

# 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/web2-web3-mirroring-api/record.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.
