Create Note
Creates a new note associated with an existing lead in Sodtrack.
POST
/api/integration/lead/noteRequest
cURL
curl -X POST "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/lead/note" \
-H "Authorization: Bearer $SODTRACK_TOKEN" \
-H "origin: <your-origin>"Base URL: https://dev.integration.cl.sodtrack-shared.sodtrack.com · other environments
Headers
| Name | Type | Description |
|---|---|---|
origin | string | — |
Purpose
Creates a new note associated with an existing lead in Sodtrack.
The lead is identified in the request body by either lead ID or lead reference.
The note is created in the context of the issuer user when possible, and an optional reference can be used to correlate the note with an external system.
Field Definitions
🧾 Request Body
| Field | Type | Required | Description |
|---|---|---|---|
lead | object | ✅ | Lead identifier object. Supports lookup by lead ID or lead reference. |
note | string | ✅ | Note text to create on the lead. |
issuer | object | ✅ | Issuer payload. email is used to resolve an existing user if possible. |
isShareable | boolean | ❌ | Visibility flag for the note. Defaults to true when omitted. |
reference | string | ❌ | Optional external reference for the note (e.g. from an external system). |
🎯 Lead Identifier
| Field | Type | Required | Description |
|---|---|---|---|
lead.type | string | ✅ | Type of lead identifier. Must be one of: "leadId" or "leadReference". |
lead.value | string | ✅ | The lead ID (if type = "leadId") or lead reference (if type = "leadReference"). |
👤 Issuer
| Field | Type | Required | Description |
|---|---|---|---|
issuer.name | string | ✅ | Issuer first name. |
issuer.lastName | string | ✅ | Issuer last name. |
issuer.email | string | ✅ | Issuer email used to search an existing Sodtrack user. |
Example Request (issuer user found)
json
{
"lead": {
"type": "leadReference",
"value": "LEAD-EXT-342"
},
"note": "Customer requested a callback in the afternoon.",
"issuer": {
"name": "Maria",
"lastName": "Fernandez",
"email": "maria.fernandez@example.com"
},
"isShareable": true,
"reference": "NOTE-EXT-001"
}Example Request (minimal)
json
{
"lead": {
"type": "leadId",
"value": "5678"
},
"note": "Follow-up call completed.",
"issuer": {
"name": "Support",
"lastName": "Team",
"email": "support@example.com"
}
}Response Example
http
HTTP/1.1 200 OKError Responses
| HTTP Status | Error | Description |
|---|---|---|
400 Bad Request | LEAD_NOT_FOUND | The lead could not be found for the given leadId or leadReference. |
400 Bad Request | InvalidParameters | One or more required fields are missing or invalid. |
401 Unauthorized | — | Authentication token missing or expired. |
403 Forbidden | — | The API key or origin is not authorized. |
500 Internal Server Error | — | Unexpected server error. Contact Sodtrack support. |
Business Rules & Constraints
Lead resolution
- The lead is resolved from the
leadobject:type = "leadId":valuemust be a valid lead ID.type = "leadReference":valuemust be a valid lead reference.
- If the lead is not found, the endpoint returns
LEAD_NOT_FOUNDand no note is created.
Issuer resolution
The issuer is resolved using issuer.email:
- If a user with that email exists in Sodtrack:
- The note is linked to that user (
note.user_id = user.id). - The note text is augmented with contextual information (e.g.
Created via API).
- The note is linked to that user (
- If no user is found for
issuer.email:- The note is created without a linked user (
note.user_id = null). - The issuer full name (
name+lastName) is embedded in the note text (e.g.Note by {name} {lastName}: ...).
- The note is created without a linked user (
name and lastName should still be provided even when the issuer might not exist in Sodtrack, so the platform can record who authored the note from the external system.
Visibility (isShareable)
isShareablecontrols whether the note is shareable/visible according to your Sodtrack configuration.- When
isShareableis omitted, it defaults to true.
Reference
referenceis optional and stored as-is to help correlate notes with external or upstream systems (e.g. ticket IDs, case IDs).- Sodtrack does not enforce uniqueness or any specific format for
reference. - You can use this field for idempotency or traceability on your side.
Data and format
- All timestamps in responses (when present) follow the ISO 8601 format (UTC).