Get Custom Domain

GET /api/v1/custom-domain

Common errors include:

  • "Bad Request" if body parameters are not passed
  • "DNS_CONFIGURATION_ERROR" if custom domain DNS is misconfigured.

This endpoint is for creating a custom domain

Request

Method : GET
Content-Type : Application/json

URL Parameters Schema

domain string
Default: N/A
The main domain (e.g., "example.com")
subDomain string
Default: N/A
Subdomain prefix (e.g., "blog" for "blog.example.com")
Space string
Default: N/A
Must be either “Yes” or “No”
LANGUAGE
REQUEST
 curl -X GET \
  'https://divsly-backend.vercel.app/api/v1/custom-domain' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN_HERE'

API REQUEST
 fetch('https://divsly-backend.vercel.app/api/v1/custom-domain', {
  method: 'GET',
  headers: {
	'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE'
  }
 })
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
API REQUEST
 const getCustomDomain = () => {
  return new Promise((resolve, reject) => {
	fetch('https://divsly-backend.vercel.app/api/v1/custom-domain', {
  	method: 'GET',
  	headers: {
    	'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE'
  	}
	})
  	.then(response => response.json())
  	.then(data => resolve(data))
  	.catch(error => reject(error));
  });
};
API REQUEST
 $ch = curl_init('https://divsly-backend.vercel.app/api/v1/custom-domain');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Authorization: Bearer YOUR_JWT_TOKEN_HERE'
    ));

    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    $result = json_decode($response, true);
    print_r($result);
API REQUEST
 import requests

  url = 'https://divsly-backend.vercel.app/api/v1/custom-domain'
  headers = {
	'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE'
  }

  try:
	response = requests.get(
    	url,
    	headers=headers
	)
	response.raise_for_status()
	print(response.json())
  except requests.exceptions.RequestException as e:
	print(f"Error: {e}")

RESPONSE
 {
  "status": 200,
  "message": "Custom Domains fetched Successfully.",
  "data": [
	{
  	"id": 36,
  	"userId": 89,
  	"domain": "https://testdomain.com",
  	"spare": "Yes",
  	"subDomain": null,
  	"domainUrl": "https://testdomain.com",
  	"status": "Pending",
  	"createdAt": "2025-04-02T04:03:59.254Z",
  	"updatedAt": "2025-04-02T04:03:59.254Z"
	}
  ]
}

   
  {
  "error": true,
  "message": "Unauthorized access",
  "data": null
}



  {
  "success": false,
  "error": “Error fetching Custom domain”
}