curl --request POST \
--url https://offchain-manager.namespace.ninja/api/v1/subnames \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--data '
{
"parentName": "oppunk.eth",
"label": "alice",
"owner": "0x1234...abcd"
}
'import requests
url = "https://offchain-manager.namespace.ninja/api/v1/subnames"
payload = {
"parentName": "oppunk.eth",
"label": "alice",
"owner": "0x1234...abcd"
}
headers = {
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({parentName: 'oppunk.eth', label: 'alice', owner: '0x1234...abcd'})
};
fetch('https://offchain-manager.namespace.ninja/api/v1/subnames', 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://offchain-manager.namespace.ninja/api/v1/subnames",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'parentName' => 'oppunk.eth',
'label' => 'alice',
'owner' => '0x1234...abcd'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>"
],
]);
$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://offchain-manager.namespace.ninja/api/v1/subnames"
payload := strings.NewReader("{\n \"parentName\": \"oppunk.eth\",\n \"label\": \"alice\",\n \"owner\": \"0x1234...abcd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-token", "<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.post("https://offchain-manager.namespace.ninja/api/v1/subnames")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"parentName\": \"oppunk.eth\",\n \"label\": \"alice\",\n \"owner\": \"0x1234...abcd\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://offchain-manager.namespace.ninja/api/v1/subnames")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parentName\": \"oppunk.eth\",\n \"label\": \"alice\",\n \"owner\": \"0x1234...abcd\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123",
"fullName": "alice.oppunk.eth",
"parentName": "oppunk.eth",
"label": "alice",
"texts": {
"email": "alice@example.com"
},
"addresses": {
"ETH": "0x1234...abcd"
},
"metadata": {
"role": "admin"
},
"namehash": "0xabc123...",
"contenthash": "ipfs://Qm..."
}Create or update a subname
Create an offchain ENS subname or update its records and metadata.
curl --request POST \
--url https://offchain-manager.namespace.ninja/api/v1/subnames \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--data '
{
"parentName": "oppunk.eth",
"label": "alice",
"owner": "0x1234...abcd"
}
'import requests
url = "https://offchain-manager.namespace.ninja/api/v1/subnames"
payload = {
"parentName": "oppunk.eth",
"label": "alice",
"owner": "0x1234...abcd"
}
headers = {
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({parentName: 'oppunk.eth', label: 'alice', owner: '0x1234...abcd'})
};
fetch('https://offchain-manager.namespace.ninja/api/v1/subnames', 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://offchain-manager.namespace.ninja/api/v1/subnames",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'parentName' => 'oppunk.eth',
'label' => 'alice',
'owner' => '0x1234...abcd'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>"
],
]);
$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://offchain-manager.namespace.ninja/api/v1/subnames"
payload := strings.NewReader("{\n \"parentName\": \"oppunk.eth\",\n \"label\": \"alice\",\n \"owner\": \"0x1234...abcd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-token", "<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.post("https://offchain-manager.namespace.ninja/api/v1/subnames")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"parentName\": \"oppunk.eth\",\n \"label\": \"alice\",\n \"owner\": \"0x1234...abcd\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://offchain-manager.namespace.ninja/api/v1/subnames")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parentName\": \"oppunk.eth\",\n \"label\": \"alice\",\n \"owner\": \"0x1234...abcd\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123",
"fullName": "alice.oppunk.eth",
"parentName": "oppunk.eth",
"label": "alice",
"texts": {
"email": "alice@example.com"
},
"addresses": {
"ETH": "0x1234...abcd"
},
"metadata": {
"role": "admin"
},
"namehash": "0xabc123...",
"contenthash": "ipfs://Qm..."
}Authorizations
Body
Parent ENS name (e.g., oppunk.eth)
7 - 255"oppunk.eth"
Subname label (e.g., alice if full name is alice.oppunk.eth)
1 - 255"alice"
Text records to set on the subname
Show child attributes
Show child attributes
[
{
"key": "email",
"value": "alice@example.com"
}
]
Address records to set on the subname
Show child attributes
Show child attributes
[{ "coin": 60, "value": "0x1234...abcd" }]
Arbitrary metadata stored offchain or in ENS records
Show child attributes
Show child attributes
[{ "key": "role", "value": "admin" }]
Address of the new subname owner (must be a valid Ethereum address)
"0x1234...abcd"
Contenthash (e.g., for IPFS/IPNS/Skynet)
"ipfs://0xe30101701220eec561a728cb61c29cfae..."
TTL value in seconds
3600
Response
Subname created or updated
Unique identifier of the subname
"123"
Full name of the subname (e.g., alice.oppunk.eth)
"alice.oppunk.eth"
Parent name (e.g., oppunk.eth)
"oppunk.eth"
Label of the subname (e.g., alice)
"alice"
Text records associated with the subname
{ "email": "alice@example.com" }
Address records associated with the subname
{ "ETH": "0x1234...abcd" }
Metadata associated with the subname
{ "role": "admin" }
Namehash of the subname
"0xabc123..."
Content hash of the subname
"ipfs://Qm..."
Was this page helpful?

