563848e0ecc0
Send a facility credentialing outreach email
Triggers a credentialing outreach email for a facility credentialing workflow by dispatching it through SendGrid and persisting a new outreach record. This operation is not idempotent - every call sends another email and creates another outreach record. Call it after the target facility credentialing workflow already exists. For a single-workflow outreach, supply workflowId. For a multi-tenant outreach that fans out to two or more recipient workflows, supply workflowIds (two or more entries) together with initiatingWorkflowId, which must be one of the entries in workflowIds; workflowId and workflowIds are mutually exclusive. Any file attachments must already be uploaded to Google Cloud Storage before calling this endpoint - the request only references them by metadata. For multi-workflow requests only, the initiating tenant (identified by the tenant-id header) must have a fully configured outreach-settings template (subject and body) for the relevant credentialing cycle, or the request is rejected with 422; single-workflow requests do not perform this template check. Multi-workflow requests also require the OUTREACH_MULTI_TENANT_ENABLED feature flag to be enabled, or they are rejected with 503; single-workflow requests are unaffected by this flag.
Headers
Tenant ID of the initiating organization. Scopes the outreach record and email dispatch to this tenant, and identifies whose outreach-settings template is applied to the send.
Request body
Example request
{
"workflowId": "workflow-123",
"workflowIds": [
"workflow-123",
"workflow-456"
],
"initiatingWorkflowId": "workflow-123",
"toEmails": [
"recipient@example.com"
],
"body": "Please complete your credentialing application.",
"ccEmails": [
"cc@example.com"
],
"bccEmails": [
"bcc@example.com"
],
"outreachReasons": [
"Missing documentation",
"Expired license"
],
"outreachReasonsWithLabels": [
{
"id": "reason-123",
"label": "Missing documentation"
}
],
"subject": "Action Required: Complete Your Credentialing"
}Response
The outreach email was sent and a new outreach record was created. A single-workflow request returns a bare JSON string containing the new outreach record ID. A multi-workflow request returns an object with outreachId (the single outreach record shared by all bundled workflows) and sends (one entry per workflow with workflowId, tenantId, emailId, status of SENT or FAILED, sendgridId, and errorMessage - the last three are null on whichever branch did not occur).