# records.remove()

Canonical URL: https://developers.iagenify.com/sdk/ref/domain/records/remove/
Language: en

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

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

Status: DELETE · by id · no undo

```javascript
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);
```

## By identifier, deliberately {#by-id}

> **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 {#consequences}

| Removing | Stops |
| --- | --- |
| An address or alias record | The site at that name. |
| A mail record | Mail arriving. **Nothing appears broken.** |
| The signing key | Messages being verifiable — including ones already sent. |
| The policy | What receivers do with misaligned mail. |

## For mail, prefer disable() {#mail}

[mail.disable()](/sdk/ref/domain/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 {#propagation}

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

- [records.list()](/sdk/ref/domain/records/list): Finding the identifier.
- [mail.disable()](/sdk/ref/domain/mail/disable): The right way for mail.

```python
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"])
```
