curl --request POST \
--url https://api.openmail.sh/v1/owned-domains/{id}/verify \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openmail.sh/v1/owned-domains/{id}/verify"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.openmail.sh/v1/owned-domains/{id}/verify', 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.openmail.sh/v1/owned-domains/{id}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.openmail.sh/v1/owned-domains/{id}/verify"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.openmail.sh/v1/owned-domains/{id}/verify")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmail.sh/v1/owned-domains/{id}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"domain": "<string>",
"status": "pending",
"record": {
"type": "TXT",
"host": "<string>",
"value": "<string>"
},
"verifiedAt": "2023-11-07T05:31:56Z",
"checkedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Verify owned domain
Look up the TXT record now and update status. Call this after publishing the record. A resolver failure leaves the status unchanged rather than marking the domain failed.
curl --request POST \
--url https://api.openmail.sh/v1/owned-domains/{id}/verify \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openmail.sh/v1/owned-domains/{id}/verify"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.openmail.sh/v1/owned-domains/{id}/verify', 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.openmail.sh/v1/owned-domains/{id}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.openmail.sh/v1/owned-domains/{id}/verify"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.openmail.sh/v1/owned-domains/{id}/verify")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmail.sh/v1/owned-domains/{id}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"domain": "<string>",
"status": "pending",
"record": {
"type": "TXT",
"host": "<string>",
"value": "<string>"
},
"verifiedAt": "2023-11-07T05:31:56Z",
"checkedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Re-checked; the returned domain reflects the latest status
Re-checked; the returned domain reflects the latest status
Owned domain ID
The domain your organisation controls, e.g. acme.com. Subdomains are covered too.
pending — added, TXT record not yet seen. verified — recipients on this domain are not metered as cold outreach. failed — the record was verified before and has since disappeared; publish it again and call verify.
pending, verified, failed The one TXT record to publish to prove ownership.
Show child attributes
Show child attributes
When the record was last looked up, whatever the result.
Was this page helpful?