Programmatic API for #1425