{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-send-credentialing-outreach-request-schema.json",
  "title": "SendCredentialingOutreachRequest",
  "description": "Request body for sending a credentialing outreach email",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-credentialing-outreach-resource-api-openapi.yml#/components/schemas/SendCredentialingOutreachRequest",
  "type": "object",
  "required": [
    "toEmails",
    "body",
    "outreachReasons",
    "subject"
  ],
  "properties": {
    "workflowId": {
      "type": "string",
      "description": "The workflow ID for the credentialing outreach. Required for single-workflow requests. When workflowIds is provided with more than one entry, this field is optional."
    },
    "workflowIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List of workflow IDs for multi-tenant outreach. When more than one entry is provided, initiatingWorkflowId must also be set. Single-workflow requests should leave this null and use workflowId instead."
    },
    "initiatingWorkflowId": {
      "type": "string",
      "description": "The workflow ID of the initiating org for multi-tenant outreach. Required when workflowIds contains more than one entry. Must be present in the workflowIds list. The initiating workflow's tenant outreach-settings template is applied to all bundled workflows."
    },
    "toEmails": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      },
      "description": "List of email addresses to send the outreach email to"
    },
    "body": {
      "type": "string",
      "pattern": "\\S",
      "description": "Email body content"
    },
    "ccEmails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Optional list of CC email addresses"
    },
    "bccEmails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Optional list of BCC email addresses"
    },
    "outreachReasons": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      },
      "description": "List of reasons for the outreach"
    },
    "outreachReasonsWithLabels": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OutreachReasonWithLabel"
      },
      "description": "List of outreach reasons with their display labels. When provided, labels are persisted with the outreach record."
    },
    "subject": {
      "type": "string",
      "pattern": "\\S",
      "description": "Email subject line"
    },
    "attachments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AttachmentDTO"
      },
      "description": "Optional list of email attachments"
    },
    "multiTenant": {
      "type": "boolean"
    }
  },
  "$defs": {
    "AttachmentDTO": {
      "type": "object",
      "required": [
        "filename",
        "content",
        "contentType"
      ],
      "properties": {
        "filename": {
          "type": "string",
          "pattern": "\\S"
        },
        "content": {
          "type": "string",
          "format": "binary"
        },
        "contentType": {
          "type": "string",
          "pattern": "\\S"
        }
      }
    },
    "OutreachReasonWithLabel": {
      "type": "object",
      "description": "Outreach reason with ID and label",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the outreach reason"
        },
        "label": {
          "type": "string",
          "description": "Display label for the outreach reason"
        }
      }
    }
  }
}