This document describes the new Slack commands for managing entitlements in the SpaceCat API Service.
Six new commands have been added to manage entitlements for sites and organizations:
Command: ensure entitlement site <siteURL>
Description: Creates entitlement and enrollment for a site by URL.
Behavior:
- Validates the site URL
- Checks if the site exists in the database
- Shows a button to select products (ASO, ACO and/or LLMO)
- Opens a modal for product selection
- Creates entitlements and enrollments for selected products
Example:
@spacecat ensure entitlement site https://example.com
Command: ensure entitlement imsorg <imsOrgId>
Description: Creates entitlement for an organization by IMS Org ID.
Behavior:
- Validates the IMS Org ID
- Checks if the organization exists in the database
- Shows a button to select products (ASO, ACO and/or LLMO)
- Opens a modal for product selection
- Creates entitlements for selected products (no site enrollments for org-level)
Example:
@spacecat ensure entitlement imsorg 12345@AdobeOrg
Command: get entitlement site <siteURL>
Description: Retrieves entitlement and enrollment information for a site.
Behavior:
- Validates the site URL
- Checks if the site exists in the database
- Queries entitlements for ASO, ACO and LLMO products
- Displays entitlement details including:
- Product code
- Entitlement ID
- Tier (e.g., FREE_TRIAL)
- Enrollment ID (if applicable)
Example:
@spacecat get entitlement site https://example.com
Command: get entitlement imsorg <imsOrgId>
Description: Retrieves entitlement information for an organization by IMS Org ID.
Behavior:
- Validates the IMS Org ID
- Checks if the organization exists in the database
- Queries entitlements for ASO, ACO and LLMO products
- Displays entitlement details including:
- Product code
- Entitlement ID
- Tier
- Number of active site enrollments
Example:
@spacecat get entitlement imsorg 12345@AdobeOrg
Command: revoke entitlement site <siteURL>
Description: Revokes enrollment for a site by URL.
Behavior:
- Validates the site URL
- Checks if the site exists in the database
- Shows a button to select products to revoke
- Opens a modal for product selection
- Revokes site enrollments for selected products (does not delete the org-level entitlement)
Example:
@spacecat revoke entitlement site https://example.com
Command: revoke entitlement imsorg <imsOrgId>
Description: Revokes entitlement for an organization by IMS Org ID.
Behavior:
- Validates the IMS Org ID
- Checks if the organization exists in the database
- Shows a button to select products to revoke
- Opens a modal for product selection
- For each selected product:
- Finds all site enrollments for the entitlement
- Removes all site enrollments
- Deletes the entitlement
Example:
@spacecat revoke entitlement imsorg 12345@AdobeOrg
-
Commands:
src/support/slack/commands/ensure-entitlement-site.jssrc/support/slack/commands/ensure-entitlement-imsorg.jssrc/support/slack/commands/get-entitlement-site.jssrc/support/slack/commands/get-entitlement-imsorg.jssrc/support/slack/commands/revoke-entitlement-site.jssrc/support/slack/commands/revoke-entitlement-imsorg.js
-
Actions (Modal Handlers):
src/support/slack/actions/entitlement-modals.js
-
Modified Files:
src/support/slack/commands.js- Registered new commandssrc/support/slack/actions/index.js- Registered new actions
- Validation: All commands validate URLs and IMS Org IDs before processing
- Error Handling: Proper error messages for site/org not found
- Modal-based Product Selection: Reuses existing
entitlement-modal-utils.jsfor consistent UI - TierClient Integration: Uses
@adobe/spacecat-shared-tier-clientfor all entitlement operations - Product Support: Supports ASO, ACO and LLMO product codes
- Interactive UI: Uses Slack buttons and modals for better user experience
The commands follow the existing Slack command pattern:
- Command receives app mention → Validates input → Shows button
- User clicks button → Opens modal with product selection
- User submits modal → Performs entitlement operation → Posts results
This architecture ensures:
- Proper trigger_id handling (required for Slack modals)
- Non-blocking user experience
- Clear feedback at each step
All commands handle the following scenarios:
- Invalid or missing parameters
- Site/Organization not found
- Failed entitlement operations
- Network/API errors
Error messages are posted back to the Slack thread with appropriate emoji indicators (:x: for errors, :warning: for warnings).
- Sites and organizations must exist in the database before entitlements can be managed
- The commands do NOT create new sites or organizations
- Revoking a site enrollment does not delete the organization-level entitlement
- Revoking an organization entitlement removes ALL associated site enrollments
- The default tier for new entitlements is
FREE_TRIAL