Domain

Domains: buy one in your user's name, connect one they own, or transfer one in.

[offer] = noclick.Domain.search("anasilva", tlds=["dev"], limit=1)
ana = noclick.DomainContact(name="Ana Silva", email="ana@example.com", phone="+14155550123",
                            address="500 Market St", city="San Francisco", region="CA", postal_code="94105",
                            country="US", agreement_accepted_at=accepted_at)   # when she accepted the agreement
with noclick.as_user("user_42"):
    bought = noclick.Domain.buy(offer, max_price_usd=20, registrant=ana).wait()   # Ana's, charged to you

owned = noclick.Domain.connect("acme.test")              # one they already own
for record in owned.records:
    print(record.type, record.name, record.value)       # add these where its DNS is hosted
inbox = noclick.Inbox.create(local_part="help", domain="mail.acme.test")   # its own mail stays put

A bought domain is registered to the person (you, or the user it's bought for) and charged to your account in dollars, like everything else: NoClick never bills your users. It's never deleted: turn off auto-renew to let it lapse, or transfer_out() to move it to another registrar. One registered elsewhere moves here with Domain.transfer_in.

class Domain

A domain you bought through NoClick, transferred in, or connected from elsewhere, and what it serves.

Attributes
idstring
namestring

The domain, like acmebooking.com.

sourceDomainSource

bought (through NoClick), transferred (moved here from another registrar, then registered through NoClick like a bought one) or connected (owned elsewhere).

noClickDnsboolean

Whether NoClick hosts its DNS: a bought domain, or a transferred one after useNoClickDns(). When false, records are added where its DNS is hosted and dns throws NotAvailable.

wildcardboolean

Whether its *.<name> records are set too, so every subdomain can serve.

statusDomainStatus

awaiting_human (its purchase held for your policy's approver), registering, transferring_in (moving here from another registrar), pending_dns, active, registrant_unverified, expiring, expired, transferring_out or failed.

expiresAtDate | null

When the registration runs out (null for a connected domain).

autoRenewboolean | null

Renews itself 30 days before expiresAt (null for a connected domain).

renewableUntilDate | null

The end of the guaranteed renewal window after expiresAt: the last moment renew() works (null for a connected domain).

renewalUsdnumber | null

What renewing for renewalYears costs, in US dollars.

renewalYearsnumber | null

The term renewalUsd buys, in years: the TLD's minimum (null for a connected domain).

registrantDomainContact | null

The person it's registered to (null for a connected domain); update({ registrant }) changes it.

recordsDnsRecord[]

The records it needs for what it serves: to add at its DNS host (connected), or kept by NoClick (bought).

setupUrlstring | null

A connected domain's one-click setup, where its DNS host supports the open Domain Connect standard; the host's consent page names NoClick alongside your brand (null otherwise).

servesDomainService[]

What it points at: each app and inbox.

registrantEmailstring | null

Where the link to confirm the registrant's address went, sent in your brand on ICANN's behalf (a bought domain).

registrantVerifyByDate | null

While registrant_unverified: the day (15 days on) the domain stops resolving unless the registrant has confirmed.

transferLockedUntilDate | null

Until then transferOut() throws NotAvailable: the registry's transfer lock after a domain is registered, transferred in or its registrant changes.

userIdstring | null
createdAtDate | null
dnsDomainDns

The records of a bought domain.

searchstatic

static search(
  query: string,
  options?: CallOptions & { tlds?: string[]; limit?: number },
): Promise<DomainOffer[]>

Names for sale built from query (a word, or a whole name), in tlds or a common set, with close alternatives: up to limit (10 by default, at most 50), exact matches first, each priced for the TLD's shortest term (minYears), with any trademark claimsNotice.

Parameters
querystringrequired
options.tldsstring[]
options.limitnumber

Return at most this many.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

Up to limit offers (10 by default, at most 50), exact matches first, each with its price and renewal price for the TLD's shortest term (min_years), the longest it allows (max_years), whether it's available, and any trademark claims_notice. Names that imitate well-known brands or banks aren't offered.

buystatic

static buy(
  offer: string | DomainOffer,
  options: DomainBuyOptions,
): Promise<DomainPurchase>

Register offer in the person's name (yours, or inside asUser the user's) for years, the TLD's minimum when omitted, charged to your account and never to the user, refused with PriceExceeded above maxPriceUsd. A user's domain needs registrant, the person's details with agreementAcceptedAt (InvalidRequest without it); one your account buys for itself, outside asUser, uses the account's default registrant when you pass none (with none set, it throws ActionRequired whose nextStep links to where it's set, and nothing is bought). A name with a claimsNotice needs acceptClaims. NoClick checks your account can pay before registering (PaymentRequired otherwise) and charges it when the registry confirms the registration; one that fails is never charged. A policy hold waits in awaiting_human until the approver answers; nobody answering within 24 hours expires it, and nothing is charged. The price is checked against maxPriceUsd again when it runs.

Parameters
offerstring | DomainOfferrequired
options.maxPriceUsdnumberrequired

The most it may cost now, in US dollars; above it the purchase throws PriceExceeded.

options.yearsnumber

The term, in years: between the offer's minYears and maxYears, the TLD's minimum when omitted. One the TLD doesn't offer throws InvalidRequest naming years, with the terms it does.

options.registrantDomainContact

The person it's registered to. Required for a user's domain (inside asUser, or with user): without it InvalidRequest names registrant and nothing is sent. A domain your account buys for itself uses the account's default registrant instead (Domain.setDefaultRegistrant), and with none set throws ActionRequired whose nextStep links to the console page where it's set.

options.autoRenewboolean

Renew 30 days before expiry (true by default).

options.acceptClaimsboolean

True once the registrant has been shown the offer's claimsNotice and still wants the name. A name with a notice is refused without it (ActionRequired whose details carry claims_notice), and nothing is bought.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The purchase: an operation whose .wait() gives the Domain once it's registered and its DNS is set up.

agreementstatic

static agreement(options?: { client?: NoClick }): Promise<DomainAgreement>

NoClick's domain registration agreement, which every registrant accepts: its page names the sponsoring registrar, as ICANN requires, and carries the fee schedule (registration, renewal, renewal after expiry, restore) and ICANN's registrant rights and responsibilities. Show it to the person, and record when they accept it as agreementAcceptedAt on their DomainContact: a registration needs it.

Parameters
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The agreement's url and version.

defaultRegistrantstatic

static defaultRegistrant(
  options?: { client?: NoClick },
): Promise<DomainContact | null>

The registrant your account's own domains are registered to when a purchase names none (null until set).

Parameters
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The contact, or None until you set one.

setDefaultRegistrantstatic

static setDefaultRegistrant(
  contact: DomainContact | null,
  options?: { client?: NoClick },
): Promise<DomainContact | null>

Set (or with null clear) the registrant your account's own domains use when a purchase names none, so Domain.buy or Domain.fromName(..., { createIfMissing }) outside asUser needs no contact in code; until one is set, such a purchase throws ActionRequired. A user's domain is still registered to that user: pass their details as registrant. Like any registrant, it needs agreementAcceptedAt.

Parameters
contactDomainContact | nullrequired
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The contact now on file (None once cleared).

connectstatic

static connect(
  name: string,
  options?: CallOptions & { wildcard?: boolean },
): Promise<Domain>

Connect a domain the person owns (acme.com, or book.acme.com). It's pendingDns until records are added where its DNS is hosted (setupUrl does it in one click where the host supports it). On a bare domain www is primary and the bare name needs CNAME flattening or a forward. wildcard: true adds the *.<name> records too, so every subdomain can serve an app or send an app's email without a record of its own; each goes live once its certificate is issued, usually within minutes of its first use.

Parameters
namestringrequired
options.wildcardboolean
options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The domain, pending_dns until the records in records are added where its DNS is hosted, with setup_url when that host can add them in one click (the open Domain Connect standard; the host's consent page names NoClick alongside your brand).

transferQuotestatic

static transferQuote(
  name: string,
  options?: CallOptions,
): Promise<TransferQuote>

Whether name (registered elsewhere) can move to NoClick now, and what it costs. Nothing is charged. NoClick works it out from the domain's public registration data (its registrar lock, its transfer lock, whether NoClick registers the TLD) and the registrar's price, so it's a best answer until transferIn is accepted.

Parameters
namestringrequired
options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The quote: eligible with the price_usd the transfer charges (it adds years to the registration) and the renewal_usd after, or not eligible with the reason and, inside the registry's transfer lock, locked_until.

transferInstatic

static transferIn(
  name: string | TransferQuote | Domain,
  options: DomainTransferOptions,
): Promise<DomainTransfer>

Move name (a name, a TransferQuote, or a domain you connected) to NoClick from its current registrar, with the authCode that registrar gives. It's charged to your account like a purchase once the transfer completes (PriceExceeded above maxPriceUsd, awaiting_human while your policy holds it), and registered to registrant on the same rule as Domain.buy, agreementAcceptedAt included: required for a user's domain, else the account's default registrant. One the registry won't move now throws NotAvailable with the reason. Its nameservers don't change, so its DNS keeps working where it's hosted; once it's active, useNoClickDns() moves the DNS to NoClick. A connected domain keeps its id and what it serves; passed as a Domain, the transfer acts in that domain's own scope (its user, else your account), while a name acts for the current user or user.

Parameters
namestring | TransferQuote | Domainrequired
options.authCodestringrequired

The code the current registrar gives to move the domain out (its EPP or auth code).

options.maxPriceUsdnumberrequired

The most it may cost, in US dollars; above it the transfer throws PriceExceeded.

options.registrantDomainContact

The person it's registered to from now on: required for a user's domain, as in Domain.buy.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The transfer: an operation whose .wait() gives the Domain once it's moved, source transferred. The domain is transferring_in meanwhile, up to about 5 days; the current owner may be emailed by their registrar to approve. If the registry refuses (a wrong auth code is noclick.InvalidRequest naming auth_code), the transfer fails with its reason and nothing is charged.

fromNamestatic

static fromName(
  name: string,
  options?: CallOptions & Partial<DomainBuyOptions> & {
    createIfMissing?: boolean;
  },
): Domain

A lazy reference to your domain called name; loading one that isn't yours throws NotFound. With createIfMissing your code owns it idempotently: the first time it's used with no such domain it's bought as Domain.buy would (maxPriceUsd is required, years is the TLD's minimum when omitted, and a user's domain needs registrant), and an existing one whose autoRenew differs is updated.

Parameters
namestringrequired
options.createIfMissingboolean
options.maxPriceUsdnumber

The most it may cost now, in US dollars; above it the purchase throws PriceExceeded.

options.yearsnumber

The term, in years: between the offer's minYears and maxYears, the TLD's minimum when omitted. One the TLD doesn't offer throws InvalidRequest naming years, with the terms it does.

options.registrantDomainContact

The person it's registered to. Required for a user's domain (inside asUser, or with user): without it InvalidRequest names registrant and nothing is sent. A domain your account buys for itself uses the account's default registrant instead (Domain.setDefaultRegistrant), and with none set throws ActionRequired whose nextStep links to the console page where it's set.

options.autoRenewboolean

Renew 30 days before expiry (true by default).

(omit to leave it unchanged)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.acceptClaimsboolean

True once the registrant has been shown the offer's claimsNotice and still wants the name. A name with a notice is refused without it (ActionRequired whose details carry claims_notice), and nothing is bought.

Returns

A domain that loads (or is bought) the first time you read a field; noclick.NotFound then if there's none. A domain just bought is registering (awaiting_human while your policy holds it) until the purchase finishes. Nothing is sent yet.

fromIdstatic

static fromId(domainId: string, options?: CallOptions): Domain

A lazy reference to a domain by id.

Parameters
domainIdstringrequired
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
Returns

A domain that loads the first time you read a field. Nothing is sent yet.

getstatic

static get(domainId: string, options?: CallOptions): Promise<Domain>

Load a domain by id now; an unknown id raises noclick.NotFound.

Parameters
domainIdstringrequired
options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The domain, loaded.

liststatic

static list(options?: ReadOptions & { limit?: number }): Promise<Domain[]>

Your domains, bought and connected (the current user's inside asUser, or those userFilter covers).

Parameters
options.limitnumber

Return at most this many.

options.userFilterUserFilter

Which users the read covers (user_id query), instead of acting as one (user).

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

Every matching domain, newest first, fetched page by page. A domain transferred out or disconnected isn't listed.

listPagestatic

static listPage(options?: ReadOptions & PageOptions): Promise<Page<Domain>>

One page of domains; pass nextCursor back as cursor.

Parameters
options.cursorstring | null

The next_cursor of the page before; omit it for the first page.

options.limitnumber

Return at most this many.

options.userFilterUserFilter

Which users the read covers (user_id query), instead of acting as one (user).

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

A page whose data holds the domains and whose next_cursor is None on the last page.

verify

verify(): Promise<this>

Check the domain's DNS now; each record's status and the domain's own are as found.

Returns

This domain, with each record's status and the domain's own status as found.

update

update(
  changes: { autoRenew?: boolean; registrant?: DomainContact },
): Promise<this>

Change a bought domain's settings: { autoRenew: false } lets it lapse at expiresAt, and registrant replaces the details of the person it's registered to. ICANN requires accurate details, so update them when the person's change. Changing the registrant's name, organization or email asks the new registrant to confirm their email again (the domain is registrant_unverified meanwhile) and may start the registry's transfer lock (see transferLockedUntil).

Parameters
changes{ autoRenew?: boolean; registrant?: DomainContact }required
Returns

This domain, updated.

renew

renew(options: { years?: number; maxPriceUsd: number }): Promise<DomainPurchase>

Extend a bought domain now by years, or the TLD's minimum term (renewalYears) when omitted, charged to your account when the renewal lands; like a purchase it may wait in awaiting_human for your policy's approver. After renewableUntil it throws NotAvailable: renewing past the guaranteed renewal window, or restoring a domain the registry is about to delete, isn't an API call (NoClick support may be able to restore it, at the registry's restore fee).

Parameters
options.yearsnumber
options.maxPriceUsdnumberrequired
Returns

The renewal: an operation whose .wait() gives the Domain with its later expires_at.

useNoClickDns

useNoClickDns(): Promise<DnsRecord[]>

Move a transferred domain's DNS hosting to NoClick: the records NoClick can read where it's hosted now are copied first, then its nameservers change. Resolves to the records copied, for review: add any it missed with dns.set. On a domain whose DNS NoClick already hosts it copies nothing; a connected domain throws NotAvailable (transfer it in first).

Returns

The records it copied, for review: add any it couldn't read with dns.set. The domain's noclick_dns is now True.

transferOut

transferOut(): Promise<TransferCode>

Unlock a bought or transferred domain for another registrar; inside the registry's transfer lock (transferLockedUntil) it throws NotAvailable. The code works until its expiresAt.

Returns

The auth code to give the other registrar, until its expires_at (call transfer_out() again for a fresh one). The domain shows transferring_out until the move completes, then leaves your list.

delete

delete(): Promise<void>

Disconnect a connected domain (its DNS stays as it is where it's hosted). Throws Conflict while an inbox uses it, and on a bought domain, which can only lapse or transfer out.

DomainOffer

interface DomainOffer

A name from Domain.search; buy it with Domain.buy(offer, { maxPriceUsd }).

Attributes
namestring
availableboolean
priceUsdnumber | null

What buying it charges now, for minYears, in US dollars.

renewalUsdnumber | null

What each renewal of minYears costs.

premiumboolean

The registry prices this name above its usual rate, often far above.

minYearsnumber | null

The TLD's shortest term, in years (two for .ai): what Domain.buy registers when years is left out.

maxYearsnumber | null

The TLD's longest term, in years.

claimsNoticestring | null

During the TLD's trademark-claims period, for a name that matches a registered trademark: the Trademark Clearinghouse notice (Markdown) the registrant must be shown before buying it, with acceptClaims: true once they have (null otherwise).

rawJsonObject

The response JSON exactly as the API sent it.

DomainContact

interface DomainContact

The registrant: the person a domain is registered to, as the registry records it. ICANN requires real details, kept accurate (domain.update({ registrant }) when they change), and email is sent a link to confirm the address, in your brand on ICANN's behalf; a person confirms once, for all their domains. Domains are registered through NoClick's registrar partner, which the public registration record names; privacy protection keeps the registrant's details out of it.

Attributes
namestring
emailstring
phonestring

E.164, like +14155550123.

addressstring

A second street line follows a newline.

citystring
postalCodestring
countrystring

Two letters, like US.

regionstring

The state, province or region of the address; the registry requires one.

organizationstring

When set, that organization is the legal owner (ICANN's "Registered Name Holder"): never put your company on a user's domain unless your company means to own it.

agreementAcceptedAtDate

When this person explicitly accepted the domain registration agreement (Domain.agreement()'s url). A registration needs it: a registrant, or your account's default registrant, without it is refused with InvalidRequest naming registrant.agreement_accepted_at.

DomainPurchase

class DomainPurchase extends Operation

A domain bought or renewed: the operation Domain.buy and domain.renew return. It's charged to your account when the registry confirms it, and one that fails is never charged; while your policy holds it for a person to approve, it waits in awaiting_human. wait() resolves to the Domain.

Attributes
priceUsdnumber | null

What it charges your account, in US dollars.

domainIdstring | null

The domain being bought or renewed.

domainDomain

The domain, already listed while it runs (its status follows it).

purchaseFromIdstaticTypeScript only

static purchaseFromId(
  operationId: string,
  options?: CallOptions,
): DomainPurchase

A lazy reference to a purchase by operation id: resume it anywhere, price and domain included (Operation.fromId gives a plain operation).

Parameters
operationIdstringrequired
options.clientNoClick
options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

DomainTransfer

class DomainTransfer extends Operation

A domain moving to NoClick from another registrar: the operation Domain.transferIn returns, charged to your account like a purchase (the quote, which adds the quote's years to the registration) once the transfer completes, with the same priceUsd, domainId and domain. The domain is transferring_in while the registry and the current registrar move it, up to about 5 days; wait() resolves to the Domain once it's active. If the registry refuses (a wrong auth code is InvalidRequest naming authCode), it fails with the registry's reason and nothing is charged.

transferFromIdstaticTypeScript only

static transferFromId(
  operationId: string,
  options?: CallOptions,
): DomainTransfer

A lazy reference to a transfer by operation id: resume it anywhere, price and domain included (Operation.fromId gives a plain operation).

Parameters
operationIdstringrequired
options.clientNoClick
options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

DnsRecord

interface DnsRecord

One DNS record. name is @ for the domain itself, or the label before it (www). required is false for a record the domain works without (a connected domain's bare-name ALIAS, which forwarding can replace); managed marks one NoClick keeps for what it serves.

Attributes
typestring
namestring
valuestring
statusstring | null

verified once public DNS answers with it, pending until then, conflict when another record is in the way.

purposestring | null

What it's for, in a few words.

requiredboolean
managedboolean
rawJsonObject

The response JSON exactly as the API sent it.

DomainDns

class DomainDns

domain.dns: the records of a bought domain, whose DNS NoClick hosts. A connected domain's DNS stays where it is (domain.records lists what to add there), so these throw NotAvailable on one.

records

records(): Promise<DnsRecord[]>

Every record in the domain's DNS: yours, and the ones NoClick keeps (managed) for what it serves.

Returns

The records, each with its status; managed marks NoClick's.

set

set(type: string, name: string, value: string): Promise<DnsRecord>

Add a record, or keep it if the same one is there. A CNAME replaces the name's existing CNAME; other types add alongside. One that clashes with a managed record throws Conflict.

Parameters
typestringrequired
namestringrequired
valuestringrequired
Returns

The record as saved; its status turns verified once public DNS serves it, usually within minutes.

delete

delete(record: DnsRecord): Promise<void>

Remove record (from records()); a managed one throws Conflict.

Parameters
recordDnsRecordrequired

TransferCode

class TransferCode

What domain.transferOut() gives; printing it never shows the code.

Attributes
authCodestring

Give it to the other registrar.

unlockedAtDate | null
expiresAtDate | null

When the code stops working, where the registry limits it (null otherwise); transferOut() again gives a fresh one.

rawJsonObject

The response JSON exactly as the API sent it.

TransferQuote

interface TransferQuote

What moving a domain to NoClick from its current registrar costs, and whether the registry allows it now: eligible is false (with reason) while the domain is locked at its registrar, inside the registry's transfer lock after a domain is registered, transferred in or its registrant changes (lockedUntil), on a TLD NoClick doesn't register, or already with NoClick's registrar under another account (moving it between accounts isn't supported yet). NoClick works it out from the domain's public registration data and the registrar's price, so it's a best answer until Domain.transferIn is accepted.

Attributes
namestring
eligibleboolean
reasonstring | null

Why it can't move now (null when it can).

priceUsdnumber | null

What the transfer charges your account, in US dollars; it adds years to the registration.

renewalUsdnumber | null

What each renewal of years costs after.

yearsnumber | null

The term the transfer adds to the registration: the TLD's minimum, one year for most.

lockedUntilDate | null

The end of the registry's transfer lock, while it applies.

rawJsonObject

The response JSON exactly as the API sent it.

DomainAgreement

interface DomainAgreement

NoClick's domain registration agreement, from Domain.agreement(). The page at url is the agreement the registrant accepts (it names the sponsoring registrar, as ICANN requires), the fee schedule (registration, renewal, renewal after expiry, restore) and ICANN's registrant rights and responsibilities. Show it to the person and record when they accept it, as agreementAcceptedAt on their DomainContact. version names the revision.

Attributes
urlstring
versionstring
rawJsonObject

The response JSON exactly as the API sent it.