Create Note

Creates a new note associated with an existing lead in Sodtrack.

POST/api/integration/lead/note

Request

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

NameTypeDescription
originstring

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

FieldTypeRequiredDescription
leadobjectLead identifier object. Supports lookup by lead ID or lead reference.
notestringNote text to create on the lead.
issuerobjectIssuer payload. email is used to resolve an existing user if possible.
isShareablebooleanVisibility flag for the note. Defaults to true when omitted.
referencestringOptional external reference for the note (e.g. from an external system).

🎯 Lead Identifier

FieldTypeRequiredDescription
lead.typestringType of lead identifier. Must be one of: "leadId" or "leadReference".
lead.valuestringThe lead ID (if type = "leadId") or lead reference (if type = "leadReference").

👤 Issuer

FieldTypeRequiredDescription
issuer.namestringIssuer first name.
issuer.lastNamestringIssuer last name.
issuer.emailstringIssuer 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 OK

Error Responses

HTTP StatusErrorDescription
400 Bad RequestLEAD_NOT_FOUNDThe lead could not be found for the given leadId or leadReference.
400 Bad RequestInvalidParametersOne or more required fields are missing or invalid.
401 UnauthorizedAuthentication token missing or expired.
403 ForbiddenThe API key or origin is not authorized.
500 Internal Server ErrorUnexpected server error. Contact Sodtrack support.

Business Rules & Constraints

Lead resolution

  • The lead is resolved from the lead object:
    • type = "leadId": value must be a valid lead ID.
    • type = "leadReference": value must be a valid lead reference.
  • If the lead is not found, the endpoint returns LEAD_NOT_FOUND and 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).
  • 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}: ...).

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)

  • isShareable controls whether the note is shareable/visible according to your Sodtrack configuration.
  • When isShareable is omitted, it defaults to true.

Reference

  • reference is 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).