DevelopersAPI referenceEngagement

Customer messaging API

REST endpoints for customer messaging in SKUFlow: 2 operations with parameters, request and response fields, permissions and curl examples.

Base URL: https://app.skuflow.ai/api. Every call needs Authorization: Bearer skf_… (Authentication); {organizationId} ($ORGANIZATION_ID in the examples) is your business's id.

OperationEndpointRisk
A customer's messaging consentGET /organizations/{organizationId}/customers/{customerId}/messagingread
Change a contact method's consentPATCH /organizations/{organizationId}/customers/{customerId}/messaging/consentsensitive

A customer's messaging consent

GET /organizations/{organizationId}/customers/{customerId}/messaging

For each contact method of the customer: OK to text, suppression (bounce, complaint, STOP), marketing and service-email choices with who made them, and whether an automation may send transactional and marketing messages there (with the reason when not). The message history is GET /messages?customerId=…. Read-only.

Permissionengagement.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolcustomerMessaging_get (toolset customers)

Parameters

NameInTypeRequiredDescription
customerIdpathstringYes

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/customers/{customerId}/messaging" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
preferencesobject
preferences.allowEmailboolean
preferences.allowSmsboolean
preferences.allowMarketingboolean
preferences.statusstring
preferences.doNotServiceboolean
methodsarray of object
methods[].contactIdstring
methods[].contactNamestring or null
methods[].isPrimaryContactboolean
methods[].rolesarray of string
methods[].contactMethodIdstring
methods[].channelenumOne of EMAIL, SMS.
methods[].labelstring
methods[].valuestring
methods[].smsConsentenum or nullOK to text (phones). One of UNKNOWN, GRANTED, DENIED.
methods[].suppressionenum or nullOne of BOUNCE, COMPLAINT, UNSUBSCRIBE, STOP, MANUAL.
methods[].marketingenum or nullOne of OPTED_IN, OPTED_OUT.
methods[].marketingSourcestring or null
methods[].transactionalenum or nullOne of OPTED_IN, OPTED_OUT.
methods[].transactionalSourcestring or null
methods[].canGrantSmsbooleanFalse after a STOP reply: only the customer can opt back in.
methods[].canOptInMarketingbooleanFalse after the person unsubscribed themselves.
methods[].transactionalAllowedboolean
methods[].transactionalReasonstring or null
methods[].marketingAllowedboolean
methods[].marketingReasonstring or null

Change a contact method's consent

PATCH /organizations/{organizationId}/customers/{customerId}/messaging/consent

Records the customer's consent as told to staff: OK to text (sms), marketing (marketing), service emails (transactionalEmail). Turning anything off is always allowed. Refused (409): switching texts on for a number that replied STOP (only the customer can, by texting START), and opting back into marketing or service emails an address that unsubscribed itself. Emits consent.changed.

Permissioncustomers.write (Owner, Admin, Staff)
Risksensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolcustomerMessaging_setConsent (toolset customers)
ApprovalOver MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals.

Parameters

NameInTypeRequiredDescription
customerIdpathstringYes

Request body

FieldTypeRequiredDescription
contactMethodIdstringYesFrom GET /customers/{customerId}/messaging.
smsbooleanNoOK to text (phones).
marketingbooleanNo
transactionalEmailbooleanNoService emails (reminders, invoices) to this address.

Example

curl -X PATCH "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/customers/{customerId}/messaging/consent" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contactMethodId":"contactMethod_id"}'

Response

200: the answer's fields
FieldTypeDescription
preferencesobject
preferences.allowEmailboolean
preferences.allowSmsboolean
preferences.allowMarketingboolean
preferences.statusstring
preferences.doNotServiceboolean
methodsarray of object
methods[].contactIdstring
methods[].contactNamestring or null
methods[].isPrimaryContactboolean
methods[].rolesarray of string
methods[].contactMethodIdstring
methods[].channelenumOne of EMAIL, SMS.
methods[].labelstring
methods[].valuestring
methods[].smsConsentenum or nullOK to text (phones). One of UNKNOWN, GRANTED, DENIED.
methods[].suppressionenum or nullOne of BOUNCE, COMPLAINT, UNSUBSCRIBE, STOP, MANUAL.
methods[].marketingenum or nullOne of OPTED_IN, OPTED_OUT.
methods[].marketingSourcestring or null
methods[].transactionalenum or nullOne of OPTED_IN, OPTED_OUT.
methods[].transactionalSourcestring or null
methods[].canGrantSmsbooleanFalse after a STOP reply: only the customer can opt back in.
methods[].canOptInMarketingbooleanFalse after the person unsubscribed themselves.
methods[].transactionalAllowedboolean
methods[].transactionalReasonstring or null
methods[].marketingAllowedboolean
methods[].marketingReasonstring or null

On this page