Topolo Docs Topolo Platform
Open workspace

Unsubscribe contact from topic

Unsubscribe a contact from one topic (active or archived) by appending a topic-scoped unsubscribed event to the suppression ledger, the single source of unsubscribes. Marketing for that topic is blocked until the contact re-subscribes with double opt-in or a consent decision.

Outcome

Unsubscribe a contact from one topic (active or archived) by appending a topic-scoped unsubscribed event to the suppression ledger, the single source of unsubscribes. Marketing for that topic is blocked until the contact re-subscribes with double opt-in or a consent decision.

Before you start

  • Verify identity and pin the intended organization and environment before discovering the action.
  • Discover a granted Nurture workspace. The application permission is workspace:write; required workspace access is read_write. A permission alone does not supply a workspace grant.
  • Organization and workspace come from verified context. Select resourceType/resourceId separately from action input; body fields cannot grant a different organization or workspace. The first authorized product action can initialize an identity-only workspace mirror.
  • Obtain authorization for the documented effect or personal-data export before supplying CLI --confirm or MCP confirm:true.

Discover the target

topolo whoami --json
topolo actions get app_topolo_nurture.subscriptions.unsubscribe --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json
topolo actions get app_topolo_nurture.contacts.list --detail --json
  • id: Nurture contact id in the selected workspace.

Request

POST /api/contacts/{id}/subscriptions/{topicKey}/unsubscribe

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and HTTP body. Set NURTURE_WORKSPACE_ID from granted resource discovery; it is separate from action input.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

FieldRequiredTypeConstraints
idRequiredstringNurture contact id in the selected workspace. {"minLength":1,"maxLength":64}
topicKeyRequiredstring{"pattern":"^[a-z0-9][a-z0-9_-]{0,62}$"}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "topicKey": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
    }
  },
  "required": [
    "id",
    "topicKey"
  ],
  "additionalProperties": false
}

Effects

  • Appends one unsubscribed ledger event with the topic key; eligibility.check then reports unsubscribed_topic for that topic.

Interpret the response

The returned identifier path is $.subscription.topicKey for contact_subscription. Empty lists do not discover a target.

Call app_topolo_nurture.subscriptions.list and confirm state unsubscribed.

Exact success schema:

{
  "type": "object",
  "required": [
    "subscription"
  ],
  "properties": {
    "subscription": {
      "type": "object",
      "required": [
        "topicKey",
        "state"
      ],
      "properties": {
        "topicKey": {
          "type": "string"
        },
        "topicId": {
          "type": "string"
        },
        "topicName": {
          "type": "string"
        },
        "doubleOptIn": {
          "type": "boolean"
        },
        "state": {
          "type": "string",
          "enum": [
            "none",
            "pending_confirmation",
            "subscribed",
            "unsubscribed"
          ]
        },
        "since": {
          "type": [
            "string",
            "null"
          ]
        },
        "evidence": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object"
          }
        }
      }
    }
  }
}

Worked examples

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Replace synthetic identifiers using credential-scoped discovery. A local success is not evidence of a deployed effect, configured provider or delivered message.

Successful request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "nct_5343bec9ee3743269b15515100f009ff",
  "topicKey": "news"
}

CLI:

topolo actions validate app_topolo_nurture.subscriptions.unsubscribe --data @payload.json --json
topolo actions plan app_topolo_nurture.subscriptions.unsubscribe --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.subscriptions.unsubscribe --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_nurture.subscriptions.unsubscribe",
    "input": {
      "id": "nct_5343bec9ee3743269b15515100f009ff",
      "topicKey": "news"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "subscription": {
    "topicKey": "news",
    "topicId": "topic_921562fd62f9455d8413b97c201b3367",
    "topicName": "News",
    "doubleOptIn": true,
    "state": "unsubscribed",
    "since": "2026-10-01T00:24:00.000Z",
    "evidence": null
  }
}

HTTP 200. Call app_topolo_nurture.subscriptions.list and confirm state unsubscribed.

Another supported request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "nct_f4095688094d4d2dbdfe8c7286d89d25",
  "topicKey": "news"
}

CLI:

topolo actions validate app_topolo_nurture.subscriptions.unsubscribe --data @payload.json --json
topolo actions plan app_topolo_nurture.subscriptions.unsubscribe --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.subscriptions.unsubscribe --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_nurture.subscriptions.unsubscribe",
    "input": {
      "id": "nct_f4095688094d4d2dbdfe8c7286d89d25",
      "topicKey": "news"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "subscription": {
    "topicKey": "news",
    "topicId": "topic_7feb1bf0f64f4a0497785ee3dcb4fbea",
    "topicName": "News",
    "doubleOptIn": true,
    "state": "unsubscribed",
    "since": "2026-10-01T00:24:00.000Z",
    "evidence": null
  }
}

HTTP 200. Call app_topolo_nurture.subscriptions.list and confirm state unsubscribed.

Refused request · not_found

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "nct_4945f75a6f054baa89c0d210c36204ed",
  "topicKey": "news"
}

CLI:

topolo actions validate app_topolo_nurture.subscriptions.unsubscribe --data @payload.json --json
topolo actions plan app_topolo_nurture.subscriptions.unsubscribe --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 404:

{
  "error": {
    "code": "not_found",
    "message": "Contact was not found in this workspace."
  }
}

HTTP 404. Preserve the refusal details and do not claim success.

Refused request · topic_unavailable

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "nct_01718b3da2f74921904437dcf4f25938",
  "topicKey": "nope"
}

CLI:

topolo actions validate app_topolo_nurture.subscriptions.unsubscribe --data @payload.json --json
topolo actions plan app_topolo_nurture.subscriptions.unsubscribe --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 422:

{
  "error": {
    "code": "topic_unavailable",
    "message": "Name an active subscription topic of this workspace."
  }
}

HTTP 422. Preserve the refusal details and do not claim success.

Verify the result

  • Call app_topolo_nurture.subscriptions.list and confirm state unsubscribed.

Errors and recovery

  • organization_required (HTTP 403): Select an organization available to the verified caller before choosing a Nurture workspace.
  • permission_denied (HTTP 403): Grant the credential the required Nurture workspace permission.
  • workspace_required (HTTP 409): Create a Nurture workspace, or pass the workspace resource context.
  • invalid_input (HTTP 422): Correct the fields named in error.details using inputSchema, then retry.
  • not_found (HTTP 404): List contacts to find a valid id in this workspace.
  • topic_unavailable (HTTP 422): Call app_topolo_nurture.subscription_topics.list and use the key of an existing topic.

Auth or gateway failures may precede this handler. Preserve the exact response shape, error string/code, request id and credential context; no synthetic fixture establishes live credential access.

Recovery boundary

An unsubscribe is only lifted by the contact: request double opt-in, or subscribe with a genuine consent_decision.

  • List contact subscriptions: Read a contact's subscription state for every active topic of the workspace: none, pending_confirmation, subscribed or unsubscribed, with since and the evidence that subscribed them. State is resolved by @topolo-io/audience from Nurture's own subscription stream and suppression ledger; an unsubscribe is always a ledger event.
  • Request double opt-in confirmation: Start double opt-in for a contact and an active topic: records subscribe_requested (state pending_confirmation) and returns confirmationUrl, a signed single-use link valid for 7 days (only its hash is stored). Opening the link (GET) only shows a page with a Confirm subscription button and never changes state, so email link scanners cannot confirm; the button POSTs the token, which confirms the subscription with double_opt_in evidence. With a verified sender (sending_settings) Nurture emails the link through Nexus (transactional, service_notice) and reports it in email; without one email.status is not_configured: deliver confirmationUrl yourself. Never confirm on the contact's behalf.

Evidence

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Test scenario and capture digests are retained with each fixture.