This can be done via the Automated Workflow Integrator (AWI) rather than through the API. AWI can generate an XML, that Switch can be configured to read.
You need AWI set up in your account. It is included with Enterprise packages but still needs to be set up. You can also add AWI to other packages. Start a support ticket if you want more details.