links.10x.in/docs/end-user/playbooks/ops-lab-lifecycle-messaging-retargeting Published:

Ops Lab Playbook: Lifecycle Messaging + Retargeting

Last updated: 2026-03-08

1. Purpose and when to use this

Use this module to run chain signal/decision workflows and validate webhook delivery for lifecycle messaging.

2. User roles and auth modes

  • NONE: chain signal, resolve, and prefetch endpoints.
  • [Operator] JWT: webhook create/test actions.
  • [Platform Admin] allowlist operations moved to Playbooks escalation boundaries.

3. Prerequisites checklist

4. UI onboarding flow

  1. Open https://app.10x.in/apps/lifecycle-messaging.
  2. Append sample chain signals for a session.
  3. Resolve and prefetch decisions for one or more triggers.
  4. Create webhook subscription and run test delivery.

5. API workflow map

  1. LM-01: POST /v2/public/chain/signals (public)
  2. LM-02: POST /v2/public/chain/resolve (public)
  3. LM-03: POST /v2/public/chain/prefetch (public)
  4. LM-04: role-negative check for webhook mutation
  5. LM-05: POST /v2/handles/{handle}/webhooks (JWT operator)
  6. LM-06: POST /v2/handles/{handle}/webhooks/{subscriptionId}/test (JWT operator)

6. cURL examples

Set module variables:

export SESSION_ID="sess-1"
export SUBSCRIPTION_ID=""

LM-01 Append chain signals

curl -sS -X POST "${API_BASE}/v2/public/chain/signals" \
  -H 'content-type: application/json' \
  -d '{"handle":"'"${HANDLE}"'","sessionId":"'"${SESSION_ID}"'","signals":[{"type":"view"}]}'

LM-02 Resolve chain decision

curl -sS -X POST "${API_BASE}/v2/public/chain/resolve" \
  -H 'content-type: application/json' \
  -d '{"handle":"'"${HANDLE}"'","sessionId":"'"${SESSION_ID}"'","trigger":"checkout"}'

LM-05 Create webhook subscription

curl -sS -X POST "${API_BASE}/v2/handles/${HANDLE}/webhooks" \
  -H "authorization: Bearer ${JWT_TOKEN}" \
  -H 'content-type: application/json' \
  -d '{"endpointUrl":"https://hooks.example.com/test","eventTypes":["link.clicked"]}'

LM-06 Test webhook delivery

curl -sS -X POST "${API_BASE}/v2/handles/${HANDLE}/webhooks/${SUBSCRIPTION_ID}/test" \
  -H "authorization: Bearer ${JWT_TOKEN}" \
  -H 'content-type: application/json' \
  -d '{}'

7. Expected success outputs and verification checks

  • Chain append returns accepted metadata (202).
  • Resolve/prefetch returns decision envelopes (200).
  • Webhook create returns 201 with subscriptionId.
  • Webhook test returns 202 and dispatch event reference.

8. Failure modes and remediation

  • 403 insufficient_role on webhook create:
  • Remediation: use operator-level JWT for webhook mutations.
  • 400 on chain requests:
  • Remediation: verify required fields (handle, sessionId, trigger/signals).
  • Webhook test accepted but no receiver event:
  • Remediation: validate endpoint reachability and inspect delivery logs/retries.

9. Async behavior notes

  • Chain signal writes can enqueue asynchronous processing work.
  • Webhook test dispatches asynchronously via background processing.

10. Related links