From Territory Management: running territory assignment rules on Account edit:
As of version 21 of the Force.com Apex Code Developer's Guide, there is not a way to run territory assignment rules through Apex: "assignmentRuleHeader method - The database.DMLOptions object supports assignment rules for cases and leads, but not for accounts or territory management."
The only option as of API version 21 is to use the Web Services API. See AssignmentRuleHeader in the Web Services API Developer Guide for more information:
"AssignmentRuleHeader – useDefaultRule - If true for a Case or Lead, uses the default (active) assignment rule for a Case or Lead. If specified, do not specify an assignmentRuleId. If true for an Account, all territory assignment rules are applied, and if false, no territory assignment rules are applied."
A description of the API.
Heres the relevant trailhead.
Looks like both the SOAP API and the REST API expose the field you need.