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 putA 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 DomainA domain you bought through NoClick, transferred in, or connected from elsewhere, and what it serves.
- Like every live object, it also has hydrate(), refresh() and raw.
| id | string | |
| name | string | The domain, like |
| source | DomainSource |
|
| noClickDns | boolean | Whether NoClick hosts its DNS: a bought domain, or a transferred one after
|
| wildcard | boolean | Whether its |
| status | DomainStatus |
|
| expiresAt | Date | null | When the registration runs out (null for a connected domain). |
| autoRenew | boolean | null | Renews itself 30 days before |
| renewableUntil | Date | null | The end of the guaranteed renewal window after |
| renewalUsd | number | null | What renewing for |
| renewalYears | number | null | The term |
| registrant | DomainContact | null | The person it's registered to (null for a connected domain); |
| records | DnsRecord[] | The records it needs for what it serves: to add at its DNS host (connected), or kept by NoClick (bought). |
| setupUrl | string | 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). |
| serves | DomainService[] | What it points at: each app and inbox. |
| registrantEmail | string | null | Where the link to confirm the registrant's address went, sent in your brand on ICANN's behalf (a bought domain). |
| registrantVerifyBy | Date | null | While |
| transferLockedUntil | Date | null | Until then |
| userId | string | null | |
| createdAt | Date | null | |
| dns | DomainDns | 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.
Return at most this many.
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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.
The most it may cost now, in US dollars; above it the purchase throws PriceExceeded.
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.
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.
Renew 30 days before expiry (true by default).
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.
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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.
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.
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.
The code the current registrar gives to move the domain out (its EPP or auth code).
The most it may cost, in US dollars; above it the transfer throws PriceExceeded.
The person it's registered to from now on: required for a user's domain, as in Domain.buy.
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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;
},
): DomainA 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.
The most it may cost now, in US dollars; above it the purchase throws PriceExceeded.
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.
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.
Renew 30 days before expiry (true by default).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
undefined = the ambient user (asUser), null = the account itself.
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.
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): DomainA lazy reference to a domain by id.
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.
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).
Return at most this many.
Which users the read covers (user_id query), instead of acting as one (user).
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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.
The next_cursor of the page before; omit it for the first page.
Return at most this many.
Which users the read covers (user_id query), instead of acting as one (user).
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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.
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).
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).
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).
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.
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 DomainOfferA name from Domain.search; buy it with Domain.buy(offer, { maxPriceUsd }).
| name | string | |
| available | boolean | |
| priceUsd | number | null | What buying it charges now, for |
| renewalUsd | number | null | What each renewal of |
| premium | boolean | The registry prices this name above its usual rate, often far above. |
| minYears | number | null | The TLD's shortest term, in years (two for |
| maxYears | number | null | The TLD's longest term, in years. |
| claimsNotice | string | 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
|
| raw | JsonObject | The response JSON exactly as the API sent it. |
DomainContact
interface DomainContactThe 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.
| name | string | |
| string | ||
| phone | string | E.164, like |
| address | string | A second street line follows a newline. |
| city | string | |
| postalCode | string | |
| country | string | Two letters, like |
| region | string | The state, province or region of the address; the registry requires one. |
| organization | string | 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. |
| agreementAcceptedAt | Date | When this person explicitly accepted the domain registration agreement ( |
DomainPurchase
class DomainPurchase extends OperationA 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.
- Inherits from Operation.
| priceUsd | number | null | What it charges your account, in US dollars. |
| domainId | string | null | The domain being bought or renewed. |
| domain | Domain | The domain, already listed while it runs (its |
purchaseFromIdstaticTypeScript only
static purchaseFromId(
operationId: string,
options?: CallOptions,
): DomainPurchaseA lazy reference to a purchase by operation id: resume it anywhere, price and domain included (Operation.fromId gives a plain operation).
DomainTransfer
class DomainTransfer extends OperationA 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.
- Inherits from DomainPurchase.
transferFromIdstaticTypeScript only
static transferFromId(
operationId: string,
options?: CallOptions,
): DomainTransferA lazy reference to a transfer by operation id: resume it anywhere, price and domain included (Operation.fromId gives a plain operation).
DnsRecord
interface DnsRecordOne 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.
| type | string | |
| name | string | |
| value | string | |
| status | string | null |
|
| purpose | string | null | What it's for, in a few words. |
| required | boolean | |
| managed | boolean | |
| raw | JsonObject | The response JSON exactly as the API sent it. |
DomainDns
class DomainDnsdomain.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.
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.
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.
TransferCode
class TransferCodeWhat domain.transferOut() gives; printing it never shows the code.
| authCode | string | Give it to the other registrar. |
| unlockedAt | Date | null | |
| expiresAt | Date | null | When the code stops working, where the registry limits it (null otherwise); |
| raw | JsonObject | The response JSON exactly as the API sent it. |
TransferQuote
interface TransferQuoteWhat 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.
| name | string | |
| eligible | boolean | |
| reason | string | null | Why it can't move now (null when it can). |
| priceUsd | number | null | What the transfer charges your account, in US dollars; it adds |
| renewalUsd | number | null | What each renewal of |
| years | number | null | The term the transfer adds to the registration: the TLD's minimum, one year for most. |
| lockedUntil | Date | null | The end of the registry's transfer lock, while it applies. |
| raw | JsonObject | The response JSON exactly as the API sent it. |
DomainAgreement
interface DomainAgreementNoClick'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.
| url | string | |
| version | string | |
| raw | JsonObject | The response JSON exactly as the API sent it. |