> ## Documentation Index
> Fetch the complete documentation index at: https://docs.visitoai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync a contact’s AI note from your CRM

> Send changing customer preferences from an external CRM to Visito through the API or MCP.

When a customer changes their breakfast preference in your CRM, have your integration update their AI note in Visito. The agent can use the new preference the next time it prepares a text reply for that contact. This keeps customer-specific knowledge current without reimporting your knowledge base.

Grant **Contact notes** read and write access to the API key or MCP connection. Read access covers phone lookup and notes created by that credential. Write access lets it create, edit and delete its own AI notes. Internal notes are private to the team.

## 1. Find the contact

Set `VISITO_API_KEY` to your M2M key. Look up the full international number.

```bash theme={null}
API=https://platform-api.visitoai.com/m2m/v1
curl -sS "$API/contacts/lookup" \
  -H "Authorization: Bearer $VISITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"phone":"+14155550102"}'
```

For `matchStatus: single`, set `CONTACT_ID` to the returned `matches[0].contactId`. For `multiple`, pick the correct business and channel before writing. For `none`, stop. Lookup searches existing contacts and leaves them unchanged.

## 2. Create the note once

```bash theme={null}
curl -sS "$API/contacts/$CONTACT_ID/notes" \
  -H "Authorization: Bearer $VISITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"type":"ai_context","text":"Prefers a vegan breakfast.","externalRef":"crm-482-breakfast"}'
```

Save the returned `note.noteId` as `NOTE_ID` and keep `note.revision`. Use a stable `externalRef` for this CRM record. Retrying the same create with the same credential and payload returns the existing note. The dashboard shows who wrote it.

![The dashboard shows an AI note from Guest CRM alongside the team’s internal reminder](https://mintcdn.com/muhammadtest/zAaNREoFCqRHYlzn/images/product-guide/en/contact-notes/details.png?fit=max\&auto=format\&n=zAaNREoFCqRHYlzn\&q=85\&s=c8760875a90718f49b1a4838aa26f19e)

## 3. Update it when the CRM record changes

Use the current revision. This example updates a newly created note at revision 1.

```bash theme={null}
curl -sS -X PATCH "$API/contacts/$CONTACT_ID/notes/$NOTE_ID" \
  -H "Authorization: Bearer $VISITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"text":"Prefers the garden omelet.","revision":1}'
```

Each contact has one AI note shared by the dashboard and integrations, up to 5,000 characters. On a revision conflict (`409`), list your notes and reconcile the latest edit. If another author owns the occupied slot, ask the team to review it. Deleting requires the current revision. A deleted external reference returns `410` if creation is retried.

## API and MCP operations

Paths are relative to `/m2m/v1`. Read uses `contacts:notes:read`. Write uses `contacts:notes:write`.

| Access | HTTP | MCP tool |
| - | - | - |
| Read | `POST /contacts/lookup` | `lookup_conversation_contact` |
| Read | `GET /contacts/{contactId}/notes` | `list_contact_notes` |
| Write | `POST /contacts/{contactId}/notes` | `create_contact_note` |
| Write | `PATCH /contacts/{contactId}/notes/{noteId}` | `update_contact_note` |
| Write | `DELETE /contacts/{contactId}/notes/{noteId}?revision={revision}` | `delete_contact_note` |

For MCP, pass path and query values as named arguments and the JSON body under `input`. For example, call `lookup_conversation_contact` with `{"input":{"phone":"+14155550102"}}`.

[Try the guest experience in Webchat](https://docs.visitoai.com/product-guides/product/contact-notes.md#try-it-in-webchat)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.