---
title: "Detach a record from a note"
method: DELETE
path: "/public-api/v1/notes/{note_id}/links/{id}"
tags: ["Notes"]
---

# Detach a record from a note

`DELETE /public-api/v1/notes/{note_id}/links/{id}`

## Request

- Base URL: `https://app.hellobonsai.com`
- URL: `https://app.hellobonsai.com/public-api/v1/notes/{note_id}/links/{id}`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://app.hellobonsai.com/oauth/authorize`
    - Token URL: `https://app.hellobonsai.com/oauth/token`
  - HTTP bearer

Detaches one record from a note. The response hands back the attachment
as it was, so you can log exactly what was removed.

Unlike attaching, this is not idempotent: the attachment is gone for
good, so a repeat call returns `404`. A retry after a timeout will hit
that rather than succeeding twice.

The note itself is untouched. Detaching its last record leaves it in the
workspace as a note without records, rather than deleting it.

Detaching takes the same permission as editing the note, so the person
who wrote a note can always detach from it.

## Response `200`

The record was detached. The attachment as it was is in `data`.

- object
  - `data` NoteLink, required: The attachment between a note and one of the records it is written about.
    - `id` integer, required: Unique identifier for the attachment between the note and the record.
    - `record_id` integer, required: Id of the attached record, in the resource named by `record_type`.
    - `record_type` 'company' | 'project' | 'contact' | 'deal' | 'null', nullable, required: Which kind of record the note is attached to.
  - `meta` Meta, required: Metadata returned alongside every single-resource response.
    - `request_id` string, required: Identifier for this request. Quote it when contacting support about a specific call.

## Other responses

- `401`: The access token is missing, expired or invalid.
- `403`: This token can see the note but is not allowed to edit it.
- `404`: No such note or attachment that this token can see. An attachment already detached returns `404` too.
- `429`: Rate limit exceeded. Wait at least `Retry-After` seconds before trying again.

---

[API](https://skmtc.dev/hellobonsai/apis/bonsai-api.md) - [All operations](https://skmtc.dev/hellobonsai/apis/bonsai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hellobonsai/apis/bonsai-api/revisions/abf12ed6a8d3?raw)
