Get an API key
Domain

records.remove()

domain.records.remove(recordId) → Promise<{ ok: true }>

Removes one record, by its identifier. There is no undo and no confirmation.

DELETEby idno undo
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const records = await domain.records.list();
const stale = records.find((r) => r.type === "CNAME" && r.name === "old");

if (stale) await domain.records.remove(stale.id);
records = domain.records.list()
stale = next((r for r in records if r["type"] == "CNAME" and r["name"] == "old"), None)

if stale:
    domain.records.remove(stale["id"])

By identifier, deliberately

Not by type and name

Several records can share a type and a name — mail servers, text records. Removing « the MX at the apex » would be ambiguous, and the ambiguity would be resolved by guessing. Listing first and removing a specific one is the shape that cannot delete the wrong thing.

What a removal does

RemovingStops
An address or alias recordThe site at that name.
A mail recordMail arriving. Nothing appears broken.
The signing keyMessages being verifiable — including ones already sent.
The policyWhat receivers do with misaligned mail.

For mail, prefer disable()

mail.disable() removes only what we posed, leaves the customer's own records alone, and keeps the signing key. Removing mail records one at a time does none of that.

Resolvers keep it briefly

A record lives in caches for its lifetime. The name can keep answering after this returns.