Topolo Docs Topolo Platform
Open workspace

Check send eligibility

Decide, without reserving anything, whether a message may be sent now to up to 100 contacts. Rules come from @topolo-io/audience over Nurture's own data: suppression blocks (hard bounce, complaint, wrong person, erased address, manual block, unsubscribes), topic subscription state when purpose is marketing with a topicKey, and the workspace pacing policy (rolling 24h and 7d caps counting reserved and consumed sends, quiet hours in the recipient's timezone). Transactional messages need messageCategory and skip subscription, caps and quiet hours but still honour hard_bounce, wrong_person, erased and manual_block. A missing or archived contact is ineligible with no_contact_point. nextEligibleAt is present only when every reason clears with time.

Outcome

Decide, without reserving anything, whether a message may be sent now to up to 100 contacts. Rules come from @topolo-io/audience over Nurture's own data: suppression blocks (hard bounce, complaint, wrong person, erased address, manual block, unsubscribes), topic subscription state when purpose is marketing with a topicKey, and the workspace pacing policy (rolling 24h and 7d caps counting reserved and consumed sends, quiet hours in the recipient's timezone). Transactional messages need messageCategory and skip subscription, caps and quiet hours but still honour hard_bounce, wrong_person, erased and manual_block. A missing or archived contact is ineligible with no_contact_point. nextEligibleAt is present only when every reason clears with time.

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:read; required workspace access is read. 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.

Discover the target

topolo whoami --json
topolo actions get app_topolo_nurture.eligibility.check --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json

Request

POST /api/eligibility/check

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
purposeRequiredstring{"enum":["marketing","outreach","transactional"]}
messageCategoryOptionalstring{"enum":["receipt","password_reset","account_security","billing","order_update","service_notice"]}
channelRequiredstring{"const":"email"}
topicKeyOptionalstring{"pattern":"^[a-z0-9][a-z0-9_-]{0,62}$"}
recipientsRequiredarray{"minItems":1,"maxItems":100}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "purpose": {
      "type": "string",
      "enum": [
        "marketing",
        "outreach",
        "transactional"
      ]
    },
    "messageCategory": {
      "type": "string",
      "enum": [
        "receipt",
        "password_reset",
        "account_security",
        "billing",
        "order_update",
        "service_notice"
      ]
    },
    "channel": {
      "type": "string",
      "const": "email"
    },
    "topicKey": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
    },
    "recipients": {
      "minItems": 1,
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": [
          "contactId"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "purpose",
    "channel",
    "recipients"
  ],
  "additionalProperties": false
}

Effects

  • Reads ledger, subscriptions, reservations and policy without changing state.

Interpret the response

The returned identifier path is $.results[].contactId for eligibility_decision. Empty lists do not discover a target.

Treat only eligible: true as permission to send, and reserve before sending.

Exact success schema:

{
  "type": "object",
  "required": [
    "results"
  ],
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "contactId",
          "eligible",
          "reasons"
        ],
        "properties": {
          "contactId": {
            "type": "string"
          },
          "contactStatus": {
            "type": "string",
            "enum": [
              "active",
              "archived",
              "missing"
            ]
          },
          "eligible": {
            "type": "boolean"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "@topolo-io/audience reason codes, e.g. unsubscribed_topic, not_subscribed, subscription_pending, contact_point_undeliverable, complaint, manual_block, erased, daily_cap_reached, weekly_cap_reached, quiet_hours, transactional_category_required."
          },
          "nextEligibleAt": {
            "type": "string"
          }
        }
      }
    }
  }
}

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:

{
  "purpose": "transactional",
  "messageCategory": "receipt",
  "channel": "email",
  "recipients": [
    {
      "contactId": "nct_204ccdfc09534af7bb7e9b383040a352"
    }
  ]
}

CLI:

topolo actions validate app_topolo_nurture.eligibility.check --data @payload.json --json
topolo actions plan app_topolo_nurture.eligibility.check --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.eligibility.check --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_nurture.eligibility.check",
    "input": {
      "purpose": "transactional",
      "messageCategory": "receipt",
      "channel": "email",
      "recipients": [
        {
          "contactId": "nct_204ccdfc09534af7bb7e9b383040a352"
        }
      ]
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "results": [
    {
      "contactId": "nct_204ccdfc09534af7bb7e9b383040a352",
      "contactStatus": "active",
      "eligible": false,
      "reasons": [
        "erased"
      ]
    }
  ]
}

HTTP 200. Treat only eligible: true as permission to send, and reserve before sending.

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:

{
  "purpose": "transactional",
  "channel": "email",
  "recipients": [
    {
      "contactId": "nct_305b2f74b044476fa9d0c063e35c3d2e"
    }
  ]
}

CLI:

topolo actions validate app_topolo_nurture.eligibility.check --data @payload.json --json
topolo actions plan app_topolo_nurture.eligibility.check --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.eligibility.check --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_nurture.eligibility.check",
    "input": {
      "purpose": "transactional",
      "channel": "email",
      "recipients": [
        {
          "contactId": "nct_305b2f74b044476fa9d0c063e35c3d2e"
        }
      ]
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "results": [
    {
      "contactId": "nct_305b2f74b044476fa9d0c063e35c3d2e",
      "contactStatus": "active",
      "eligible": false,
      "reasons": [
        "transactional_category_required"
      ]
    }
  ]
}

HTTP 200. Treat only eligible: true as permission to send, and reserve before sending.

Refused request · invalid_input

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:

{
  "purpose": "marketing",
  "channel": "email",
  "topicKey": "news",
  "recipients": []
}

CLI:

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

Captured local response · HTTP 422:

{
  "error": {
    "code": "invalid_input",
    "message": "The input does not match the action schema.",
    "details": [
      {
        "origin": "array",
        "code": "too_small",
        "minimum": 1,
        "inclusive": true,
        "path": [
          "recipients"
        ],
        "message": "Too small: expected array to have >=1 items"
      }
    ]
  }
}

HTTP 422. 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:

{
  "purpose": "marketing",
  "channel": "email",
  "topicKey": "nope",
  "recipients": [
    {
      "contactId": "nct_00f85d8a350a4119b7fa5e168a2fb02f"
    }
  ]
}

CLI:

topolo actions validate app_topolo_nurture.eligibility.check --data @payload.json --json
topolo actions plan app_topolo_nurture.eligibility.check --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

  • Treat only eligible: true as permission to send, and reserve before sending.

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.
  • topic_unavailable (HTTP 422): Call app_topolo_nurture.subscription_topics.list and use the key of an active topic, or omit topicKey.

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

This action does not change service state.

  • Reserve a send slot: Check eligibility for one contact and, when eligible, atomically reserve a send slot that counts toward the caps for 15 minutes (or until released). Idempotent by idempotencyKey: a repeat returns the same live reservation without re-counting caps, or granted false with reservation_expired once released or expired. Applies the same suppression, subscription and pacing rules as app_topolo_nurture.eligibility.check; transactional messages need messageCategory. For marketing and outreach a granted reservation includes listUnsubscribe: a signed one-click unsubscribe URL and POST body for the message body. Nexus owns the List-Unsubscribe headers; pass the preference centre to email.send as unsubscribe_landing_url. With an active suppression_sync connector, a connector-sourced contact is also reserved in that system (TopoloCRM eligibility.reserve) and the stricter answer wins: a remote refusal releases the Nurture reservation and returns its reasons. Sends nothing.

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.