service-de-channel-activate
Installation
SKILL.md
Activating a Messaging Channel
What this skill does
Given a {CHANNEL_ID}, reads the channel's MessagingChannelUsage.Id, then fires PATCH /services/data/v{V}/sobjects/MessagingChannelUsage/{MCU_ID} with body {"DeploymentStatus":"Provisioning"}. The server-side chain:
MessagingChannelUsageFunctions.validateBeforeSaverunsvalidateDeploymentStatus→validateChannelReadinessOnProvisioning. For WhatsApp this confirms consent is configured. Rejected writes return HTTP 400FIELD_INTEGRITY_EXCEPTION.MessagingChannelUsageFunctions.saveHook_PostStmtExecuteOncefires unconditionally after the UPDATE statement. It callsMessagingChannelUsageFunctionsHelper.handlePostSavewhich registers a post-commitTransactionObserver.- At commit, the observer calls
ConversationChannelUsageDeploymentStatusService.handleProvisioning(inherited fromAbstractChannelUsageDeploymentStatusService), which:- Calls
runProvisioning—switch-dispatches byMessageTypefor the external callout:WHATS_APP→registerCsotWhatsAppNumber→LiveMessageSetupApi.registerWhatsAppNumber→ Meta/register+ status verification. 15-21s wall-clock.FACEBOOK→metaGraphApiService.subscribeFacebookPage.TEXT→registerCsotSms.AppleBusinessChat,Line, everything else →defaultbranch, no external callout, no network wait.
- On success: writes
DeploymentStatus = 'Active'via PLSQL. - On failure: writes
DeploymentStatus = 'Error'plusErrorReason/ErrorDetails.
- Calls
- Inside the same observer, a second pass syncs
MessagingChannel.IsActive = trueonce MCU reachesActive(theisTransitioningStatusflag skips the flip while status is stillProvisioning).
All synchronous within the PATCH request — the 204 response only comes back after the full chain completes. WhatsApp: ~15-21s (Meta /register round-trip). Apple / Line: ~1s (no external call; just the local save-hook + observer + PLSQL write). Verified on wadtesting 2026-04-30.