Knowledge CenterAPI References

Note Relations

A Note Relation (noteTarget) links a Note to a Person, Company, or Opportunity. One note can be linked to multiple records by creating multiple relations. First create the note at /rest/notes, then link it here.

Source:apiDocs/note-relation.md
MethodPathDescription
POST/rest/noteTargetsCreate a note relation
GET/rest/noteTargets/{id}Get a note relation by ID
GET/rest/noteTargetsList note relations
PATCH/rest/noteTargets/{id}Update a note relation
DELETE/rest/noteTargets/{id}Delete a note relation
POST/rest/noteTargets

Link a note to a person, company, or opportunity. Provide noteId plus at least one target ID. To link to multiple records, create separate relations.

Body

noteIdrequiredUUID

The note to link

personIdUUID

Person to link the note to

companyIdUUID

Company to link the note to

opportunityIdUUID

Opportunity to link the note to

Requestcurl
# Link a note to a person
curl -X POST "https://app.usedalil.ai/rest/noteTargets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "noteId": "note-uuid-here",
    "personId": "person-uuid-here"
  }'

# Link the same note to their company (separate relation)
curl -X POST "https://app.usedalil.ai/rest/noteTargets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "noteId": "note-uuid-here",
    "companyId": "company-uuid-here"
  }'
GET/rest/noteTargets/{id}

Get a single note relation. Default depth is 1 (unlike most entities), so the linked note and target record are included automatically.

Parameters

idrequiredUUID

Note relation ID

depthnumber

Default is 1 — includes linked note and target

Requestcurl
curl -G "https://app.usedalil.ai/rest/noteTargets/uuid-here" \
  -H "Authorization: Bearer YOUR_API_KEY"
GET/rest/noteTargets

List note relations. Supports filter, order_by, and pagination. Default depth is 1.

Parameters

limitnumber

Records per page (default 60)

starting_afterUUID

Pagination cursor

filterstring

Filter expression — URL-encode

order_bystring

Sort field and direction

depthnumber

Default is 1

Requestcurl
# All notes linked to a person
curl -G "https://app.usedalil.ai/rest/noteTargets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "filter=personId[eq]:person-uuid" \
  --data-urlencode "depth=1"

# All notes linked to a company
curl -G "https://app.usedalil.ai/rest/noteTargets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "filter=companyId[eq]:company-uuid" \
  --data-urlencode "depth=1"
PATCH/rest/noteTargets/{id}

Change which note or target record a relation points to.

Parameters

idrequiredUUID

Note relation ID

Requestcurl
curl -X PATCH "https://app.usedalil.ai/rest/noteTargets/relation-uuid" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "personId": "different-person-uuid" }'
DELETE/rest/noteTargets/{id}

Remove the link between a note and a target record. The note itself is not deleted — only the relation.

Parameters

idrequiredUUID

Note relation ID

Requestcurl
curl -X DELETE "https://app.usedalil.ai/rest/noteTargets/relation-uuid" \
  -H "Authorization: Bearer YOUR_API_KEY"

Filter Examples

filter=noteId[eq]:note-uuid
filter=personId[eq]:person-uuid
filter=companyId[eq]:company-uuid
filter=opportunityId[eq]:opportunity-uuid
filter=personId[is]:NOT_NULL    # relations where a person is linked

Key Differences from Note Relations

  • Default depth=1 (most entities default to 0)
  • One target per relation record — create multiple relations to link to multiple records
  • Deleting a relation does not delete the note
  • No search operation — use the list endpoint with filters