Domains
Create Domain
Add a domain and get the DNS records to verify it.
POST
/domainsBody Parameters
namestringrequiredThe domain or subdomain, e.g.
updates.example.com.import { Resend } from 'resend';
const client = new Resend('pw_xxxxxxxxx');
const { data, error } = await client.domains.create({ name: 'updates.example.com' });import requests
res = requests.post(
"https://post-waves.com/domains",
headers={"Authorization": "Bearer pw_xxxxxxxxx"},
json={
"name": "updates.example.com"
},
)
print(res.json())<?php
$ch = curl_init('https://post-waves.com/domains');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer pw_xxxxxxxxx',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'updates.example.com',
]),
]);
$response = json_decode(curl_exec($ch), true);require "net/http"
require "json"
uri = URI("https://post-waves.com/domains")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer pw_xxxxxxxxx"
req["Content-Type"] = "application/json"
req.body = {
name: "updates.example.com"
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"name":"updates.example.com"}`)
req, _ := http.NewRequest("POST", "https://post-waves.com/domains", body)
req.Header.Set("Authorization", "Bearer pw_xxxxxxxxx")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}curl -X POST 'https://post-waves.com/domains' \
-H 'Authorization: Bearer pw_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{"name":"updates.example.com"}'Try itPOST
/domainsNo key yet? Create one in the dashboard.