add_domain()

Create a domain.

Signature

add_domain(array $parameters): mixed

Parameters

Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.

Name Description Requirement
domain_name Host name without TLD Required
domain_tld The TLD Required
domain_path The host path in the account, or for a redirect an FQDN or a website builder (optional, examples: /path/, http://example.com with redirect_status, or wbk:wbk000001) Optional
redirect_status Redirect status: 0|301|302|307, 0 = no redirect Optional Default: 0
statistic_version Deprecated since 2026-10-06, ignored Deprecated
statistic_language Deprecated since 2026-10-06, ignored Deprecated
php_version The requested PHP version: 5.X|7.X Optional Default: 7.1
temporary_until Expiration date of the transitional domain as YYYYMMDD; 0 = no expiration Optional Default: 0

PHP example

<?php

// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
    'domain_name' => 'example',
    'domain_tld' => 'com',
    'domain_path' => 'domain-path',
    'redirect_status' => '0',
];

try {
    $client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
    $response = $client->KasApi(json_encode([
        'kas_login' => 'w0123456',
        'kas_auth_type' => 'session',
        'kas_auth_data' => $sessionToken,
        'kas_action' => 'add_domain',
        'KasRequestParams' => $parameters,
    ]));
    print_r($response);
} catch (SoapFault $fault) {
    echo 'Error: ' . $fault->faultstring;
}

Responses and error codes

  • TRUE the action was carried out
  • missing_parameter a required parameter is missing
  • host_is_dummyhost
  • domain_tld_not_allowed
  • redirect_status_syntax_incorrect
  • couldnt_get_kas_ressources
  • domain_path_syntax_incorrect
  • domain_syntax_incorrect
  • hostname_syntax_incorrect
  • hostname_too_long host name longer than 64 characters (RFC 1035 / RFC 1123)
  • hostname_forbidden
  • max_domain_reached
  • account_is_dummyaccount domains cannot be created in this account
  • hostname_exists_as_domain
  • php_version_syntax_incorrect
  • php_version_not_available_on_server
  • temporary_until_syntax_incorrect