Create or replace a zone record
curl --request PUT \
--url https://api.crevio.co/v1/zones/{id}/records \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"content": "<string>",
"name": "<string>",
"mode": "<string>",
"ttl": 123,
"priority": 123,
"proxied": true,
"acknowledge_unowned": true
}
'import requests
url = "https://api.crevio.co/v1/zones/{id}/records"
payload = {
"type": "<string>",
"content": "<string>",
"name": "<string>",
"mode": "<string>",
"ttl": 123,
"priority": 123,
"proxied": True,
"acknowledge_unowned": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: '<string>',
content: '<string>',
name: '<string>',
mode: '<string>',
ttl: 123,
priority: 123,
proxied: true,
acknowledge_unowned: true
})
};
fetch('https://api.crevio.co/v1/zones/{id}/records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.crevio.co/v1/zones/{id}/records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'content' => '<string>',
'name' => '<string>',
'mode' => '<string>',
'ttl' => 123,
'priority' => 123,
'proxied' => true,
'acknowledge_unowned' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.crevio.co/v1/zones/{id}/records"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"mode\": \"<string>\",\n \"ttl\": 123,\n \"priority\": 123,\n \"proxied\": true,\n \"acknowledge_unowned\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.crevio.co/v1/zones/{id}/records")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"mode\": \"<string>\",\n \"ttl\": 123,\n \"priority\": 123,\n \"proxied\": true,\n \"acknowledge_unowned\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crevio.co/v1/zones/{id}/records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"mode\": \"<string>\",\n \"ttl\": 123,\n \"priority\": 123,\n \"proxied\": true,\n \"acknowledge_unowned\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"name": "<string>",
"content": "<string>",
"proxied": true,
"locked": true,
"owned": true
}{
"error": {
"type": "invalid_request_error",
"code": "authentication_required",
"message": "You did not provide an API key."
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "The requested resource was not found"
}
}{
"error": {
"type": "validation_error",
"code": "validation_failed",
"message": "Email is required",
"errors": {
"email": [
"can't be blank"
]
}
}
}{
"error": {
"type": "invalid_request_error",
"code": "rate_limit_exceeded",
"message": "Too many requests. Please retry later."
}
}Domains
Create or replace a zone record
Creates a DNS record on a Crevio-managed zone, or replaces the existing record with the same type and name. Records Crevio itself manages are protected: set acknowledge_unowned to overwrite a record that was not created through the API.
PUT
/
zones
/
{id}
/
records
Create or replace a zone record
curl --request PUT \
--url https://api.crevio.co/v1/zones/{id}/records \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"content": "<string>",
"name": "<string>",
"mode": "<string>",
"ttl": 123,
"priority": 123,
"proxied": true,
"acknowledge_unowned": true
}
'import requests
url = "https://api.crevio.co/v1/zones/{id}/records"
payload = {
"type": "<string>",
"content": "<string>",
"name": "<string>",
"mode": "<string>",
"ttl": 123,
"priority": 123,
"proxied": True,
"acknowledge_unowned": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: '<string>',
content: '<string>',
name: '<string>',
mode: '<string>',
ttl: 123,
priority: 123,
proxied: true,
acknowledge_unowned: true
})
};
fetch('https://api.crevio.co/v1/zones/{id}/records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.crevio.co/v1/zones/{id}/records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'content' => '<string>',
'name' => '<string>',
'mode' => '<string>',
'ttl' => 123,
'priority' => 123,
'proxied' => true,
'acknowledge_unowned' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.crevio.co/v1/zones/{id}/records"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"mode\": \"<string>\",\n \"ttl\": 123,\n \"priority\": 123,\n \"proxied\": true,\n \"acknowledge_unowned\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.crevio.co/v1/zones/{id}/records")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"mode\": \"<string>\",\n \"ttl\": 123,\n \"priority\": 123,\n \"proxied\": true,\n \"acknowledge_unowned\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crevio.co/v1/zones/{id}/records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"mode\": \"<string>\",\n \"ttl\": 123,\n \"priority\": 123,\n \"proxied\": true,\n \"acknowledge_unowned\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"name": "<string>",
"content": "<string>",
"proxied": true,
"locked": true,
"owned": true
}{
"error": {
"type": "invalid_request_error",
"code": "authentication_required",
"message": "You did not provide an API key."
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "The requested resource was not found"
}
}{
"error": {
"type": "validation_error",
"code": "validation_failed",
"message": "Email is required",
"errors": {
"email": [
"can't be blank"
]
}
}
}{
"error": {
"type": "invalid_request_error",
"code": "rate_limit_exceeded",
"message": "Too many requests. Please retry later."
}
}Authorizations
API key in the format: Bearer {api_token}
Path Parameters
The zone's ID.
Body
application/json
Was this page helpful?

