importContactNote
Create-or-get a historical note on a contact, attributed to a real member of the organization.
Create-or-get a historical note on a contact, attributed to a real member of the organization (authorUserId). Keyed on (sourceSystem, externalId): replays return the existing note. Honors historical createdAt so the note interleaves into the timeline at its true position; publishes no notifications. Optional metadata carries structured source-system provenance; the result echoes the STORED metadata, which a replay never overwrites.
curl https://server.goliathdata.com/api/v1/call \
-H "Authorization: Bearer $GOLIATH_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"operationId": "importContactNote",
"variables": {
"input": {
"contactId": "<contactId>",
"body": "<String>",
"authorUserId": "<authorUserId>",
"sourceSystem": "<String>",
"externalId": "<String>"
}
}
}'import { GoliathClient } from '@goliath-data/sdk'
const goliath = new GoliathClient({
apiKey: process.env.GOLIATH_API_KEY!,
baseUrl: 'https://server.goliathdata.com',
})
const result = await goliath.crmImport.importContactNote(
{
input: {
contactId: '<contactId>',
body: '<String>',
authorUserId: '<authorUserId>',
sourceSystem: '<String>',
externalId: '<String>'
}
},
{ idempotencyKey: crypto.randomUUID() },
)const res = await fetch('https://server.goliathdata.com/api/v1/call', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({
operationId: 'importContactNote',
variables: {
input: {
contactId: '<contactId>',
body: '<String>',
authorUserId: '<authorUserId>',
sourceSystem: '<String>',
externalId: '<String>'
}
}
}),
})
const { data, errors } = await res.json()Variables
The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.
The note text, at most 20,000 characters. Stored verbatim as a normal note body.
The organization member the note is attributed to. Must be an existing user of the importing organization: historical notes whose author is no longer a member should be attributed to whoever owns the migration, with the original author named in the body.
Short slug identifying the system this record came from. Lowercase letters, digits, and hyphens only, at most 32 characters. Part of the idempotency key.
The note's id in the source system. At most 256 characters. Part of the idempotency key: importing the same (sourceSystem, externalId) twice returns the existing note.
When the note was written in the source system. Must be in the past. The note interleaves into the contact timeline at this position. Omitted = now.
Internal notes are hidden from shared-contact viewers. Defaults to false.
Optional structured provenance from the source system (e.g. an Aircall call id), stored on the note as data instead of being folded into the body text. Must be a JSON object (not an array or scalar) nesting at most 2 levels deep, serializing to at most 4,096 bytes, with no control characters in keys or string values. Written once at creation: replaying the same (sourceSystem, externalId) returns the existing note with its ORIGINAL metadata: a replay never overwrites it.
Response
What comes back under data: a list shows as one entry, and a value as its type.
{
"data": {
"crmImportMutation": {
"importContactNote": {
"noteId": "<ID>",
"contactId": "<ID>",
"metadata": "…"
}
}
}
}Errors
unknown_variableA variable the operation does not declare. A typo is refused rather than silently dropped.
unauthorizedNo bearer header, or the key is invalid or revoked.
insufficient_scopeThe key lacks the scope the operation requires.
forbiddenA referenced record does not exist, was deleted, or is outside your organization. The gateway cannot tell those apart.
idempotency_conflictA request with this Idempotency-Key is still in flight.
Idempotency
Send an Idempotency-Key of 1 to 255 characters. A finished request retried with the same key replays its stored response, marked Idempotency-Replayed: true; one still in flight returns 409 idempotency_conflict. Keys expire after 24 hours. Write without fear →