service-email-to-case-configure
Configure Email-to-Case (Metadata API)
Configure Salesforce Email-to-Case entirely through the Metadata API (no Setup UI), for headless org configuration. The skill builds a CaseSettings source file for the desired emailToCase state, then applies it with scripts/apply-casesettings.py, which runs updateMetadata in two phases — the full emailToCase block + Support Settings (Phase A), then routing addresses (Phase B) — and verifies by re-reading. Two phases because a single deploy fails on a fresh org: On-Demand must be live before an address binds (see Rules / Constraints).
Scope
- In scope: Enabling Email-to-Case org-wide and setting its toggles (full field lists in Required Inputs and step 4); creating
EmailToCase,Outlook, andGmailOAuthrouting addresses; applying the change to an sf-CLI-authenticated org viaapply-casesettings.py; verifying by re-reading. - Out of scope:
E2cEasyrouting addresses — created only through the Service Easy Setup wizard, not the Metadata API; route the user there.- Authenticating the org — the user authenticates out-of-band (e.g.
sf org login web); the script reuses that session and never handles passwords or tokens. - Case object schema, layouts, assignment rules, or Web-to-Case.
Attaching an Agentforce service agent (delegation)
When the user wants an Agentforce Service Agent to answer these emails, configure the Email-to-Case base (the Workflow below), then delegate — this skill never creates or modifies agents.
Gate on org capability first. Attaching an agent needs the org entitled for Agentforce Email-to-Case; that entitlement surfaces as the BotEmailDefinition metadata type, so probe read-only before delegating: