Check the DNS record and verify a domain
curl --request POST \
--url https://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/verify \
--header 'Authorization: Bearer <token>'import requests
url = "https://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/verify"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/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://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/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://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/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://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/verify")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/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": "dom_7pW1cX",
"hostname": "courses.example.com",
"status": "pending",
"verification": {
"type": "TXT",
"name": "_segmnt-verify.courses.example.com",
"value": "segmnt-verify=b41c09e2f7a3d6c1"
},
"createdAt": "2023-11-07T05:31:56Z",
"verifiedAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Domains
Check the DNS record and verify a domain
POST
/
v1
/
projects
/
{projectId}
/
domains
/
{domainId}
/
verify
Check the DNS record and verify a domain
curl --request POST \
--url https://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/verify \
--header 'Authorization: Bearer <token>'import requests
url = "https://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/verify"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/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://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/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://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/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://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/verify")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.segmnt.cloud/v1/projects/{projectId}/domains/{domainId}/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": "dom_7pW1cX",
"hostname": "courses.example.com",
"status": "pending",
"verification": {
"type": "TXT",
"name": "_segmnt-verify.courses.example.com",
"value": "segmnt-verify=b41c09e2f7a3d6c1"
},
"createdAt": "2023-11-07T05:31:56Z",
"verifiedAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Authorizations
apiKeysession
Project API key. Server-side only.
Path Parameters
Pattern:
^prj_[A-Za-z0-9]+$Pattern:
^dom_[A-Za-z0-9]+$Response
Check done. status is verified when the TXT record was found, otherwise still pending.
Example:
"dom_7pW1cX"
Lowercase hostname. Playback matches this exact host only (see Playback in the API description); a subdomain needs its own domain.
Example:
"courses.example.com"
Available options:
pending, verified Create this DNS record to prove you own the domain.
Show child attributes
Show child attributes