Set Domain
This POST route is used to set a domain for a given address.
If the domain doesn't exist it will be created with the api key and admins that match the first domain created by the api key.
If the domain exists and the api key has access the endpoint will overwrite existing domain data.
If the domain doesn't exist it will be created with the api key and admins that match the first domain created by the api key.
If the domain exists and the api key has access the endpoint will overwrite existing domain data.
Parameters
domain
(string): The domain ("testbrand.eth")address
(string): The ethereum address the name points tocontenthash
(string)(Optional): The link for an ipfs or ipns websitetext_records
(object)(Optional): An object containing key-value pairs representing the text records to be set
Example
POST https://namestone.xyz/api/public_v1/set-domain
{
"domain": "example.xyz",
"address": "0x123abc...",
"text_records": {
"com.twitter": "namestonehq",
"com.github":"nftyslobo",
"com.discord":"superslobo",
"url":"https://www.google.com",
"location":"new york",
"description":"APIs are cool",
"avatar":"https://raw.githubusercontent.com/aslobodnik/profile/main/pic.jpeg"
}
}
headers:
{
`Authorization: YOUR_API_KEY`
}
Curl Example
curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: YOUR_API_KEY' \
-d '{
"name": "bob",
"address": "0x123abc...",
"text_records": {
"com.twitter": "namestonehq",
"com.github":"nftyslobo",
"com.discord":"superslobo",
"url":"https://www.google.com",
"location":"new york",
"description":"APIs are cool",
"avatar":"https://raw.githubusercontent.com/aslobodnik/profile/main/pic.jpeg",
}
}' \
https://namestone.xyz/api/public_v1/set-name
Standard Text Records
Standard text records are those that the ens app will show.
- description
- com.discord
- com.github
- com.twitter
- url
- avatar