Get domain owner
Retrieve the domain owner details saved for the account. These details are required before ordering domains and are used to register purchased domains.
Request
Endpoint
GET https://api.woodpecker.co/rest/v2/domains/owner
Headers
x-api-key: {YOUR_API_KEY}
For details on how to authenticate your requests, please see the authentication guide.
Request samples
Retrieve domain owner
- cURL
- Python
- Java
- Node.js
- PHP
curl --request GET \
--url "https://api.woodpecker.co/rest/v2/domains/owner" \
--header "x-api-key: {YOUR_API_KEY}"
import requests
def retrieve_domain_owner():
url = "https://api.woodpecker.co/rest/v2/domains/owner"
headers = {
"x-api-key": "{YOUR_API_KEY}"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
return response.json()
else:
raise Exception(f"GET request failed: {response.status_code}, {response.text}")
if __name__ == "__main__":
try:
data = retrieve_domain_owner()
print("GET response:", data)
except Exception as e:
print("Error:", e)
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class WoodpeckerApiClient {
public static void main(String[] args) {
try {
String url = "https://api.woodpecker.co/rest/v2/domains/owner";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("x-api-key", "{YOUR_API_KEY}")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) {
System.out.println("GET response: " + response.body());
} else {
throw new Exception("GET request failed: " + response.statusCode() + ", " + response.body());
}
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
}
const axios = require('axios');
async function retrieveDomainOwner() {
const url = 'https://api.woodpecker.co/rest/v2/domains/owner';
const headers = {
'x-api-key': '{YOUR_API_KEY}'
};
try {
const response = await axios.get(url, { headers });
console.log('GET response:', response.data);
} catch (error) {
console.error('GET request failed:', error.response ? error.response.status : error.message);
}
}
retrieveDomainOwner();
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
$client = new Client([
'base_uri' => 'https://api.woodpecker.co/rest/v2/',
'headers' => [
'x-api-key' => getenv('WOODPECKER_API_KEY'),
],
]);
try {
$response = $client->get('domains/owner');
echo $response->getStatusCode(), "\n";
echo $response->getBody(), "\n";
} catch (RequestException $e) {
echo "Error: ", $e->getMessage(), "\n";
if ($e->hasResponse()) {
echo $e->getResponse()->getBody(), "\n";
}
}
Response
Response examples
- 200
- 401
- 500
- 503
Request processed successfully. If the account does not have saved owner details yet, the endpoint returns an object with all values set to null
{
"email": "richard@piedpiper.com",
"first_name": "Richard",
"last_name": "Hendricks",
"company_name": "Pied Piper",
"address": "123 Street",
"city": "Palo Alto",
"state": "CA",
"country": "US",
"zip_code": "943032",
"phone": "+1 100 200 3000",
"configuration": {
"default_domain_redirect_url": "https://piedpiper.com",
"default_email_forward_address": "forward@piedpiper.com"
}
}
Body schema
| Field | Type | Description |
|---|---|---|
email | string/null | Owner email address |
first_name | string/null | Owner first name |
last_name | string/null | Owner last name |
company_name | string/null | Company name |
address | string/null | Owner address |
city | string/null | Owner city |
state | string/null | Owner state or region |
country | string/null | Owner country code |
zip_code | string/null | Owner postal code |
phone | string/null | Owner phone number |
configuration | object | Default domain settings |
└─ default_domain_redirect_url | string/null | Default redirect URL for ordered domains |
└─ default_email_forward_address | string/null | Default forwarding address for ordered domains |
Authentication failed. Please review the authentication guide
{
"title": "Unauthorized",
"status": 401,
"details": "error details",
"timestamp": "2026-05-06T12:00:00Z"
}
Body schema
| Field | Type | Description |
|---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
details | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred |
Unexpected server error
{
"title": "Internal Server Error",
"status": 500,
"details": "error details",
"timestamp": "2026-05-06T12:00:00Z"
}
Body schema
| Field | Type | Description |
|---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
details | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred |
Service unavailable or communication error
{
"title": "Service Unavailable",
"status": 503,
"details": "error details",
"timestamp": "2026-05-06T12:00:00Z"
}
Body schema
| Field | Type | Description |
|---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
details | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred |