20i Reseller API
FORMAT: 1A
HOST: https://api.20i.com/
# 20i.com Reseller API
The 20i Reseller API gives you access to all the features and functionality of StackCP, allowing you to create a hosting control panel from scratch or integrate external services such as WHMCS. This is for advanced users and the support we provide for the Reseller API is service-based only.
Where a URL needs an ID, this is typically an ID that you would get in the list method, but for some types alternative references may be supported:
domain: The domain name
package: A domain name on the package
reseller: * to indicate yourself
In general you should use the allocated ID instead as that will be more reliable for cases like moving names between packages.
POSTs to approporiate endpoints can be either plain form (application/x-www-form-urlencoded or multipart/form-data) encoded as with PHP's http_build_query() or a JSON object (application/json).
For example, to add a new web site, a form-style request could look like this:
POST /reseller/*/addWeb HTTP/1.1
Host: api.20i.com
Authorization: Bearer ZTRkNGZkMzFhNTJkY2FlMwo=
Content-Type: application/x-www-form-urlencoded
type=1234&domain_name=example.org&extra_domain_names[]=example.net&documentRoots[example.org]=public_html
Or in JSON:
POST /reseller/*/addWeb HTTP/1.1
Host: api.20i.com
Authorization: Bearer ZTRkNGZkMzFhNTJkY2FlMwo=
Content-Type: application/json
{
"type": "1234",
"domain_name": "example.org",
"extra_domain_names": ["example.net"],
"documentRoots": {
"example.org": "public_html"
}
}
Example Script: This PHP script is an example of how to just get code working and using the 20i Reseller API, download the [20i Module](https://my.20i.com/composer/api-modules-1.0.6.zip) and unzip the archive. Then create a test.php file with the following. When you run this code your should see all your package types dumped to the output window.
<?php
include('lib/TwentyI/API/REST.php');
include('lib/TwentyI/API/Services.php');
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$packageTypes = $services_api->getWithFields("/reseller/*/packageTypes");
trigger_error( print_r($packageTypes,true) );
Account & Settings
Account Balance
/reseller/{resellerId}/accountBalanceGETRetreive Account Balance
The "Retrieve Account Balance" API endpoint allows you to retrieve the balance data of your reseller account in 20i. This API call is used to obtain information about the current available balance in your account.
Upon successful execution of the API call, the response will return an array containing the account balance data, including the current balance available in your reseller account.
Please note that this API endpoint is designed to provide access to the account balance information within the 20i platform. It allows you to retrieve the current available balance, which can be useful for monitoring and managing your reseller account's financial status.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/accountBalance");
resellerIdrequirednumberYour reseller ID.
Authorization: Bearer token
+ Body
{
balance: "string"
}
Reseller Settings
/reseller/{resellerId}POSTSet/Update reseller settings
The "Set/Update reseller settings" API endpoint allows you to update the settings of a reseller account using the 20i API. This API call is used to modify various settings related to the reseller account.
To update the reseller settings, you need to provide the following parameters in the request payload:
malwareEmails: A boolean value indicating whether the reseller has opted into receiving malware-related emails.
malwareEmailsStackCpUsers: A boolean value indicating whether the associated StackCP users of the reseller have opted into receiving malware-related emails.
migrationCompleteEmails: A boolean value indicating whether the reseller has opted into receiving emails notifying them about completed migrations.
domainAutoRenewDefault: A boolean value indicating the default auto-renewal behavior for domains. If set to true, domains will be set to auto-renew; if set to false, domains will be set to cancel upon renewal.
Upon successful execution of the API call, the response will return a boolean value indicating whether any of the settings were successfully saved. If at least one setting was modified and saved, the response will be true.
It's important to note that these settings are specific to the reseller account and will affect the behavior of the associated reseller features and services.
Please ensure that you review the API documentation for more detailed information on the parameters and their usage.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}", [
"malwareEmails" => true,
"malwareEmailsStackCpUsers" => true,
"migrationCompleteEmails" => true,
"domainAutoRenewDefault" => true
]);
resellerIdrequirednumberYour reseller ID.
malwareEmailsrequiredbooleanwhether opted into malware emailsmalwareEmailsStackCpUsersrequiredbooleanwhether opted into malware emails for associated StackCP usersmigrationCompleteEmailsrequiredbooleanWether opted into migration complete emailsdomainAutoRenewDefaultrequiredbooleanTrue to auto renew, false to cancel on renewal
Authorization: Bearer token
+ Body
{
malwareEmails: true,
malwareEmailsStackCpUsers: true,
migrationCompleteEmails: true,
domainAutoRenewDefault: true
}
+ Body
true
Services
/reseller/{resellerId}/serviceChangeDataGETRetrieve Known Service Change Requests
The "Retrieve Known Service Change Requests" API endpoint allows you to retrieve the known service change requests and their current status.
A service change request refers to the process of moving a package from one service level, such as "linux", to another service level, such as "windows".
This API call provides information about the existing service change requests and their relevant details.
The response from this API call will be an array of objects, where each object represents a service change request. Each object contains the following information:
id: The unique identifier of the service change request.
name: The name associated with the service change request.
jobId: The job ID associated with the service change request.
status: The current status of the service change request.
oldServiceLevel: The previous service level of the package.
newServiceLevel: The new service level to which the package is being moved.
packageId: The ID of the package undergoing the service level change.
resellerId: (Optional) The ID of the reseller associated with the service change request.
newPackageBundleTypeId: (Optional) The ID of the new package bundle type.
createdAt: (Optional) The timestamp indicating when the service change request was created.
updatedAt: (Optional) The timestamp indicating the last update time of the service change request.
Please note that this API endpoint is designed to provide access to the known service change requests and their corresponding details within the 20i platform.
It allows you to retrieve information about the service level changes that have been requested or are in progress.
This API endpoint falls under the "Services" section and serves as a means to retrieve the known service change requests and their current status.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/serviceChangeData");
resellerIdrequirednumberYour reseller ID.
Authorization: Bearer token
+ Body
[
{
id: "string",
name: "string",
jobId: "string",
status: "string",
oldServiceLevel: "string",
newServiceLevel: "string",
packageId: "string",
resellerId: "string",
newPackageBundleTypeId: "string",
createdAt: "string",
updatedAt: "string"
}
]
Order & Renew Services
Order Domain Name
/reseller/{resellerId}/addDomainPOSTRegister a Domain Name
Registers a new domain name and charges the registration fee to your account balance.
Domain privacy can be added in the same request via `privacyService`.
**Warning:** Non-ASCII domain names will be rejected. Internationalised
domain names (IDNs) are not supported.
**Note (`.uk` privacy):** For `.uk` domains, `privacyService` is a
chargeable add-on and is distinct from simply suppressing WHOIS disclosure.
**Note (CA domains):** Set `caRegistryAgreement: true` only after the
registry agreements have been presented to and accepted by the registrant.
**Note see contact attribute for extension registry-specific contact data
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addDomain", [
"name" => "string",
"caRegistryAgreement" => true,
"contact" => [
"organisation" => "string",
"name" => "string",
"address" => "string",
"telephone" => "string",
"email" => "string",
"cc" => "string",
"pc" => "string",
"sp" => "string",
"city" => "string",
"extension" => [
"type" => "string",
"trad-name" => "string",
"co-no" => "string",
"language" => "string",
"cro-number" => "string",
"nationality-code" => "string",
"reg_code" => "string",
"country_of_citizenship" => "string",
"eligibility_type" => "string",
"eligibility_name" => "string",
"eligibility_id_type" => "string",
"eligibility_id" => "string",
"registrant_id_type" => "string",
"registrant_id" => "string",
"policy_reason" => "string",
"es_id_type" => "string",
"es_id_number" => "string",
"date_of_birth" => "string",
"registrant_vat_id" => "string",
"registration_number" => "string",
"tax_number" => "string",
"br_register_number" => "string",
"fax" => "string"
]
],
"limits" => [
],
"otherContacts" => [
"(type)" => [
"name" => "string",
"organisation" => "string",
"address" => "string",
"city" => "string",
"sp" => "string",
"pc" => "string",
"cc" => "string",
"telephone" => "string",
"email" => "string",
"extension" => [
]
]
],
"nameservers" => ["string"],
"privacyService" => true,
"stackUser" => "string"
]);
resellerIdrequirednumberYour reseller ID.
namerequiredstringThe domain name to register. Must be ASCII only.caRegistryAgreementoptionalboolean,nullableIf registry agreementshave been shown and agreed tocontactrequiredobjectThis is slightly different from updating domain
contacts, as noted.
- `organisation` (string,required) - As $org when updatingdomain contacts
- `name` (string,required) - As updating domain contacts
- `address` (string,required) - Newline-separated lines withpossible trailling commas. At most 3 lines are
allowed.
- `telephone` (string,required) - As $voice when updatingdomain contacts
- `email` (string,required) - As updating domain contacts
- `cc` (string,required) - As updating domain contacts
- `pc` (string,required) - As updating domain contacts
- `sp` (string,nullable) - As updating domain contacts
- `city` (string,required) - As updating domain contacts
- `extension` (object,nullable) - Registry-specific contact data. Required fields depend on the TLD.
- `type` (string,nullable) - Registrant type. Required for `.uk` family(Nominet: `IND`, `LTD`, `PLC`, `PTNR`, `LLP`, `SCH`, `RCHAR`,
`GOV`, `CRC`, `STAT`, `OTHER`), `.ie` (Titan), and most Tucows
ccTLDs. How the value is forwarded to the registry depends on
the TLD: `.ca` uses `legal_type`; `.au`/`.com.au`/`.org.au` use
`eligibility_type`; `.dk` normalises to `"individual"` or
`"business"`; `.es` uses `es_id_type`; `.us` uses `app_purpose`;
`.cl`, `.de`, `.fi`, `.hu`, `.lv`, `.mx`, `.my`, `.nu`, `.pt`,
`.com.pt`, `.re`, `.ro`, `.com.ro`, `.se`, `.za`, `.co.za` use
`registrant_type`; all other Tucows TLDs use `entity_type`.
- `trad-name` (string,nullable) - (`.uk` family) Trading name whendifferent from the registered organisation name
- `co-no` (string,nullable) - (`.uk` family and Tucows) Companyregistration number. Ignored for Nominet when `type` is `OTHER`.
- `language` (string,nullable) - (`.ie` and Tucows) Language code,e.g. `"EN"`. Uppercased automatically.
- `cro-number` (string,nullable) - (`.ie` and Tucows) CRO number
- `nationality-code` (string,nullable) - (Tucows) Nationality code
- `reg_code` (string,nullable) - (Tucows) Registration code
- `country_of_citizenship` (string,nullable) - (Tucows) Country ofcitizenship
- `eligibility_type` (string,nullable) - (`.au` family) auDA eligibilitycategory
- `eligibility_name` (string,nullable) - (`.au` family) Eligibilityentity name
- `eligibility_id_type` (string,nullable) - (`.au` family) EligibilityID type
- `eligibility_id` (string,nullable) - (`.au` family) Eligibility ID
- `registrant_id_type` (string,nullable) - (`.au` family) RegistrantID type
- `registrant_id` (string,nullable) - (`.au` family) Registrant ID
- `policy_reason` (string,nullable) - (`.au` family) Policy reason code
- `es_id_type` (string,nullable) - (`.es`) Spanish identity document type
- `es_id_number` (string,nullable) - (`.es`) Spanish identity documentnumber
- `date_of_birth` (string,nullable) - (`.fi`) Registrant date of birth
- `registrant_vat_id` (string,nullable) - (`.se`, `.ro`, `.hu`) VAT ID
- `registration_number` (string,nullable) - (`.se`, `.ro`) Companyregistration number
- `tax_number` (string,nullable) - (Tucows) Tax number
- `br_register_number` (string,nullable) - (`.com.br`) CPF or CNPJ
- `fax` (string,nullable) - (`.no` and other Tucows TLDs) Fax number}
+ `limits` (object,nullable) - A limit code to value map, see domain limits
+ `otherContacts` (object,nullable) -
- ``type`` (object,required) - These may be ignored for some transfers.
- `name` (string,required) -
- `organisation` (string,required) -
- `address` (string,required) - Newline-separated lines withpossible trailling commas. At most 3 lines are
allowed.
- `city` (string,required) -
- `sp` (string,required) -
- `pc` (string,required) -
- `cc` (string,required) - Country in ISO3166-alpha2 format
- `telephone` (string,required) -
- `email` (string,required) -
- `extension` (object,nullable) - As updating domain contacts
+ `nameservers` (array[string],nullable) - Nameserver hostnames, eg "ns.example.org". Otherwise you
get defaults.
Ignored for UK transfers.
+ `privacyService` (boolean,required) - If true, this will add domain privacy toyour order. This may not be applicable to some TLDs. Please
note that for .UK this is a chargeable service which is
different from turning off disclosure.
+ `stackUser` (string,nullable) - A stack user to grant access to, eg."stack-user:123"
Authorization: Bearer token
+ Body
{
name: "string",
caRegistryAgreement: true,
contact:{
organisation: "string",
name: "string",
address: "string",
telephone: "string",
email: "string",
cc: "string",
pc: "string",
sp: "string",
city: "string",
extension:{
type: "string",
trad-name: "string",
co-no: "string",
language: "string",
cro-number: "string",
nationality-code: "string",
reg_code: "string",
country_of_citizenship: "string",
eligibility_type: "string",
eligibility_name: "string",
eligibility_id_type: "string",
eligibility_id: "string",
registrant_id_type: "string",
registrant_id: "string",
policy_reason: "string",
es_id_type: "string",
es_id_number: "string",
date_of_birth: "string",
registrant_vat_id: "string",
registration_number: "string",
tax_number: "string",
br_register_number: "string",
fax: "string"
}
},
limits:{
},
otherContacts:{
(type):{
name: "string",
organisation: "string",
address: "string",
city: "string",
sp: "string",
pc: "string",
cc: "string",
telephone: "string",
email: "string",
extension:{
}
}
},
nameservers: ["string"],
privacyService: true,
stackUser: "string"
}
+ Body
true
Order Managed VPS
/reseller/{resellerId}/addManagedVpsPOSTOrder a Managed VPS
Orders a new Managed VPS and charges your account balance.
Returns the new Managed VPS ID on success.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and no service will be created.
**Note:** Valid product spec identifiers and OS codes can be retrieved
from the product catalogue endpoints.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addManagedVps", [
"configuration" => [
"Name" => "string",
"ApplicationId" => "string",
"location" => "string"
],
"options" => [
"os" => "string"
],
"periodMonths" => 1,
"type" => "string",
"forUser" => "string"
]);
resellerIdrequirednumberYour reseller ID.
configurationrequiredobject
- `Name` (string,required) - Display name for the Managed VPS
- `ApplicationId` (string,required) - Application ID to pre-install on provisioning
- `location` (string,required) - Data centre location, e.g. `"dc_location-lhr"`
+ `options` (object,required) -
- `os` (string,required) - Operating system code to install
+ `periodMonths` (number,required) - Billing period. Either `1` (monthly) or `12` (annual).
+ `type` (string,required) - Product spec identifier, e.g. `"web-managedvps1set1"`
+ `forUser` (string,nullable) - Stack user tuple to assign the server to,e.g. `"stack-user:113"`
Authorization: Bearer token
+ Body
{
configuration:{
Name: "string",
ApplicationId: "string",
location: "string"
},
options:{
os: "string"
},
periodMonths: 1,
type: "string",
forUser: "string"
}
+ Body
true
Order MSSQL Databases
/reseller/{resellerId}/addMssqlPOSTOrder an MSSQL Database
Orders one MSSQL database allowance and charges your account balance.
Once ordered, the allowance must be assigned to a hosting package before it can be used.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and no service will be created.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addMssql", [
]);
resellerIdrequirednumberYour reseller ID.
Authorization: Bearer token
+ Body
{
}
+ Body
true
Order Premium Mailbox
/reseller/{resellerId}/addPremiumMailboxPOSTOrder Premium Mailbox
Orders a Premium Mailbox and charges your account balance.
Returns the new mailbox ID on success.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and no service will be created.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addPremiumMailbox", [
"configuration" => [
"id" => "string",
"local" => "string",
"domain" => "string"
],
"forUser" => "string"
]);
resellerIdrequirednumberYour reseller ID.
configurationrequiredobject
- `id` (string,required) - The existing mailbox ID to upgrade, e.g. `"m11111"`
- `local` (string,required) - The local part of the mailbox address (before the `@`)
- `domain` (string,required) - The domain part of the mailbox address (after the `@`)
+ `forUser` (string,nullable) - Stack user tuple to assign the mailbox to,e.g. `"stack-user:123"`
Authorization: Bearer token
+ Body
{
configuration:{
id: "string",
local: "string",
domain: "string"
},
forUser: "string"
}
+ Body
string
Order SSL Certificates
/reseller/{resellerId}/addTlsCertificatePOSTOrder an SSL Certificate
Orders a TLS certificate and charges your account balance.
Returns the new certificate service ID on success.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and no service will be created.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addTlsCertificate", [
"class-code" => "string",
"name" => "string",
"periodMonths" => 1,
]);
resellerIdrequirednumberYour reseller ID.
class-coderequiredstringThe certificate product type. One of:`tucows-rapidssl` (Simple SSL),
`tucows-rapidssl_wildcard` (Wildcard SSL),
`tucows-truebizid_ev` (Extended Validation SSL).
+ `name` (string,required) - The domain name the certificate is for, e.g. `"example.com"`
+ `periodMonths` (number,required) - Certificate duration in months, e.g. `12`
+ `configuration` (object,required) - Additional certificate configuration. Options varyby certificate type — contact your account manager for details.
Authorization: Bearer token
+ Body
{
class-code: "string",
name: "string",
periodMonths: 1,
}
+ Body
string
Order VPS
/reseller/{resellerId}/addVPSPOSTOrder a VPS
Orders a new VPS and charges your account balance. Returns the new VPS ID on success.
If `cpanel` is provided, a cPanel licence is ordered and attached automatically.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and no service will be created.
**Note:** Available OS codes and VPS type identifiers can be retrieved
from the product catalogue endpoints.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addVPS", [
"configuration" => [
"ApplicationId" => "string",
"Name" => "string",
"location" => "string"
],
"forUser" => "string",
"options" => [
"os" => "string"
],
"periodMonths" => 1,
"type" => "string",
"cpanel" => "string"
]);
resellerIdrequirednumberYour reseller ID.
configurationrequiredobject
- `ApplicationId` (string,nullable) - Optional application ID to associate with the VPS.
- `Name` (string,required) - Display name for the VPS, e.g. `"vps-1234"`
- `location` (string,nullable) - Data centre location, e.g. `"dc_location-lhr"` or `"dc_location-dfw"`
+ `forUser` (string,nullable) - Stack user tuple to assign the VPS to, e.g. `"stack-user:588"`
+ `options` (object,required) -
- `os` (string,required) - Operating system code, e.g. `"rhel6"`. OS choice may affect the price.
+ `periodMonths` (number,required) - Contract duration in months
+ `type` (string,required) - VPS product type, e.g. `"vps-e"`
+ `cpanel` (string,nullable) - If set, orders and attaches a cPanel licence. One of:`cpaneladmin`, `cpanelplus`, `cpanelpro`, `cpanelpremier`, `cpanelpremiercloud`.
Authorization: Bearer token
+ Body
{
configuration:{
ApplicationId: "string",
Name: "string",
location: "string"
},
forUser: "string",
options:{
os: "string"
},
periodMonths: 1,
type: "string",
cpanel: "string"
}
+ Body
true
Order Website Turbo Credits
/reseller/{resellerId}/addWebsiteTurboCreditsPOSTOrder Credits
Orders one or more Website Turbo credits and charges your account balance.
Once purchased, credits can be assigned to hosting packages.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and no credits will be created.
**Note:** A maximum of `10` credits can be ordered per request.
Enterprise resellers with invoicing enabled are billed separately.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addWebsiteTurboCredits", [
"quantity" => 1
]);
resellerIdrequirednumberYour reseller ID.
quantityrequirednumberNumber of Website Turbo credits to order. Maximum `10` per request.
Authorization: Bearer token
+ Body
{
quantity: 1
}
+ Body
true
Renew Domain Name
/reseller/{resellerId}/renewDomainPOSTRenew a Domain Name
The "Renew a Domain Name" API endpoint allows you to renew a domain name. This operation charges the appropriate registration fee to your 20i Balance. If you do not have sufficient balance, the renewal will fail.
To use this API, you need to provide the following parameters:
$in: An array containing the following information:
name: The domain name that you want to renew.
years: The number of years for which you want to renew the domain.
renewPrivacy (optional): A boolean value indicating whether to renew the associated privacy for the domain. By default, this parameter is set to false.
The API call will return a boolean value indicating the success or failure of the domain renewal operation. A value of true indicates that the domain was renewed successfully, while false indicates a failure.
It's important to note that this API endpoint charges the registration fee for the domain renewal from your 20i Balance. Therefore, make sure you have sufficient balance before attempting to renew a domain.
This API endpoint is useful when you want to automate the domain renewal process and ensure that your domains are renewed for the desired number of years.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/renewDomain", [
"name" => "string",
"years" => 1,
"renewPrivacy" => true
]);
resellerIdrequirednumberYour reseller ID.
namerequiredstringThe domain nameyearsrequirednumberrenewPrivacyoptionalboolean,nullableRenew the associated privacy. Defaults to false
Authorization: Bearer token
+ Body
{
name: "string",
years: 1,
renewPrivacy: true
}
+ Body
true
Renew Managed VPS
/reseller/{resellerId}/renewManagedVPSPOSTRenew Managed VPS
Renews an existing Managed VPS subscription and charges your account balance.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and the Managed VPS will not be renewed.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/renewManagedVPS", [
"id" => "string",
"periodMonths" => 1
]);
resellerIdrequirednumberYour reseller ID.
idrequiredstringThe ID of the Managed VPS to renewperiodMonthsrequirednumberNumber of months to renew for
Authorization: Bearer token
+ Body
{
id: "string",
periodMonths: 1
}
+ Body
true
Renew MSSQL Databases
/reseller/{resellerId}/renewMssqlPOSTRenew an MSSQL database
The "Renew MSSQL Databases" API endpoint allows you to renew an MSSQL database by providing its ID. This API call is used to extend the validity or registration of an existing MSSQL database.
To renew an MSSQL database, you need to provide the following parameter in the request payload:
id: The ID of the MSSQL database that you want to renew.
Upon successful execution of the API call, the response will return a boolean value indicating the success of the renewal operation. The value true indicates that the MSSQL database was successfully renewed.
Please note that this API endpoint is designed for renewing MSSQL databases with 20i. It handles the renewal process by charging the appropriate fees and verifying the availability of funds in your 20i account.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/renewMssql", [
"id" => "string"
]);
resellerIdrequirednumberYour reseller ID.
idrequiredstring
Authorization: Bearer token
+ Body
{
id: "string"
}
+ Body
true
Renew Premium Mailbox
/reseller/{resellerId}/renewPremiumMailboxPOSTRenew Premium Mailbox
Renews a Premium Mailbox for one year and charges your account balance.
Premium Mailboxes always renew on an annual basis; there is no monthly option.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and the mailbox will not be renewed.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/renewPremiumMailbox", [
"id" => "string"
]);
resellerIdrequirednumberYour reseller ID.
idrequiredstringThe ID of the Premium Mailbox to renew
Authorization: Bearer token
+ Body
{
id: "string"
}
+ Body
true
Renew SSL Certificates
/reseller/{resellerId}/renewTlsCertificatePOSTRenew an SSL Certificate
Renew a certificate.
The "Renew an SSL Certificate" API endpoint allows you to renew an SSL certificate in your 20i account. This API call is used to extend the validity or registration of an existing SSL certificate.
To renew an SSL certificate, you need to provide the following parameters in the request payload:
id: The ID of the SSL certificate that you want to renew.
periodMonths: The number of months for which you want to renew the SSL certificate.
Upon successful execution of the API call, the response will return a boolean value indicating the success of the renewal operation. The value true indicates that the SSL certificate was successfully renewed.
Please note that this API endpoint handles the renewal process by charging the appropriate fee to your 20i Balance.
It checks if you have sufficient funds in your account, and if not, the renewal process will fail. Therefore, it is important to ensure that you have enough balance in your 20i account before making the API call to renew an SSL certificate.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/renewTlsCertificate", [
"id" => "string",
"periodMonths" => 1
]);
resellerIdrequirednumberYour reseller ID.
idrequiredstringperiodMonthsrequirednumber
Authorization: Bearer token
+ Body
{
id: "string",
periodMonths: 1
}
+ Body
true
Renew SSL Certificates
/reseller/{resellerId}/renewTlsCertificatePrePOSTRenew an SSL Certificate
The "Renew an SSL Certificate" API endpoint allows you to renew an SSL certificate with the provided ID for a specified period in months. This operation extends the validity period of the SSL certificate.
To use this API, you need to provide the following parameters:
$in: An array containing the following information:
id: The ID of the SSL certificate that you want to renew.
periodMonths: The number of months for which you want to renew the SSL certificate.
The API call will return a float value or null. The float value represents the new expiration date of the SSL certificate in Unix timestamp format. If the renewal is unsuccessful or there is an error, the API will return null.
It's important to note that this API endpoint will charge the appropriate registration fee to your 20i balance.
If you don't have sufficient funds in your balance, the renewal will fail. Therefore, ensure that you have enough balance to cover the renewal fee before making the API call.
This API endpoint is useful when you want to automate the renewal process for SSL certificates and ensure that they remain valid and secure for an extended period.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/renewTlsCertificatePre", [
"id" => "string",
"periodMonths" => 1
]);
resellerIdrequirednumberYour reseller ID.
idrequiredstringperiodMonthsrequirednumber
Authorization: Bearer token
+ Body
{
id: "string",
periodMonths: 1
}
+ Body
1.99
Renew VPS
/reseller/{resellerId}/renewVPSPOSTRenew VPS
Renews an existing VPS subscription and charges your account balance.
**Warning:** This charges your account balance immediately.
If you have insufficient funds the call will fail and the VPS will not be renewed.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/renewVPS", [
"id" => "string",
"periodMonths" => 1
]);
resellerIdrequirednumberYour reseller ID.
idrequiredstringThe ID of the VPS to renewperiodMonthsrequirednumberNumber of months to renew for
Authorization: Bearer token
+ Body
{
id: "string",
periodMonths: 1
}
+ Body
true
Hosting Packages
Activate/Deactivate domain
/package/{packageId}/domain/{domainId}/userStatusPOSTActivate or deactivate
Activates or deactivates the service.
Possible subservice_name are 'default' for a typical set of services
and 'main' for the core service only.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/userStatus", [
"includeRepeated" => true,
"subservices" => [
"(subservice_name)" => true
]
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
includeRepeatedrequiredbooleanWhen reactivating, if true,this will revoke all your deactivations rather than
just the current one.
+ `subservices` (object,required) -
- ``subservice_name`` (boolean,required) - True to enable, false to disable.
Authorization: Bearer token
+ Body
{
includeRepeated: true,
subservices:{
(subservice_name): true
}
}
+ Body
true
Activate/Deactivate package
/package/{packageId}/userStatusPOSTActivate or deactivate
Activates or deactivates the service.
Possible subservice_name are 'default' for a typical set of services
and 'main' for the core service only.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/userStatus", [
"includeRepeated" => true,
"subservices" => [
"(subservice_name)" => true
]
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
includeRepeatedrequiredbooleanWhen reactivating, if true,this will revoke all your deactivations rather than
just the current one.
+ `subservices` (object,required) -
- ``subservice_name`` (boolean,required) - True to enable, false to disable.
Authorization: Bearer token
+ Body
{
includeRepeated: true,
subservices:{
(subservice_name): true
}
}
+ Body
true
Bandwidth
/package/{packageId}/web/bandwidthStatsGETRetrieve Bandwidth Statistics
Returns hit counts and byte totals grouped by `daily` (last 24 hours),
`monthly` (last 30 days), and `yearly` (last 12 months) periods.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/bandwidthStats");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
daily:{
period: "string",
hits: 1,
bandwidth: 1
},
monthly:{
period: "string",
hits: 1,
bandwidth: 1
},
yearly:{
period: "string",
hits: 1,
bandwidth: 1
}
}
Clear Pending Install
/package/{packageId}/web/clearPendingInstallGETClear Pending Install
Clears any pending install state from this virtual host, allowing a fresh
installation to be started.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/clearPendingInstall");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{}
Contacts
/package/{packageId}/domain/{domainId}/contactsGETRetrieve Contacts for a Domain Name
Returns the current contacts for the domain name. This is a map of
contact types to contact data, in EPP format.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/contacts");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
(contact-type):{
id: "string",
roid: "string",
clID: "string",
crID: "string",
crDate: "string",
trID: "string",
trDate: "string",
upID: "string",
upDate: "string",
status:{
-s: "string",
s: "string"
},
postalInfo:{
-type: "string",
type: "string",
name: "string",
org: "string",
addr:{
street: ["string"],
city: "string",
sp: "string",
pc: "string",
cc: "string"
}
},
voice: "string",
fax: "string",
email: "string",
disclose:{
-flag: true,
name:{
-type: "string"
},
org:{
-type: "string"
},
addr:{
-type: "string"
},
voice: NULL?FIXME,
fax: NULL?FIXME,
email: NULL?FIXME
},
extension:{
dateToSuspend: "string",
trad-name: "string",
type: "string",
co-no: "string",
opt-out: "string",
privacy: "string",
status: "string"
}
}
}
POSTSet Domain Contacts
Updates the contacts for the domain. Pass a map of EPP contact type names
(e.g. `"registrant"`, `"admin"`, `"billing"`, `"tech"`) to contact data
objects in `contactIn` format.
The required `extension` fields depend on the domain's TLD and registry.
**Nominet** (`.uk`, `.co.uk`, `.me.uk`, `.org.uk`, etc.): `type` is required — accepted values are `IND`, `FIND`, `LTD`, `PLC`, `PTNR`, `LLP`, `SCH`, `RCHAR`, `GOV`, `CRC`, `STAT`, `OTHER`. `trad-name` sets a trading name and `co-no` sets the company number (ignored when `type` is `OTHER`).
**Titan** (`.ie`): `type` is required. `language` (uppercased) and `cro-number` are optional.
**Tucows/OpenSRS**: `type` is mapped per TLD — `.ca` → `legal_type`; `.au`/`.com.au`/`.org.au` → `eligibility_type` (also sets `registrant_name`); `.dk` → `registrant_type` (normalised to `"individual"` or `"business"`); `.es` → `es_id_type`; `.us` → `app_purpose`; `.cl`, `.de`, `.fi`, `.hu`, `.lv`, `.mx`, `.my`, `.nu`, `.pt`, `.com.pt`, `.re`, `.ro`, `.com.ro`, `.se`, `.za`, `.co.za` → `registrant_type`; all other Tucows TLDs → `entity_type`. Additional optional fields: `language` (`lang`), `nationality-code`, `co-no`, `cro-number`, `fax`, `reg_code`, `country_of_citizenship`.
**CentralNic** — contacts are not supported; this endpoint returns `false`.
**Note:** For `.uk` domains (Nominet), the registrant name (or organisation
name if present) must match the existing record. If the names do not match,
the update will be silently rejected and the method will return `false`.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/contacts", [
"(contact-type)" => []
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
}
+ Body
true
Disk Usage Report
/package/{packageId}/web/requestDiskUsagePOSTRequest Disk Usage Report
Queues a disk usage report for this virtual host. Use the returned `reportId`
with "Get disk usage report" to fetch results once the task completes.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/requestDiskUsage", [
"subDirectory" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
subDirectoryoptionalstring,nullableThe subdirectory to analyse; omit to analyse the full home directory
Authorization: Bearer token
+ Body
{
subDirectory: "string"
}
+ Body
{
reportId: 1,
directory: "string"
}
Document Roots
/package/{packageId}/web/documentRootsGETRetrieve Document Roots
Returns a map of every DNS name on the site to its document root subdirectory.
Returns an empty array on error.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/documentRoots");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
(domain_name): "string"
}
Domain
/package/{packageId}/domain/{domainId}GETRetrieve Domain Information
Returns a summary of the domain's current state, including linked services,
transfer status, registrant verification, renewal constraints, and DNSSEC support.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
emulatesPositiveRenewal: true,
hasPackage: true,
hasPrivacy: true,
name: "string",
nameservers: ["string"],
pendingTransfer: true,
registrantIsVerified: true,
renewalConstraint:{
}
}
Domain Max Interval
/package/{packageId}/domain/{domainId}/renewalMultipleMaxHintForPOSTGet domain max interval hint
Returns the maximum number of years by which this domain may currently be
renewed, given the supplied current expiry date. Registries impose a hard
cap on the total registered lifespan; this call computes the remaining
headroom.
**Note:** Cache this result by TLD rather than per-domain where possible.
The value changes as the expiry date advances.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/renewalMultipleMaxHintFor", [
"expiryDate" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
expiryDaterequiredstringThe current expiry date in any format acceptedby PHP's `DateTime` constructor, e.g. `"2026-04-01T00:00:00Z"`
Authorization: Bearer token
+ Body
{
expiryDate: "string"
}
+ Body
1
Domain Names/Subdomains
/package/{packageId}/namesGETRetrieve Names for a Package
Returns all domain names and subdomains attached to this package, normalised to lower case.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/names");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
["string"]
POSTAdd or Remove Names From a Package
Adds and/or removes domain names and subdomains from this package in a
single atomic call.
When adding names that are also registered (renewable) domains in your account:
When removing such a name, an empty web forwarding config is created automatically.
**Note:** You cannot remove the last name from a package. Attempting to do so
will throw an error.
- Full access to that domain name is required, otherwise the add is refused.
- Any existing web forwarding on the domain will be removed.
- Full access to that domain name is required, otherwise the add is refused.
- Any existing web forwarding on the domain will be removed.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/names", [
"add" => ["string"],
"rem" => ["string"],
"chg" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
addoptionalarray[string],nullableNames to add. Already-mapped names are skipped silently.remoptionalarray[string],nullableNames to remove.chgoptionalstring,nullableThe new primary name used for StackCP and FTP accounts.Must be a name that will remain on the package after `$add`/`$rem` are applied.
Authorization: Bearer token
+ Body
{
add: ["string"],
rem: ["string"],
chg: "string"
}
+ Body
["string"]
Domain Names/Subdomains
/package/{packageId}/web/domainCheckPOSTRetrieve Domain Details
Classifies a given hostname as either a domain or a subdomain.
Both fields are `false` when no `domain` parameter is supplied.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/domainCheck", [
"domain" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
domainrequiredstringThe hostname to inspect
Authorization: Bearer token
+ Body
{
domain: "string"
}
+ Body
{
domain: true,
subdomain: true
}
Domain Names/Subdomains
/package/{packageId}/web/namesPOSTAdd Names to a Package
Adds or removes domain names and subdomains from this web service.
Adding a name that already exists updates its document root path.
**Note:** `add` accepts either a plain array of names or a map of
`name => subdirectory` pairs. The `chg` field changes the primary name
used for single-name functions such as the main FTP username.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/names", [
"add" => ["string"],
"rem" => ["string"],
"chg" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
addrequiredarray[string]Plain array of names, or a map of names to document root subdirectories {remrequiredarray[string]Names to removechgoptionalstring,nullableThe new primary name; defaults to the first name on the web
Authorization: Bearer token
+ Body
{
add: ["string"],
rem: ["string"],
chg: "string"
}
+ Body
["string"]
Domain Names/Subdomains
/package/{packageId}/web/updateDocRootPOSTUpdate domain or subdomain document roots
Changes the document root subdirectory for one or more existing domains or
subdomains. The domain must already be attached to this web service.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/updateDocRoot", [
"update" => [
"(domain_name)" => "string"
]
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
updaterequiredobjectA map of domain names to new document root subdirectories {
- ``domain_name`` (string,required) - The new document root, e.g. `public_html/mysite`
Authorization: Bearer token
+ Body
{
update:{
(domain_name): "string"
}
}
+ Body
["string"]
Domain Price
/package/{packageId}/domain/{domainId}/servicePriceGETRetrieve domain price
Returns the per-year renewal price for a premium domain, or `null` for
standard-priced domains (where the price is determined by TLD pricing tables).
**Note:** The returned value is always in GBP and excludes reseller markup.
Currency conversion and checkout markup must be applied separately.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/servicePrice");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
1.99
Domain Privacy
/package/{packageId}/domain/{domainId}/privacyGETRetrieve domain privacy settings
Returns the current configuration and status of the domain privacy service.
**Note:** The `type` field will be either `"contact"` (contact-substitution
privacy) or `"registrar"` (registrar-level privacy, currently only supported
for OpenSRS domains). The available fields in the response vary by type.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/privacy");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
id: "string",
isEnabled: true,
type: "string",
emailDestination: "string",
prefix: "string"
}
POSTUpdate domain privacy
Updates the configuration of the domain privacy service.
**Note:** Not all privacy types support all configuration fields.
Supplying `emailDestination` for a privacy type that does not support it
will have no effect.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/privacy", [
"emailDestination" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
emailDestinationoptionalstring,nullableThe email address to forward masked contact email to,if supported by the privacy type
Authorization: Bearer token
+ Body
{
emailDestination: "string"
}
+ Body
{}
Domain Privacy
/package/{packageId}/domain/{domainId}/privacyStatePOSTSet Domain Privacy State
Enables or disables the domain privacy service for this domain.
The domain must already have a privacy service object attached; this
endpoint only changes its active state, not its configuration.
**Note:** Returns `false` if no privacy service is attached to this domain.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/privacyState", [
"enabled" => true
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
enabledrequiredboolean`true` to enable privacy, `false` to disable it
Authorization: Bearer token
+ Body
{
enabled: true
}
+ Body
true
Domain Transfer Status
/package/{packageId}/domain/{domainId}/pendingTransferStatusGETGet domain transfer status
Returns the cached registrar-level status string for the current
pending transfer, if any. This reflects the last polled value and
may not update in real time.
**Note:** Returns `null` if there is no pending transfer or if no
status has been polled yet. Use `pendingTransfer` to determine
whether a transfer is in progress.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/pendingTransferStatus");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
string
Domain WHOIS
/package/{packageId}/domain/{domainId}/optOutGETRetrieve WHOIS Disclosure Information for a Domain
Returns whether WHOIS contact disclosure is supported and currently
enabled for this domain. Only meaningful for registries that implement
opt-out (Nominet `.uk`) or have fixed policies (`.ca`, `.fr`).
**Note:** For `.ca` domains, `canSet` is always `false` and disclosure
cannot be changed. For `.fr` domains, disclosure is automatic and
`enabled` is `true` only when the registrant has no organisation set.
For all other TLDs, all fields return `null`.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/optOut");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
canSet: true,
enabled: true,
hasValidContact: true
}
POSTUpdate WHOIS optout
Updates the WHOIS contact-disclosure (opt-out) setting at the registry.
Currently only meaningful for Nominet `.uk` domains. Has no effect if
domain privacy is active (privacy supersedes disclosure settings).
**Note:** Disclosure settings vary by registry. Check `getOptOut` first
to confirm that `canSet` is `true` before calling this endpoint.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/optOut", [
"enabled" => true
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
enabledrequiredboolean`true` to enable disclosure (opt in), `false` to suppress it (opt out)
Authorization: Bearer token
+ Body
{
enabled: true
}
+ Body
{
result:{
msg: "string"
}
}
getPackageWebInfo
/package/{packageId}/web/infoGETRetreive
Returns basic information about the site.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/info");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
id: "string",
hasBackups: true,
label: "string",
name: "string",
names: ["string"],
platform: "string",
setupComplete: true,
typeRef: "string",
hasSsl:{
webName: true
}
}
Home Directory
/package/{packageId}/web/homeDirectoryGETRetrieve the Home Directory
Returns the absolute UNIX home directory path for this web site as reported
by the hosting platform.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/homeDirectory");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
string
Limits Domain
/package/{packageId}/domain/{domainId}/limitsPOSTRetrieve Limits for a Domain
Returns the feature-access limits for the current user as a key-value map.
The `lock` capability is additionally constrained by whether the TLD supports
locking at the registry.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/limits");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
addFreeWeb: true,
contacts: true,
dns: true,
email: true,
lock: true,
nameservers: true,
pushTransfer: true,
webForward: true,
whois: true,
}
Limits Package
/package/{packageId}/limitsGETRetrieve Limits for a Package
Returns the effective limits for the authenticated user on this package,
as a key-value map. Autoscale packages have their `webspace` and `bandwidth`
values overridden by the autoscale allowance.
**Note:** This endpoint requires the package to have an associated web object.
Calling it on a package without one will result in an error.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/limits");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
{
ftp: true,
temporaryURL: true,
mssqlDatabases: 1,
timelineBackups: true
}
}
Limits Web
/package/{packageId}/web/limitsGETRetrieve Limits for a web
Returns the effective usage limits for the current session user on this
web service. Autoscale allowance disk and bandwidth values override the
package defaults when applicable.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/limits");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
}
List Packages
/packageGETRetrieve Information for all Packages
Returns summary information for every hosting package in the account,
suitable for building a package listing UI.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package");
Authorization: Bearer token
+ Body
[
{
id: 1,
enabled: true,
externalId: 1,
created: "string",
name: "string",
names: ["string"],
packageTypeName: "string",
packageTypePlatform: "string",
productSpec: "string",
stackUsers: ["string"],
typeRef: "string",
web:{
{
id: "string",
hasBackups: true,
label: "string",
name: "string",
names: ["string"],
platform: "string",
setupComplete: true,
typeRef: "string",
hasSsl:{
webName: true
}
}
}
}
]
Logs
/package/{packageId}/web/logsGETRetrieve Logs for a Package
Returns the access and error log file references for this site.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/logs");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
LogFiles: "string"
}
Maintenance Mode
/package/{packageId}/web/maintenanceModeGETRetrieve Maintenance Mode Settings
Returns the maintenance mode configuration for each server alias on this
virtual host, including the HTML templates used for the maintenance and
login pages.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/maintenanceMode");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
[
{
alias: "string",
aliasId: 1,
maintenanceEnabled: true,
maintenancePasswordProtected: true,
maintenancePageHtml: "string",
maintenanceLoginPageHtml: "string"
}
]
POSTSet Maintenance Mode Settings
Set maintenance mode settings for this web
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/maintenanceMode");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
[
{
alias: "string",
aliasId: 1,
maintenanceEnabled: true,
maintenancePasswordProtected: true,
maintenancePageHtml: "string",
maintenanceLoginPageHtml: "string"
}
]
Package
/package/{packageId}/webGETRetrieve Package Information
Returns detailed information about the package.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
id: "string",
hasBackups: true,
label: "string",
platform: "string",
name: "string",
names: ["string"],
ftpUsers:{
},
ftp_credentials:{
},
typeRef: "string",
info:{
webserver: "string",
ip4Address: "string",
ip6Address: "string",
ftpserver: "string",
temporaryUrls:{
(domain_name): "string"
},
statsUrls:{
(service_name): "string"
},
},
packageTypeName: "string",
usage:{
MbIn: 1.99,
MbOut: 1.99,
ServerAliasCertificates:{
(type): ["string"]
},
},
setupComplete: true,
{
flags: ["string"]
}
}
Package
/package/{packageId}GETRetrieve Information About a Package
Returns a full representation of the package, including its DNS zones,
email configuration, limits, and associated web object.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
canClaimName: {},
defaultDns:{
},
dns:{
(name): {}
},
domain:{
{
id: "string",
closeToAnniversary: true,
deadDate: "string",
expiryDate: "string",
name: "string",
hasPrivacy: true,
pendingTransfer: true,
registrantIsVerified: true,
registrantVerificationChecked: "string",
renewalConstraint:{
},
preferredRenewalMonths: 1
}
},
email:{
(name): {}
},
enabled: true,
id: "string",
internalTransfer:{
},
isDemo: true,
limits:{
},
names: {},
sessionlimits:{
},
defaultHtml:{
},
stackBilling:{
},
stackUsers: ["string"],
status: {},
typeRef: "string",
web: {}
}
Package Add
/reseller/{resellerId}/addWebPOSTAdd a Hosting Package
The "Package Add" API endpoint allows you to add hosting packages to your reseller account using the 20i API.
This endpoint enables you to create a new web hosting package and associate it with a specific web type reference. The package can include a web site with an initial domain name and additional domain names if needed.
To use this endpoint, you need to provide the necessary parameters in the request payload. The parameters include:
"type" (string): A reference to the web type, which is equivalent to the ID found in the "/packageTypes" endpoint. This parameter determines the configuration and features of the hosting package.
"domain_name" (string): The initial domain name for the web site associated with the package.
"extra_domain_names" (array of strings, optional): An array of zero or more additional domain names that you want to associate with the package.
"label" (string): A memorable name or label for the package.
"documentRoots" (array): A map that specifies the intended document roots for the domain names associated with the package. The keys of the map are the domain names, and the values are the corresponding document roots.
"stackUser" (string or null): An optional parameter that allows you to link an existing Stack user to the package.
If you provide the reference to an existing Stack user, and a welcome email is set for the package type, the welcome email will be sent to the user as soon as possible.
The API endpoint supports the following exceptions:
"ConflictingObject" exception: Thrown when there is a conflict with an existing object.
"InvalidRequest" exception: Thrown when the request is invalid or missing required parameters.
Upon successful execution of the API call, the endpoint returns the newly assigned ID for the hosting package.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addWeb", [
"type" => "string",
"domain_name" => "string",
"extra_domain_names" => ["string"],
"label" => "string",
"documentRoots" => [
"(domain)" => "string"
],
"stackUser" => "string",
"packageTemplate" => "string"
]);
resellerIdrequirednumberYour reseller ID.
typerequiredstringA web type reference, equivalent to the id in/packageTypesdomain_namerequiredstringThe initial domain name for the siteextra_domain_namesoptionalarray[string],nullableArray of zero or more extradomain nameslabelrequiredstringThe memorable name for the packagedocumentRootsrequiredobjectA map of domain names to intended document
roots
- ``domain`` (string,required) -
+ `stackUser` (string,nullable) - eg. "stack-user:1". An existing Stackuser to link to the package.
+ `packageTemplate` (string,nullable) - The name of the blueprint package
Authorization: Bearer token
+ Body
{
type: "string",
domain_name: "string",
extra_domain_names: ["string"],
label: "string",
documentRoots:{
(domain): "string"
},
stackUser: "string",
packageTemplate: "string"
}
+ Body
1
Package Allowance Add
/reseller/{resellerId}/addStackUserPackageAllowancePOSTAdd a Hosting Package allowance
Adds a hosting package allowance for a stack user, defining the package bundle type
and the maximum number of packages that user may create under it.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/addStackUserPackageAllowance", [
"type" => "string",
"stackUser" => "string",
"domainProvision" => "string",
"manualAssign" => "string"
]);
resellerIdrequirednumberYour reseller ID.
typerequiredstringEncodes the package bundle type, allowance count, and optionallya DC location in the format `"{packageBundleTypeId}-{allowance}"`,
e.g. `"12345-10"`. Append `-{locationCode}` to pin to a data centre,
e.g. `"12345-10-lhr"`.
+ `stackUser` (string,required) - The stack user tuple to assign the allowance to,e.g. `"stack-user:456"`
+ `domainProvision` (string,nullable) - Optional domain name to provision a websitefor immediately under the new allowance.
+ `manualAssign` (string,nullable) - Optional existing package ID to assign to thenew allowance immediately.
Authorization: Bearer token
+ Body
{
type: "string",
stackUser: "string",
domainProvision: "string",
manualAssign: "string"
}
+ Body
{
serviceId: "string",
label: "string",
platform: "string"
}
Package Allowance Update
/reseller/{resellerId}/updateStackUserPackageAllowancePOSTUpdate a Package Allowance
Updates one or more stack user package allowances. Supports deleting allowances
and changing the bundle type or allowance count on existing ones.
Returns `true` if at least one action was applied.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/updateStackUserPackageAllowance", [
"delete-id" => ["string"],
]);
resellerIdrequirednumberYour reseller ID.
delete-idoptionalarray[string],nullableArray of allowance IDs to delete.upgrade-idoptionalobject,nullableMap of allowance ID to new type string in the format`"{packageBundleTypeId}-{allowance}"`, e.g. `["42" => "12345-20"]`.
Updates the bundle type and allowance count on the specified allowances.
Authorization: Bearer token
+ Body
{
delete-id: ["string"],
}
+ Body
true
Package Brand
/reseller/{resellerId}/packageTypeBrandPOSTRetrieve Package Brand Type
The "Retrieve Package Brand Type" API endpoint allows you to fetch the branding details for a specific package. It retrieves the package branding configuration associated with the provided package ID.
When making the API call, you need to provide the following parameter:
$in: An array containing the package ID. The package ID is specified as the "packageid" parameter.
The response from this API call will be an array containing the following information:
defaultPages: An array representing the default pages associated with the package branding. It includes the following keys:
IndexPageHtml: The HTML content of the index page.
DeactivatedPageHtml: The HTML content of the deactivated page.
ServiceUnavailablePageHtml: The HTML content of the service unavailable page.
MaintenanceLoginPageHtml: The HTML content of the maintenance login page.
The package branding configuration allows you to customize the appearance and content of various pages related to the package, such as the index page, deactivated page, service unavailable page, and maintenance login page.
By retrieving this configuration, you can access the default HTML content for these pages and modify them according to your needs.
Please note that the provided package ID is used to identify the specific package for which you want to fetch the branding details.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/packageTypeBrand", [
"packageid" => "string"
]);
resellerIdrequirednumberYour reseller ID.
packageidrequiredstring
Authorization: Bearer token
+ Body
{
packageid: "string"
}
+ Body
{
defaultPages:{
IndexPageHtml: "string",
DeactivatedPageHtml: "string",
ServiceUnavailablePageHtml: "string",
MaintenanceLoginPageHtml: "string"
}
}
Package Count
/reseller/{resellerId}/packageCountGETGet package totals
The "Get package totals" API endpoint allows you to retrieve a count of packages split by their respective types.
The supported package types are "linux", "windows", and "wordpress". This API call provides information about the number of packages associated with each type.
The response from this API call will be an array containing the following counts:
linux: Represents the count of Linux web(s) or packages.
windows: Represents the count of Windows web(s) or packages.
wordpress: Represents the count of WordPress web(s) or packages.
Please note that this API endpoint is designed to provide an overview of the package distribution based on different types within the 20i platform.
It allows you to retrieve the total counts of packages associated with each type, such as Linux, Windows, and WordPress.
This API endpoint falls under the "Package Count" section and serves as a means to obtain the package totals categorized by their respective types.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/packageCount");
resellerIdrequirednumberYour reseller ID.
Authorization: Bearer token
+ Body
{
linux: 1,
windows: 1,
wordpress: 1
}
Package Delete
/hosting/handleBulkDeleteWebPOSTDelete a Package
Deletes one or more packages (web hosting sites) by their IDs. Packages
that have active site migration tasks or are a parent of another web
cannot be deleted and will return `false` in the result map.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/hosting/handleBulkDeleteWeb");
Authorization: Bearer token
+ Body
{
(package_id): true
}
Package Delete
/reseller/{resellerId}/deleteWebPOSTDelete a Package
The "Package Delete" API endpoint allows you to delete one or multiple packages (web sites) using their respective IDs. This API call provides a way to remove unwanted packages or websites from your hosting environment.
To delete packages, you need to provide the following parameters in the request payload:
delete-id: An array of package IDs that you want to delete. Each package ID represents a specific web site or hosting package.
Upon successful execution of the API call, the response will return an array with the following structure:
$(ref): A boolean value indicating the success of the deletion operation. It represents whether the specified packages were successfully deleted.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/deleteWeb", [
"delete-id" => ["string"]
]);
resellerIdrequirednumberYour reseller ID.
delete-idrequiredarray[string]IDs of packages to be deleted
Authorization: Bearer token
+ Body
{
delete-id: ["string"]
}
+ Body
{
(ref): true
}
Package Type Limits
/package/{packageId}/bundleType/limitsGETRetrieve Package Type Limits
Returns the custom limit set configured for this package bundle type.
Infinite limits are represented as the string `"INF"` rather than a
numeric value.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/bundleType/limits");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
Package Types
/reseller/{resellerId}/packageTypesGETList Package Types
The "List Package Types" API endpoint provides information about package types in the 20i reseller system.
A package type in 20i allows resellers to define specific limits and configurations for hosting packages.
These package types are essential for setting up new packages with predefined settings.
By making a request to this endpoint, you can retrieve information about the available package types.
The response will be an array of package type objects, where each object contains details about a specific package type.
The exact structure of the response can be found in the API documentation or additional documentation provided by 20i.
Upon successful execution of the API call, the endpoint will return the package type information in the response.
The package type objects typically include attributes such as the type's name, limits, configurations, or any other relevant information associated with the package type.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/packageTypes");
resellerIdrequirednumberYour reseller ID.
Authorization: Bearer token
+ Body
[
{
{
extraData:{
temporaryUrlDomain: "string"
},
id: "string",
label: "string",
limits:{
},
platform: "string",
installApps: ["string"],
welcomeEmail: "string",
passwordResetEmail: "string"
}
}
]
POSTCreate a Package Type
The "Create a Package Type" API endpoint allows you to create a new package type in the 20i reseller system. A package type in 20i is used to define specific limits, configurations, and settings for hosting packages. This endpoint enables resellers to create custom package types tailored to their specific requirements.
To create a package type, you need to provide the necessary parameters in the request payload. The parameters include:
"label" (string): The customer label or name for the package type.
"platform" (string): The base operating system (OS) for the package type, such as "linux" or "windows".
"limit" (array): A map of limit codes to values, specifying the limits and configurations for the package type. The limit codes correspond to specific web limits and their respective values define the limits for the package type.
"installApps" (array or null): An optional parameter that specifies a plain array of app codes. These apps will be automatically installed when a package of this type is created. If not provided or set to null, no apps will be automatically installed.
"welcomeEmail" (array or null): An optional parameter that defines the content of the welcome email sent to customers when a package of this type is created. It includes the "from" address, the email "subject," and the email "data" (content).
"passwordResetEmail" (string or null): An optional parameter that specifies the email content for password reset instructions. If not provided or set to null, the default password reset email will be used.
"defaultPages" (array): A map of default pages for the package type. It includes optional HTML content for the "IndexPageHtml," "DeactivatedPageHtml," and "ServiceUnavailablePageHtml" pages.
"extraData" (array or null): An optional parameter that provides additional data specific to the package type. It includes the "temporaryUrlDomain" to use as the temporary URL domain and the "phpVersion" to specify the desired PHP version.
Upon successful execution of the API call, the endpoint will return the ID of the newly created package type.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/packageTypes", [
"label" => "string",
"platform" => "string",
"limit" => [
],
"installApps" => ["string"],
"welcomeEmail" => [
"from" => "string",
"subject" => "string",
"data" => "string"
],
"passwordResetEmail" => "string",
"defaultPages" => [
"IndexPageHtml" => "string",
"DeactivatedPageHtml" => "string",
"ServiceUnavailablePageHtml" => "string"
],
"extraData" => [
"temporaryUrlDomain" => "string",
"phpVersion" => "string"
]
]);
resellerIdrequirednumberYour reseller ID.
labelrequiredstringThe customer label for this typeplatformrequiredstringThe base OS for the type(something like "linux" or "windows")limitrequiredobjectA limit code to value map, see web limitsinstallAppsoptionalarray[string],nullableA plain array of app codes which will be automatically
installed. Null is equivalent to the empty array here.
+ `welcomeEmail` (object,nullable) -
- `from` (string,required) -
- `subject` (string,required) -
- `data` (string,required) -
+ `passwordResetEmail` (string,nullable) -
+ `defaultPages` (object,required) -
- `IndexPageHtml` (string,nullable) -
- `DeactivatedPageHtml` (string,nullable) -
- `ServiceUnavailablePageHtml` (string,nullable) -
+ `extraData` (object,nullable) -
- `temporaryUrlDomain` (string,required) - The domain to use as the temp URL
- `phpVersion` (string,required) -
Authorization: Bearer token
+ Body
{
label: "string",
platform: "string",
limit:{
},
installApps: ["string"],
welcomeEmail:{
from: "string",
subject: "string",
data: "string"
},
passwordResetEmail: "string",
defaultPages:{
IndexPageHtml: "string",
DeactivatedPageHtml: "string",
ServiceUnavailablePageHtml: "string"
},
extraData:{
temporaryUrlDomain: "string",
phpVersion: "string"
}
}
+ Body
1
Package Types
/reseller/{resellerId}/updateWebTypePOSTUpdate Package Types
The "Update Package Types" API endpoint allows you to update package types within your 20i account. This API call is used to modify various settings and configurations associated with package types.
To update package types, you need to provide the following parameters in the request payload:
delete-id: A set of IDs of items to delete.
extraData: A map of type ID to extra data settings. Currently, the only supported setting is "temporaryUrlDomain," which specifies the domain to use as the temporary URL.
id: A set of IDs to update.
installApps: A map of type ID to an array of app codes. These app codes represent the apps that will be automatically installed for the specified package types.
labels: An array that specifies the new labels for each package type.
limit: An array that defines the new limit values for various limits associated with each package type. The limit codes and their corresponding subcodes are used to set the limit values.
platform: Specifies the platform for the package types. This parameter is optional.
syncLimits: A map of type ID to true, indicating which package types should have their limits synchronized.
welcomeEmail: A map of type ID to welcome email settings, including the subject, from email address, and the full text/HTML content of the welcome email.
Upon successful execution of the API call, the response will return an array with the updated information for the package types.
Please note that this API endpoint is designed to handle the modification of package types within the 20i platform.
It provides flexibility in updating various settings and configurations associated with package types. If an invalid request is made, an exception of type "InvalidRequest" will be thrown.
This API endpoint falls under the "Package Types" section and allows you to manage and update the characteristics and configurations of different package types within your 20i account.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/updateWebType", [
"delete-id" => ["string"],
"extraData" => [
"(id)" => [
"temporaryUrlDomain" => "string"
]
],
"id" => ["string"],
"installApps" => [
"(type_id)" => ["string"]
],
"labels" => [
],
"limit" => [
"(type_id)" => [
"(limit_code)" => true
]
],
"platform" => "string",
"syncLimits" => [
"(type_id)" => true
],
"welcomeEmail" => [
"(id)" => [
"subject" => "string",
"from" => "string",
"content" => "string"
]
]
]);
resellerIdrequirednumberYour reseller ID.
delete-idrequiredarray[string]Set of IDs of items to deleteextraDataoptionalobject,nullableA map of type ID to extra data settings - currently
temporaryUrlDomain
- ``id`` (object,required) -
- `temporaryUrlDomain` (string,required) - The domain to use as thetemp URL
+ `id` (array[string],required) - Set of IDs to update
+ `installApps` (object,nullable) - Map of type ID to array of app codes which will be
automatically installed. Null is equivalent to the empty array
here.
- ``type_id`` (array[string],required) -
+ `labels` (object,required) -
+ `limit` (object,required) -
- ``type_id`` (object,required) -
- ``limit_code`` (string,required) - The limit value to set
+ `platform` (string,nullable) -
+ `syncLimits` (object,required) - Map of type ID to true to indicate which
types should have their limits synchronised.
- ``type_id`` (boolean,required) -
+ `welcomeEmail` (object,nullable) - A map of type ID to welcome email settings
- ``id`` (object,nullable) -
- `subject` (string,required) - The welcome email subject
- `from` (string,required) - The from email address to use
- `content` (string,required) - The full text/html email content
Authorization: Bearer token
+ Body
{
delete-id: ["string"],
extraData:{
(id):{
temporaryUrlDomain: "string"
}
},
id: ["string"],
installApps:{
(type_id): ["string"]
},
labels:{
},
limit:{
(type_id):{
(limit_code): true
}
},
platform: "string",
syncLimits:{
(type_id): true
},
welcomeEmail:{
(id):{
subject: "string",
from: "string",
content: "string"
}
}
}
+ Body
{
}
Package Update
/reseller/{resellerId}/updatePackagePOSTUpdate/Delete a Package
The "Update/Delete a Package" API endpoint allows you to update or delete packages within your 20i account. This API call is used to modify the limits, labels, or delete web sites associated with a package.
To update or delete a package, you need to provide the following parameters in the request payload:
billing: An array that contains information about the customer's renewal date, renewal interval, preferred user, and other relevant details.
delete-id: An array of package IDs to be deleted.
id: An array of currently known package IDs.
labels: An array that specifies the new label for each package.
limit: An array that defines the new values for various limits associated with each package.
limit-set: An array that determines whether specific limits should be changed or removed.
packageBundleTypes: An array that specifies the new bundle type for each package.
Upon successful execution of the API call, the response will return an array with the IDs of the services that were updated or deleted.
Please note that this API endpoint is designed to handle the modification and deletion of packages within the 20i platform.
It requires the appropriate package IDs and parameters to perform the desired actions. If a package does not exist or the specified users do not have access, an exception will be thrown.
This API endpoint falls under the "Package Update" section and provides a flexible way to manage and modify packages associated with your 20i account.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/updatePackage", [
"billing" => [
"(package_id)" => [
"date" => "string",
"interval" => 1,
"preferredUser" => "string",
]
],
"delete-id" => ["string"],
"id" => ["string"],
"labels" => [
"(package_id)" => "string"
],
"limit" => [
"(package_id)" => [
"(limit_code)" => true
]
],
"limit-set" => [
"(package_id)" => [
"(limit_code)" => true
]
],
"packageBundleTypes" => [
"(package_id)" => "string"
]
]);
resellerIdrequirednumberYour reseller ID.
billingrequiredobject
- ``package_id`` (object,required) -
- `date` (string,required) - The date when the customer is due to renewwith you, in ISO8601 format
- `interval` (number,required) - The typical renewal period your customeris using, in months.
- `preferredUser` (string,required) - The stackuser ident (eg stack-user:000)
+ `delete-id` (array[string],required) - IDs of packages to be deleted
+ `id` (array[string],required) - An array of currently known package IDs, see alsolimit and limit-set. Items not in this list will be
ignored except for "billing" and "delete-id" purposes.
+ `labels` (object,required) -
- ``package_id`` (string,nullable) - The new label for the package
+ `limit` (object,required) -
- ``package_id`` (object,required) -
- ``limit_code`` (string,required) - The new value for the given limit. Codes
currently include:
+ "allFutureOneClick" (boolean)
+ "accessErrorLogs" (boolean)
+ "accountSummary" (boolean)
+ "additionalFtpUsers" (number)
+ "allowExternalSsl" (boolean)
+ "allowForceSsl" (boolean)
+ "appManager" (boolean)
+ "apps" (set)
+ "awstats" (boolean)
+ "backups" (boolean)
+ "bandwidth" (number)
+ "blockVisitors" (boolean)
+ "cdnCaching" (boolean)
+ "cdnOptimisation" (boolean)
+ "cdnStatistics" (boolean)
+ "customDocRoot" (boolean)
+ "customPrimaryDocRoot" (boolean)
+ "directoryIndexing" (boolean)
+ "dns" (boolean)
+ "domainContacts" (boolean)
+ "domainPrivacy" (boolean)
+ "emailSummary" (boolean)
+ "fileManager" (boolean)
+ "freeSsl" (boolean)
+ "ftp" (boolean)
+ "googleTranslate" (boolean)
+ "highEmailNotification" (number)
+ "hotlinkProtection" (boolean)
+ "imapSync" (boolean)
+ "lowEmailNotification" (number)
+ "mailAutoresponders" (number)
+ "mailboxes" (number)
+ "mailCatchAllForwarders" (boolean)
+ "mailForwarders" (number)
+ "mailJunkFilterLogs" (boolean)
+ "mailJunkFilters" (boolean)
+ "maintenanceMode" (boolean)
+ "malwareScan" (boolean)
+ "malwareReport" (boolean)
+ "makePrimaryDomain" (boolean)
+ "manageWpDatabase" (boolean)
+ "manageWpDatabase" (boolean)
+ "manageWpPlugins" (boolean)
+ "manageWpThemes" (boolean)
+ "manageWpUsers" (boolean)
+ "manageWpAdminUsers" (boolean)
+ "manageWpSearchReplace" (boolean)
+ "manageWpSiteSettings" (boolean)
+ "manageWpStaging" (boolean)
+ "manageWpChecksumReport" (boolean)
+ "manageWpUpdates" (boolean)
+ "maxMailboxSize" (number)
+ "mssqlDatabases" (number)
+ "mysqlDatabases" (number)
+ "names" (boolean)
+ "nameservers" (boolean)
+ "nameserverCheck" (boolean)
+ "passwordProtectedDirectories" (boolean)
+ "platformReinstall" (boolean)
+ "phpConfig" (boolean)
+ "phpMyAdmin" (boolean)
+ "primaryFtpUnlock" (boolean)
+ "remoteMysql" (boolean)
+ "scheduledTasks" (boolean)
+ "sitemapGenerator" (boolean)
+ "ssh" (boolean)
+ "subdomains" (number)
+ "switchPhpVersion" (boolean)
+ "temporaryURL" (boolean)
+ "timelineBackups" (boolean)
+ "usageInformation" (boolean)
+ "webalizer" (boolean)
+ "webBuilder" (boolean)
+ "webmail" (boolean)
+ "webRedirect" (boolean)
+ "webspace" (number)
+ "whois" (boolean)
+ "wpAdmin": (boolean)
+ `limit-set` (object,required) -
- ``package_id`` (object,required) -
- ``limit_code`` (boolean,required) - True if this limit is to be changedor removed, ie the counterpart "limit" entry
will be ignored unless this is true.
+ `packageBundleTypes` (object,required) - This requires corresponding entries in "id"
- ``package_id`` (string,required) - The new bundle type for the package.The new packageBundleType must be on the same platform.
Authorization: Bearer token
+ Body
{
billing:{
(package_id):{
date: "string",
interval: 1,
preferredUser: "string",
}
},
delete-id: ["string"],
id: ["string"],
labels:{
(package_id): "string"
},
limit:{
(package_id):{
(limit_code): true
}
},
limit-set:{
(package_id):{
(limit_code): true
}
},
packageBundleTypes:{
(package_id): "string"
}
}
+ Body
{
(ref): true
}
Pending Clone
/package/{packageId}/web/pendingCloneGETCheck if the package has a pending clone
Returns `true` if a clone operation is currently pending for this web service.
Returns `null` for email-only packages.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/pendingClone");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
true
Pending Split
/package/{packageId}/web/pendingSplitGETGet the status of a package pending split job
Returns `true` while a package split job is in progress. Once the split
completes the new virtual host ID is stored and `false` is returned.
**Note:** Throws `NotFoundException` if neither an external ID nor a pending
split task can be found for this web.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/pendingSplit");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
true
Profile
/package/{packageId}/web/profileIdGETRetrieve profile ID
Returns the managed VPS profile ID for virtual-platform packages.
Returns `null` for all other platform types.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/profileId");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
string
Registry Information
/package/{packageId}/domain/{domainId}/upstreamExpiryDateGETRetrieve Upstream Domain Expiry Date
Returns the expiry date recorded at the registry for this domain.
This is a live lookup and does not reflect the payment status or the
scheduled renewal date on the 20i platform.
**Note:** Returns `null` for domains with an incomplete transfer or
those that have been deleted at the registry.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/upstreamExpiryDate");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
string
Scheduled Tasks
/package/{packageId}/web/tasksGETRetrieve Scheduled Tasks
Returns all cron jobs currently configured on this virtual host.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/tasks");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
[
{
Command: "string",
Enabled: true,
Id: "string",
MailTo: "string",
TimeSpec: "string"
}
]
POSTCreate/Update/Delete a Scheduled Task
Update, create or delete cron task.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/tasks", [
"new" => [
"task" => [
{
"Enabled" => true,
"MailTo" => "string",
"TimeSpec" => "string",
"Command" => "string"
}
]
],
"delete" => [
"task" => [
"id" => ["string"]
]
],
"update" => [
"task" => [
{
"id" => "string",
"Enabled" => true,
"MailTo" => "string",
"TimeSpec" => "string",
"Command" => "string"
}
]
]
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
newoptionalobject,nullable
- `task` (array[object],required) -
+ `delete` (object,nullable) -
- `task` (object,required) -
- `id` (array[string],required) -
+ `update` (object,nullable) -
- `task` (array[object],required) -
Authorization: Bearer token
+ Body
{
new:{
task:{
Enabled: true,
MailTo: "string",
TimeSpec: "string",
Command: "string"
}
},
delete:{
task:{
id: ["string"]
}
},
update:{
task:{
id: "string",
Enabled: true,
MailTo: "string",
TimeSpec: "string",
Command: "string"
}
}
}
+ Body
[
{
}
]
Session Limits domain
/package/{packageId}/domain/{domainId}/sessionlimitsGETRetrieve session limits
Returns the limits for the session. If the user is a super user
then they are exempt from explicit limit restrictions.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/sessionlimits");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
(code): true
}
Session Limits package
/package/{packageId}/sessionlimitsGETRetrieve session limits
Returns the effective limits for the current session. Superusers are
exempt from explicit limit restrictions. Child packages (those with a
parent web) have their `dns` limit forced to `0`. Cloud (non-20i)
packages have `trafficDistrubutionAllowed` set to `false`.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/sessionlimits");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
(code): true
}
Sitemap
/hosting/handleBulkSitemapGenerationPOSTBulk Sitemap generation
Generates and retrieves the sitemap for one or more packages
simultaneously.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/hosting/handleBulkSitemapGeneration");
Authorization: Bearer token
+ Body
{
(package_id):{
{
CreatedAt: "string",
LockState: "string",
OutputText: "string",
UploadAfterGeneration: true
}
}
}
Sitemap
/package/{packageId}/web/sitemapGETCheck Sitemap Jobs
Returns the most recent sitemap generation job for this virtual host,
or `null` if no jobs have been run.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/sitemap");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
CreatedAt: "string",
LockState: "string",
OutputText: "string",
UploadAfterGeneration: true
}
POSTInitiate a Sitemap Job
Start a sitemap job.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/sitemap", [
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
}
+ Body
{
CreatedAt: "string",
LockState: "string",
OutputText: "string",
UploadAfterGeneration: true
}
Split Package
/reseller/{resellerId}/splitPackagePOSTSplit out additional domains to their own packages
The "Split Package" API endpoint allows you to split additional domains from a package into their own separate packages.
This can be useful when you want to manage domains individually or allocate separate resources to specific domains.
To split additional domains from a package, you need to provide the following parameters in the request payload:
packageId: The ID of the package from which the domains will be split.
domains: An array containing the details of the domains to be split. Each domain should have the following information:
fqdn: The fully qualified domain name (FQDN) of the domain.
databases: An optional array that can be used to specify any additional databases related to the split domains. The structure and details of this parameter are not provided in the given documentation.
Upon successful execution of the API call, the response will return an array or null value:
array: An array containing any relevant information or data related to the split operation.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/splitPackage", [
"packageId" => "string",
"domains" => [
"fqdn" => "string"
],
]);
resellerIdrequirednumberYour reseller ID.
packageIdrequiredstringdomainsrequiredobject
- `fqdn` (string,required) -
+ `databases` (object,required) -
Authorization: Bearer token
+ Body
{
packageId: "string",
domains:{
fqdn: "string"
},
}
+ Body
Subdomains
/package/{packageId}/web/subdomainsGETRetrieve a List of Subdomains
Returns only the subdomain names on this web service (i.e. names that are
subdomains of other attached names), mapped to their document root suffix.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/subdomains");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
(domain_name): "string"
}
POSTAdd a Subdomain
This does the same as POSTing to /names except that it enforces
the subdomain limit and disallows non-subdomains.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/subdomains", [
"add" => ["string"],
"rem" => ["string"]
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
addrequiredobject
- ``domain_name`` (string,required) - Document root
+ `rem` (array[string],required) -
Authorization: Bearer token
+ Body
{
add: ["string"],
rem: ["string"]
}
+ Body
["string"]
Transfers Cancel
/package/{packageId}/domain/{domainId}/cancelTransferPOSTCancel a Domain Transfer
Cancels a pending incoming domain transfer and refunds the transfer cost
to the account balance.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/cancelTransfer", [
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
}
+ Body
true
Transfers Change IPS Tag
/package/{packageId}/domain/{domainId}/tagPOSTUpdate IPS Tag
Changes the IPS tag (registrar tag) for a `.uk` domain, initiating an
outbound push-transfer to another Nominet registrar. Only applicable to
Nominet-registered domains.
**Warning:** If this operation succeeds the domain will immediately
transfer to the gaining registrar and will no longer be manageable
through this account. This action cannot be undone from here.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/tag", [
"new-tag" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
new-tagrequiredstringThe target registrar's IPS tag (e.g. `"ENOM"`)
Authorization: Bearer token
+ Body
{
new-tag: "string"
}
+ Body
true
Transfers EPP Code
/package/{packageId}/domain/{domainId}/authCodeGETRetrieve EPP Code
Returns the EPP auth code (transfer authorisation code) for the domain.
This code is required when initiating an outbound transfer at a gaining registrar.
**Note:** For some registries this call generates and sets a fresh authcode
at the registry rather than reading the existing one. Do not cache the result,
and avoid calling this while an inbound transfer is in progress as the code
rotation may interfere.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/authCode");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
string
Transfers Info
/package/{packageId}/domain/{domainId}/transferInfoGETRetrieve Transfer Information
Returns the state of the current or most-recent pending transfer.
If no transfer is pending, all fields reflect the absence of a transfer.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/transferInfo");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
pending: true,
registrarStatus: "string",
type: "string"
}
Transfers Lock status
/package/{packageId}/domain/{domainId}/canTransferGETRetrieve Transfer Flag
Returns whether the domain is currently unlocked (i.e. outbound transfers
are permitted).
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/canTransfer");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
true
POSTAmend Domain Lock Status
Sets or clears the domain transfer lock (clientHold status) at the registry.
When locked, outbound transfers to another registrar will be rejected.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/canTransfer", [
"enable" => true
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
enablerequiredboolean`true` to unlock (allow transfers), `false` to lock (block transfers)
Authorization: Bearer token
+ Body
{
enable: true
}
+ Body
true
Transfers Modify
/package/{packageId}/domain/{domainId}/updateTransferPOSTModify an Incoming Transfer
Modifies a pending incoming domain transfer — either re-sending the
admin-contact approval email or cancelling and restarting the transfer
with a new authcode or full configuration.
**Note:** `configuration` is only needed when you originally initiated a
simple transfer and now need to switch to a full contact-detail transfer
(OpenSRS-style). In most restart cases, omitting it reuses the original
configuration.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/updateTransfer", [
"action" => "string",
"authInfo" => [
"pw" => "string"
],
"configuration" => [
]
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
actionrequiredstring`"restart"` to cancel and restart the transfer,or `"resend"` to resend the admin-contact approval emailauthInfooptionalobject,nullableIgnored if `configuration` is provided {
- `pw` (string,required) - The new EPP authcode to use for a restart
+ `configuration` (object,nullable) - Full transfer configuration; if provided
- `` \PlatformActionQueue -
Authorization: Bearer token
+ Body
{
action: "string",
authInfo:{
pw: "string"
},
configuration:{
}
}
+ Body
true
Transfers Resend Verification
/package/{packageId}/domain/{domainId}/resendVerificationEmailPOSTResend Registrant Verification Email
Triggers a resend of the ICANN registrant verification email via the
registry API. Whether the registry acts on this depends on the domain's
current verification state; the response reflects the registry's success
status, not whether an email was ultimately delivered.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/resendVerificationEmail", [
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
}
+ Body
true
Transfers Status
/package/{packageId}/domain/{domainId}/pendingTransferGETRetrieve Pending Transfer Status
Returns the current pending-transfer state for the domain.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/pendingTransfer");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
true
Web Disk Usage
/package/{packageId}/web/diskUsagePOSTGet disk usage report
Fetches a previously requested disk usage report by its ID.
Use "Request Disk Usage Report" to create a report and obtain the `reportId`.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/diskUsage", [
"reportId" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
reportIdrequiredstringThe ID of the report to retrieve
Authorization: Bearer token
+ Body
{
reportId: "string"
}
+ Body
{
Comments: "string",
CreatedAt: "string",
DiskUsageReportId: 1,
LockState: "string",
SubDirectory: "string",
UpdatedAt: "string"
}
Web Usage Stats
/package/{packageId}/web/usageGETRetrieve web stats
Returns current-month bandwidth and disk usage statistics for this package.
For autoscale packages the values are sourced from the allowance rather than
the platform directly.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/usage");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
Bandwidth:{
MbIn: "string",
MbOut: "string",
Hits: "string"
},
DiskMb: "string",
SshPublicKeys: "string",
CronJobs: "string",
FtpAccounts: "string",
MySqlDatabases: "string",
MySqlUsers: "string",
ServerAliases: "string"
}
WHOIS
/package/{packageId}/domain/{domainId}/whoisGETRetrieve WHOIS Information
Returns the current live WHOIS text for the domain as a raw string.
**Note:** Only works for domains registered with 20i. Returns an empty
or error string for externally registered domains.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/whois");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
string
Windows App Pool
/package/{packageId}/web/recycleApplicationPoolPOSTRecycle Application Pool
Recycles the Windows IIS application pool for this virtual host, which
restarts the worker process without a full IIS restart.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/recycleApplicationPool", [
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
}
+ Body
true
Windows App Pool Config
/package/{packageId}/web/windowsConfigurationGETRetrieve Application Pool Configuration
Returns the Windows IIS application pool settings for this virtual host,
including the pipeline mode and runtime version.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/web/windowsConfiguration");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
ApplicationPoolPipelineMode: "string",
ApplicationPoolRuntimeVersion: "string",
VirtualHostWindowsConfigurationId: 1
}
POSTUpdate Application Pool Configuration
Update the Windows application pool configuration. For example; the
runtime version, and the pipeline mode type.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/web/windowsConfiguration", [
"ApplicationPoolPipelineMode" => "string",
"ApplicationPoolRuntimeVersion" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
ApplicationPoolPipelineModerequiredstringThe application poolpipeline mode, either to
Integrated or Classic. (optional)
+ `ApplicationPoolRuntimeVersion` (string,required) - The application poolruntime version.
(optional)
Authorization: Bearer token
+ Body
{
ApplicationPoolPipelineMode: "string",
ApplicationPoolRuntimeVersion: "string"
}
+ Body
true
StackCP Users
Emails
/reseller/{resellerId}/passwordResetEmailGETRetrieve the Password Reset Email Template
The "Retrieve the Password Reset Email Template" API endpoint allows you to retrieve the password reset email template or the default value.
This API call is used to obtain the content of the password reset email template, which can be customized for your specific needs.
The response from this API call will be a string representing the password reset email template.
It contains the content of the template that is either customized based on your configuration or the default value if no customization has been made.
Please note that this API endpoint is designed to provide access to the password reset email template within the 20i platform.
It allows you to retrieve the template content for further customization or to use the default template if no customization is required.
This API endpoint falls under the "Emails" section and serves as a means to retrieve the password reset email template or its default value.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/passwordResetEmail");
resellerIdrequirednumberYour reseller ID.
Authorization: Bearer token
+ Body
string
POSTSet a password reset email
The "Set a password reset email" API endpoint allows you to set the template for the password reset email. You can provide the entire content of the email template.
Here are the details of the API endpoint:
$in: An array containing the following parameter:
content: The entire content of the password reset email template.
The API call requires an instance of the \Services\Model class as a parameter.
The API will return a boolean value, indicating whether the operation was successful. If the password reset email template is set successfully, the API will return true. Otherwise, it will return false.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/passwordResetEmail", [
"content" => "string"
]);
resellerIdrequirednumberYour reseller ID.
contentrequiredstringThe entire template content
Authorization: Bearer token
+ Body
{
content: "string"
}
+ Body
true
List StackCP Users
/package/{packageId}/domain/{domainId}/stackUserListGETRetrieve Stack User list
Returns the StackCP sub-users that have been granted access to this domain.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/stackUserList");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
[
{
userName: "string",
identity: "string"
}
]
List StackCP Users
/package/{packageId}/stackUserListGETRetrieve Stack User list
Returns the StackCP users who have access to this package.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/stackUserList");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
[
{
userName: "string",
identity: "string"
}
]
Password Reset Email
/reseller/{resellerId}/resetPasswordGETSend a Password reset email
The "Send a Password Reset Email" API endpoint allows you to send a password reset email to a user. This email is sent when a password reset token is provided.
The API endpoint is designed to work in conjunction with the password reset functionality of the authentication service.
To use this API, you need to provide the following parameters:
$in: An array containing the following information:
token: The password reset token.
username (optional): The username associated with the account. This parameter is not required but can be provided for additional identification purposes.
url: The URL of the password reset page where the user will be redirected to. This URL should be in the format of "http://example.org/resetPassword" or a similar format.
The API call will return a boolean value indicating the success or failure of the password reset email sending operation. A value of true indicates that the email was sent successfully, while false indicates a failure.
This API endpoint is useful when you want to trigger a password reset email to a user who has requested to reset their password.
By providing the token, username (optional), and the URL of the password reset page, the API will send an email to the user with instructions on how to proceed with the password reset process.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/resetPassword", [
"token" => "string",
"username" => "string",
"url" => "string"
]);
resellerIdrequirednumberYour reseller ID.
tokenrequiredstringReset tokenusernameoptionalstring,nullableurlrequiredstringPassword reset page URL, likehttp://example.org/resetPassword
Authorization: Bearer token
+ Body
{
token: "string",
username: "string",
url: "string"
}
+ Body
true
Stack User
/reseller/{resellerId}/stackUser/{stackUserId}GETGet stack user.
Returns a detailed representation of the stack user, including whether
a master FTP account is configured.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/stackUser/{stackUserId}");
resellerIdrequirednumberYour reseller ID.stackUserIdrequiredstringFIXME
Authorization: Bearer token
+ Body
{
id: "string",
masterFtp: true,
name: "string",
contact:{
},
totpRequired: true,
haveTotp: true
}
Stack User FTP locks
/reseller/{resellerId}/stackUser/{stackUserId}/ftpLocksGETGet stack user FTP locks.
Returns the IP ACL entries restricting FTP access for this stack user's
master FTP account, keyed by their ACL record ID.
**Note:** Returns an empty array if this user has no master FTP account.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/stackUser/{stackUserId}/ftpLocks");
resellerIdrequirednumberYour reseller ID.stackUserIdrequiredstringFIXME
Authorization: Bearer token
+ Body
{
(ref):{
MasterFtpAccountIpAclId: 1,
Ip4Address: "string",
Ip6Address: "string"
}
}
Stack User grants
/reseller/{resellerId}/stackUser/{stackUserId}/grantsGETGet stack user grants.
Returns the list of object tuples (e.g. `"package:123"`) that this stack
user has been granted access to.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/stackUser/{stackUserId}/grants");
resellerIdrequirednumberYour reseller ID.stackUserIdrequiredstringFIXME
Authorization: Bearer token
+ Body
["string"]
Stack User Package Allowance
/reseller/{resellerId}/stackUserPackageAllowance/{stackUserPackageAllowanceId}/addWebPOSTAdd website to Stack User Package Allowance
Creates a new hosting package under this allowance and links it to the
owning StackCP user. The package type and data centre location are
determined by this allowance's configuration.
**Note:** Adding a website will fail if the allowance limit has already
been reached, or if the allowance's data centre location is not in your
list of permitted locations.
**Note:** Subdomains must be added to the same allowance as the root domain.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/stackUserPackageAllowance/{stackUserPackageAllowanceId}/addWeb", [
"domain_name" => "string"
]);
resellerIdrequirednumberYour reseller ID.stackUserPackageAllowanceIdrequirednumberThe stack user package allowance id
domain_namerequiredstringThe primary domain name for the new package (e.g. `example.com`).
Authorization: Bearer token
+ Body
{
domain_name: "string"
}
+ Body
1
Stack User Package Allowance
/reseller/{resellerId}/stackUserPackageAllowance/{stackUserPackageAllowanceId}/updatePOSTUpdate the packages set on this allowance
Replaces the full set of package IDs on this allowance to match the
provided list. Packages present in `$in` but not yet on the allowance
are added; packages currently on the allowance but absent from `$in`
are removed. Only packages belonging to the same namespace are eligible.
**Note:** Only the reseller (namespace owner) may call this endpoint.
Calling it as a sub-user will throw an `InvalidRequest` error.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/stackUserPackageAllowance/{stackUserPackageAllowanceId}/update");
resellerIdrequirednumberYour reseller ID.stackUserPackageAllowanceIdrequirednumberThe stack user package allowance id
Authorization: Bearer token
+ Body
{
add: 1,
remove: 1
}
Stack User Package Allowance
/reseller/{resellerId}/stackUserPackageAllowance/{stackUserPackageAllowanceId}GETRetrieve Information About a Stack User Package Allowance
Returns full details for this allowance, including the current package
ID list and any in-progress migration data.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/stackUserPackageAllowance/{stackUserPackageAllowanceId}");
resellerIdrequirednumberYour reseller ID.stackUserPackageAllowanceIdrequirednumberThe stack user package allowance id
Authorization: Bearer token
+ Body
{
{
allowance: "string",
allowanceRemaining: "string",
allowanceUsed: 1,
bundleTypeId: "string",
id: "string",
label: "string",
location: "string",
platform: "string",
packageIds: ["string"],
productSpec: "string",
migrationData:{
}
}
}
StackCP Users
/reseller/{resellerId}/explicitStackUserCheckPOSTCheck if a stack user exists
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/explicitStackUserCheck", [
"email" => "string"
]);
resellerIdrequirednumberYour reseller ID.
emailrequiredstringThe email address
Authorization: Bearer token
+ Body
{
email: "string"
}
+ Body
StackCP Users
/reseller/{resellerId}/susersPOSTUpdate or create StackCP Users
The "Update StackCP Users" API endpoint allows you to update your StackCP users. You can modify various details of the users, such as their contact information, FTP access, grant permissions, and more.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/susers", [
"contact" => [
"(user_ref)" => [
"person_name" => "string",
"company_name" => "string",
"address" => "string",
"city" => "string",
"sp" => "string",
"pc" => "string",
"cc" => "string",
"voice" => "string",
"notes" => "string",
"billing_ref" => "string",
"email" => "string",
]
],
"ftpLock" => [
"(user_ref)" => [
"existing" => [
"(lock_ref)" => [
"Ip4Address" => "string",
"Ip6Address" => "string",
"delete" => true
]
],
"new" => [
{
"Ip4Address" => "string",
"Ip6Address" => "string"
}
]
]
],
"grant_map" => [
"(user_ref)" => [
"(service_ref)" => true
]
],
"masterFtpAcl" => [
"(user_ref)" => [
"Ip4Address" => ["string"]
]
],
"newUser" => [
"person_name" => "string",
"company_name" => "string",
"address" => "string",
"city" => "string",
"sp" => "string",
"pc" => "string",
"cc" => "string",
"voice" => "string",
"notes" => "string",
"billing_ref" => "string",
"email" => "string",
"nominet_contact_type" => "string",
"sendNewStackUserEmail" => true,
"isAgencyClient" => true,
],
"users" => [
"(user_ref)" => [
"password" => "string",
"delete" => true
]
],
"masterFtp" => [
]
]);
resellerIdrequirednumberYour reseller ID.
contactrequiredobject
- ``user_ref`` (object,required) - The Stack user's contact details (for your reference)
- `person_name` (string,required) -
- `company_name` (string,nullable) -
- `address` (string,required) - Newline-separated lines withpossible trailling commas. At most 3 lines are
allowed.
- `city` (string,required) -
- `sp` (string,required) -
- `pc` (string,required) -
- `cc` (string,required) -
- `voice` (string,required) -
- `notes` (string,required) -
- `billing_ref` (string,nullable) -
- `email` (string,required) - Please note that setting this willrename the user
+ `ftpLock` (object,required) -
- ``user_ref`` (object,required) - The addresses that a Stack user can access FTP from
- `existing` (object,required) -
- ``lock_ref`` (object,required) -
- `Ip4Address` (string,required) -
- `Ip6Address` (string,required) -
- `delete` (boolean,required) - If true, the entry will be deleted.
- `new` (array[object],required) -
+ `grant_map` (object,required) - For example, ["stack-user:1" => ["package:2" => true]]
- ``user_ref`` (object,required) -
- ``service_ref`` (boolean,required) - False to revoke, true to grant.
+ `masterFtpAcl` (object,nullable) -
- ``user_ref`` (object,required) -
- `Ip4Address` (array[string],required) -
+ `newUser` (object,required) - Details of a new Stack user to set up.
- `person_name` (string,nullable) -
- `company_name` (string,nullable) -
- `address` (string,required) - Newline-separated lines withpossible trailling commas. At most 3 lines are
allowed.
- `city` (string,required) -
- `sp` (string,required) -
- `pc` (string,required) -
- `cc` (string,required) - Country in ISO3166-alpha3 format
- `voice` (string,required) -
- `notes` (string,nullable) -
- `billing_ref` (string,nullable) -
- `email` (string,required) - Required
- `nominet_contact_type` (string,nullable) - Seehttp://registrars.nominet.uk/registration-and-domain-management/field-definitions-and-registrant-types#MainContent
- `sendNewStackUserEmail` (boolean,nullable) - If truethen a new stack user email will be sent to the
user
- `isAgencyClient` (boolean,nullable) - True if the client belongs to the agency hub
+ `users` (object,required) -
- ``user_ref`` (object,required) -
- `password` (string,required) - New password to use
- `delete` (boolean,required) -
+ `masterFtp` (object,required) -
Authorization: Bearer token
+ Body
{
contact:{
(user_ref):{
person_name: "string",
company_name: "string",
address: "string",
city: "string",
sp: "string",
pc: "string",
cc: "string",
voice: "string",
notes: "string",
billing_ref: "string",
email: "string",
}
},
ftpLock:{
(user_ref):{
existing:{
(lock_ref):{
Ip4Address: "string",
Ip6Address: "string",
delete: true
}
},
new:{
Ip4Address: "string",
Ip6Address: "string"
}
}
},
grant_map:{
(user_ref):{
(service_ref): true
}
},
masterFtpAcl:{
(user_ref):{
Ip4Address: ["string"]
}
},
newUser:{
person_name: "string",
company_name: "string",
address: "string",
city: "string",
sp: "string",
pc: "string",
cc: "string",
voice: "string",
notes: "string",
billing_ref: "string",
email: "string",
nominet_contact_type: "string",
sendNewStackUserEmail: true,
isAgencyClient: true,
},
users:{
(user_ref):{
password: "string",
delete: true
}
},
masterFtp:{
}
}
+ Body
{
updated: 1,
password: "string",
ref: "string"
}
Welcome Emails
/package/{packageId}/sendWelcomePOSTSend a Welcome Email
Sends or re-sends the welcome email for this package. By default the
email is dispatched to all StackCP users associated with the package
who have a stored contact address. Pass `toAddress` to override and
target a specific recipient instead.
**Note:** The package must have a welcome email template configured
on its bundle type, otherwise this is a no-op and returns `false`.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/sendWelcome", [
"toAddress" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.
toAddressoptionalstring,nullableOverride recipient address (e.g. `"user@example.com"`or `"Name <user@example.com>"`). Omit to send to all known contacts.
Authorization: Bearer token
+ Body
{
toAddress: "string"
}
+ Body
true
Domain Names
Domain Name Transfer
/reseller/{resellerId}/transferDomainPOSTTransfer a Domain Name
The "Transfer a Domain Name" API endpoint allows you to transfer a domain name to your 20i account using the 20i API. This API call initiates the process of transferring a domain name from another registrar to 20i.
To transfer a domain name, you need to provide the following parameters in the request payload:
name: The domain name that you want to transfer.
years: The number of years for which you want to transfer the domain. In most cases, this should be unset or set to 0 for UK transfers.
contact: An array containing contact information for the domain. This includes the organization, name, address, telephone, email, and other details required for domain contact updates.
emulateYears: If set to true, supplying years greater than 0 for registries that do not support years on transfer (e.g., .uk) will be treated as a transfer and renew operation.
otherContacts: An optional array of additional contacts associated with the domain transfer. These contacts may be ignored for some transfers.
authcode: The current EPP authcode required for CentralNIC transfers.
limits: A limit code to value map that specifies domain limits for the transfer.
nameservers: An array of nameserver hostnames for the domain. If not provided, default nameservers will be used. This parameter is ignored for UK transfers.
privacyService: If set to true, domain privacy service will be added to the transfer order. Please note that this may not be applicable to some TLDs.
stackUser: An optional parameter to grant access to a specific stack user.
Upon successful execution of the API call, the response will return a boolean value indicating whether the transfer purchase was accepted.
It's important to note that a successful response does not guarantee the success of the actual domain transfer process.
Please note that you can also use the contract#add method instead of this method, as it performs a simple reformatting to use that method. Refer to the documentation of the contract#add method for more details.
If there are insufficient funds in your 20i account balance to cover the transfer fee, the transfer will fail.
The appropriate transfer fee and any additional charges for services like privacy will be deducted from your 20i account balance.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/transferDomain", [
"name" => "string",
"years" => 1,
"contact" => [
"organisation" => "string",
"name" => "string",
"address" => "string",
"telephone" => "string",
"email" => "string",
"cc" => "string",
"pc" => "string",
"sp" => "string",
"city" => "string",
"extension" => [
]
],
"emulateYears" => true,
"otherContacts" => [
"(type)" => [
"name" => "string",
"organisation" => "string",
"address" => "string",
"city" => "string",
"sp" => "string",
"pc" => "string",
"cc" => "string",
"telephone" => "string",
"email" => "string",
"extension" => [
]
]
],
"authcode" => "string",
"limits" => [
],
"nameservers" => ["string"],
"privacyService" => true,
"stackUser" => "string"
]);
resellerIdrequirednumberYour reseller ID.
namerequiredstringThe domain nameyearsrequirednumberThis should usually be unset or 0 for UK transfers,but see $emulateYears.contactrequiredobjectThis is slightly different from updating domain
contacts, as noted.
- `organisation` (string,required) - As $org when updatingdomain contacts
- `name` (string,required) - As updating domain contacts
- `address` (string,required) - Newline-separated lines withpossible trailling commas. At most 3 lines are
allowed.
- `telephone` (string,required) - As $voice when updatingdomain contacts
- `email` (string,required) - As updating domain contacts
- `cc` (string,required) - As updating domain contacts
- `pc` (string,required) - As updating domain contacts
- `sp` (string,nullable) - As updating domain contacts
- `city` (string,required) - As updating domain contacts
- `extension` (object,nullable) - As updating domain contacts
+ `emulateYears` (boolean,nullable) - If true, supplying years > 0 forregistries which do not support years on transfer (eg, for .uk)
will be treated as transfer + renew.
+ `otherContacts` (object,nullable) -
- ``type`` (object,required) - These may be ignored for some transfers.
- `name` (string,required) -
- `organisation` (string,required) -
- `address` (string,required) - Newline-separated lines withpossible trailling commas. At most 3 lines are
allowed.
- `city` (string,required) -
- `sp` (string,required) -
- `pc` (string,required) -
- `cc` (string,required) - Country in ISO3166-alpha2 format
- `telephone` (string,required) -
- `email` (string,required) -
- `extension` (object,nullable) - As updating domain contacts
+ `authcode` (string,nullable) - The current EPP authcode, as needed forCentralNIC transfers
+ `limits` (object,nullable) - A limit code to value map, see domain limits
+ `nameservers` (array[string],nullable) - Nameserver hostnames, eg "ns.example.org". Otherwise you
get defaults.
Ignored for UK transfers.
+ `privacyService` (boolean,required) - If true, this will add domain privacy toyour order. This may not be applicable to some TLDs. Please
note that for .UK this is a chargeable service which is
different from turning off disclosure.
+ `stackUser` (string,nullable) - A stack user to grant access to, eg."stack-user:123"
Authorization: Bearer token
+ Body
{
name: "string",
years: 1,
contact:{
organisation: "string",
name: "string",
address: "string",
telephone: "string",
email: "string",
cc: "string",
pc: "string",
sp: "string",
city: "string",
extension:{
}
},
emulateYears: true,
otherContacts:{
(type):{
name: "string",
organisation: "string",
address: "string",
city: "string",
sp: "string",
pc: "string",
cc: "string",
telephone: "string",
email: "string",
extension:{
}
}
},
authcode: "string",
limits:{
},
nameservers: ["string"],
privacyService: true,
stackUser: "string"
}
+ Body
true
Domain Periods
/domain-periodGETList domain periods
Returns a map of all supported TLDs to their allowed registration period
options (in years). For example: `{".uk":[1,2,3,4,5,6,7,8,9,10]}`.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/domain-period");
Authorization: Bearer token
+ Body
{
(tld): [1]
}
Domain Premium Type
/domainPremiumTypeGETPremium TLD Lookup
Returns a map of all supported TLDs to their premium pricing group code.
TLDs absent from the response have no premium pricing.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/domainPremiumType");
Authorization: Bearer token
+ Body
{
(tld): "string"
}
Domain Search
/domain-search/{prefix_or_name}GETDomain Search Lookup
Searches for one or more domain names. If you provide a domain name,
this will search for that name only, otherwise it will search for that
prefix on all supported TLDs. You may supply multiple literal domain
names if you separate them with commas.
You may supply arbitrary text, which will be stripped down to something
suitable for domain search. This is typically useful with suggestions
on.
Under some circumstances this will attempt a detailed search, which will
fetch more specific information about transferrable domains. This will
happen if you search for one domain name.
Domain Suggestions
Our primary domain availability provider supports suggesting names based
on the search, using simple semantic permutations of the supplied
name(s). For example if you're searching for mailboxdelivery.com it might
suggest post-delivery.com, mailboxsend.net and my-mailbox-delivery.com.
These are supported only in a small set of TLDs (including .com, .net,
.org, .info). These names are probably available, and will get properly
checked at the end of the results, meaning that you will get two results:
one marked "suggestion" and a later one which looks like a direct domain
search result.
At the current time, setting the TLDs to search is not supported. If a
domain is returned which you aren't set up to sell, you should exclude it
from your view.
**Note:** Results are streamed as newline-delimited JSON. Each result
object appears on its own line as soon as it is available, so response
order will differ from the header order.
**Note:** This endpoint is subject to usage limits. Exceeding the limit
will block further access for up to 24 hours.
------------------
------------------
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/domain-search/{prefix_or_name}");
prefix_or_namerequiredstringFIXME
Authorization: Bearer token
+ Body
[
{
header:{
names: ["string"]
},
name: "string",
can: "string",
expiryDate: "string",
hasRight: "string",
maxYears: 1,
price: 1.99,
push_transfer_registrar: "string",
startsNewPeriod: true
}
]
Domain Verification
/domainVerificationGETRetrieve Domain Verification Status
Returns a list of all domain names on the account with their ICANN
verification status.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/domainVerification");
Authorization: Bearer token
+ Body
[
{
{
id: "string",
closeToAnniversary: true,
deadDate: "string",
expiryDate: "string",
name: "string",
hasPrivacy: true,
pendingTransfer: true,
registrantIsVerified: true,
registrantVerificationChecked: "string",
renewalConstraint:{
},
preferredRenewalMonths: 1
}
}
]
List Domains
/domainGETRetrieve List of Domain Names
Returns a summary record for this domain. The fields included vary
by the `purpose` context — e.g. `"privacy"` includes `hasPrivacy`,
`"verification"` includes `registrantIsVerified`.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/domain");
Authorization: Bearer token
+ Body
[
{
id: "string",
closeToAnniversary: true,
deadDate: "string",
expiryDate: "string",
name: "string",
hasPrivacy: true,
pendingTransfer: true,
registrantIsVerified: true,
registrantVerificationChecked: "string",
renewalConstraint:{
},
preferredRenewalMonths: 1
}
]
Nominet Brand
/reseller/{resellerId}/nominetBrandGETFetch your nominet brand
The "Fetch your nominet brand" API endpoint allows you to retrieve your current Nominet brand settings.
This API call is used to obtain information about your Nominet brand, including the presence of a Nominet reseller, email address, trading name, URL, and phone number associated with your brand.
The response from this API call will be an array containing the following brand settings:
nominetReseller: Indicates whether a Nominet reseller exists for your brand. This field can be null if there is no Nominet reseller.
ukResellerEmail: Represents the email address associated with your brand, which is typically used as the support email address. This field can be null if no email address is provided.
ukResellerTradingName: Specifies the trading name associated with your brand, which is typically the business name. This field can be null if no trading name is specified.
ukResellerUrl: Provides the URL associated with your brand, typically used as the support URL. This field can be null if no URL is provided.
ukResellerVoice: Represents the phone number to display on your customers' UK domain WHOIS information.
Please note that this API endpoint is designed to provide access to your Nominet brand settings within the 20i platform.
It allows you to retrieve important information related to your brand, such as reseller status, contact details, and website information.
This API endpoint falls under the "Nominet Brand" section and serves as a means to fetch and retrieve your current Nominet brand settings.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/reseller/{resellerId}/nominetBrand");
resellerIdrequirednumberYour reseller ID.
Authorization: Bearer token
+ Body
{
nominetReseller: "string",
ukResellerEmail: "string",
ukResellerTradingName: "string",
ukResellerUrl: "string",
ukResellerVoice: "string"
}
POSTSet/Update your nominet brand
The "Set/Update your nominet brand" API endpoint allows you to configure and update your Nominet reseller settings.
You can set or update various parameters related to your Nominet brand, such as the reseller email, trading name, URL, and phone number.
Here are the details of the API endpoint:
$in: An array containing the following parameters:
nominetReseller: A string value indicating the action to be performed. Use "c" to set up a Nominet reseller, "u" to update it, or "d" to delete it.
ukResellerEmail: The email address associated with your Nominet reseller.
ukResellerTradingName: The trading name of your Nominet reseller.
ukResellerUrl: The URL of your Nominet reseller.
ukResellerVoice: The phone number to be displayed on your customers' UK domain WHOIS information.
The API call may throw an exception of type \ServiceServer\Exception\Associated in case of any associated errors.
The API will return a boolean value, indicating whether the operation was successful. If the Nominet brand settings are set or updated successfully, the API will return true. Otherwise, it will return false.
Please note that this API endpoint may take some time to execute.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/reseller/{resellerId}/nominetBrand", [
"nominetReseller" => "string",
"ukResellerEmail" => "string",
"ukResellerTradingName" => "string",
"ukResellerUrl" => "string",
"ukResellerVoice" => "string"
]);
resellerIdrequirednumberYour reseller ID.
nominetReselleroptionalstring,nullable"c" to set one up, "u" to updateit, "d" to delete it.ukResellerEmailoptionalstring,nullableSame as supportEmailAddressukResellerTradingNameoptionalstring,nullableSame as businessNameukResellerUrloptionalstring,nullableSame as supportUrlukResellerVoiceoptionalstring,nullableThe phone number to show on yourcustomers' UK domain WHOIS info.
Authorization: Bearer token
+ Body
{
nominetReseller: "string",
ukResellerEmail: "string",
ukResellerTradingName: "string",
ukResellerUrl: "string",
ukResellerVoice: "string"
}
+ Body
true
DNS & Nameservers
DNS
/package/{packageId}/domain/{domainId}/maxNameserversGETCheck Maximum Number of Nameservers for a Domain
Returns the registry-enforced maximum number of nameservers permitted
for this domain's TLD.
**Note:** This value is the same for all domains sharing a TLD —
cache the result by TLD rather than fetching it per domain.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/maxNameservers");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
1
DNS Default
/package/{packageId}/defaultDnsGETRetrieve Default DNS for a Package
Returns the recommended default DNS records for this package, including
standard mail (`MX`, `CNAME`) records for the stack mail platform and
hosting `A`/`AAAA` records from the web object. These are the records
you would apply to a domain to point it at this package.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/defaultDns");
packageIdrequirednumberThe Package ID retrieved from get packages.
Authorization: Bearer token
+ Body
{
}
DNS Default
/package/{packageId}/domain/{domainId}/defaultDnsGETRetrieve Default DNS for a Package
Returns the recommended baseline DNS record set for this domain,
derived from the attached web and mail services. These records are
applied automatically when a domain is first registered or transferred.
**Note:** The returned set always includes standard StackMail MX and
CNAME records. If the domain is a reseller temporary-URL domain, wildcard
A records for regional clusters are also included.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/defaultDns");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
A:{
host: "string",
ip: "string"
},
AAAA:{
host: "string",
ip: "string"
},
CNAME:{
host: "string",
target: "string"
},
MX:{
host: "string",
pri: 1,
target: "string"
},
TXT:{
host: "string",
txt: "string"
}
}
DNS google apps
/package/{packageId}/domain/{domainId}/dns/googleAppsGETRetrieve Google Apps DNS
Returns the DNS records required for a full Google Workspace (formerly G Suite)
deployment, covering mail, calendar, docs, and XMPP federation.
**Note:** Pass the returned records back in the `new` key when calling the
DNS update endpoint. It is strongly recommended that you also delete any
conflicting records (particularly existing MX and SPF TXT records) in the
same call to avoid mail delivery issues.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/dns/googleApps");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
MX:{
host: "string",
pri: 1,
target: "string"
},
SRV:{
host: "string",
pri: 1,
weight: 1,
port: 1,
target: "string"
},
TXT:{
host: "string",
txt: "string"
},
CNAME:{
host: "string",
target: "string"
}
}
POSTAdd Google Apps DNS
Adds the full Google Workspace DNS record set (equivalent to fetching
`googleApps` and submitting those records). Existing records are not
removed unless `conflictPolicy` is set to `"replace"`.
**Note:** The default `conflictPolicy` is `"reject"`. If conflicting
records (e.g. existing MX entries) are present and you use `"reject"`,
the entire call will fail. Use `"replace"` to overwrite them automatically.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/dns/googleApps", [
"conflictPolicy" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
conflictPolicyoptionalstring,nullableHow to handle records that conflict with existing ones:`"reject"` (default) aborts on conflict, `"replace"` overwrites, `"ignore"` skips
Authorization: Bearer token
+ Body
{
conflictPolicy: "string"
}
+ Body
{}
DNS google mail
/package/{packageId}/domain/{domainId}/dns/googleAppsMailOnlyGETRetrieve Google Mail DNS
Returns the DNS records required for Google Mail (Gmail) only, without
the additional Google Workspace app and XMPP records.
**Note:** Pass the returned records back in the `new` key when calling the
DNS update endpoint. It is strongly recommended that you also delete any
conflicting MX and SPF TXT records in the same call.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/dns/googleAppsMailOnly");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
{
MX:{
host: "string",
pri: 1,
target: "string"
},
TXT:{
host: "string",
txt: "string"
},
CNAME:{
host: "string",
target: "string"
}
}
POSTAdd Google Apps Mail DNS
Adds the Google Mail-only DNS record set (equivalent to fetching
`googleAppsMailOnly` and submitting those records). Existing records are
not removed unless `conflictPolicy` is set to `"replace"`.
**Note:** The default `conflictPolicy` is `"reject"`. If conflicting
records are present and you use `"reject"`, the entire call will fail.
Use `"replace"` to overwrite them automatically.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/dns/googleAppsMailOnly", [
"conflictPolicy" => "string"
]);
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
conflictPolicyoptionalstring,nullableHow to handle records that conflict with existing ones:`"reject"` (default) aborts on conflict, `"replace"` overwrites, `"ignore"` skips
Authorization: Bearer token
+ Body
{
conflictPolicy: "string"
}
+ Body
{}
DNS Nameservers
/package/{packageId}/domain/{domainId}/nameserversGETRetrieve Nameservers for a Domain
Returns the nameservers currently registered at the registry for this domain.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->getWithFields("/package/{packageId}/domain/{domainId}/nameservers");
packageIdrequirednumberThe Package ID retrieved from get packages.domainIdrequirednumberThe domain ID retrieved from get domains.
Authorization: Bearer token
+ Body
["string"]
POSTUpdate Nameservers for a Domain Name
Updates the nameservers for the domain at the registry. Supply the
nameservers to add in `ns` and the ones to remove in `old-ns`.
**Note:** If the supplied `old-ns` entries do not match what the registry
holds, the registry may reject the request. Do not include nameservers in
both `ns` and `old-ns` — some registries handle this incorrectly. Only
list names that are actually being added or removed.
<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);
$request = $services_api->postWithFields("/package/{packageId}/domain/{domainId}/nameservers", [
"ns" => ["string"],
"old-ns" => ["string"]
]);