Create Policy

createPolicy(
		companyId: ID, externalCompanyId: ID, name: String!, pdfFile: String!, category: PolicyCategory,
	  action: PolicyCreateAction!, majorVersion: Int, minorVersion: Int, signatureSettings: PolicySignatureSettingsInput,
    ownerName: String, ownerEmail: String, public: Boolean
): Policy!

enum PolicyDocumentType {
    editor
    pdf
}

enum PolicySignatureSettingsIntervalUnit {
    months
    years
}

input PolicySignatureSettingsInput {
    type: PolicySignatureType
    startDate: Date
    intervalLength: Int
    intervalUnit: PolicySignatureSettingsIntervalUnit
    useDefault: Boolean
    setDefault: Boolean
}

enum PolicyCreateAction {
    saveDraft # Save the policy to draft
    publish # Publish the policy to live making it available for selection
}

Create Policy from a Policy Template

This mutation is similar to Create Policy but pdfFile is not available as the policy content will be pulled from the source template.

createPolicyFromTemplate(
    companyId: ID, externalCompanyId: ID, policyTemplateId: ID!, name: String, category: PolicyCategory,
    action: PolicyCreateAction!, majorVersion: Int, minorVersion: Int, signatureSettings: PolicySignatureSettingsInput,
    ownerName: String, ownerEmail: String, public: Boolean
): Policy!

Update Policy

If you wish to update a policy’s content, you will need to upload a new PDF file as per the instructions for creating a policy.

updatePolicy(
    companyId: ID, externalCompanyId: ID, id: ID!, name: String, pdfFile: String, category: PolicyCategory,
    action: PolicyUpdateAction!, signatureSettings: PolicySignatureSettingsInput, 
    major: Boolean, # If major is true publishing this policy will create a new major version e.g. go from v1.0 to v2.0
    ownerName: String, ownerEmail: String, public: Boolean,
		resend: Boolean # If resend is true publishing this policy will resend to any learner that has previously signed it
): Policy!

enum PolicyUpdateAction {
    # Saves your changes to new or existing draft version of this policy
		saveDraft
		# Updates the existing draft copy of this policy.
    # The mutation will fail if no draft copy exists
    updateDraft
		# Update the live policy without publishing a new version.
		# The mutation will fail if the policy is unpublished
    update
		# Publishes your updates as a new version of this policy
		# The mutation will fail if the policy is unpublished
    publish
		# Publishes the existing draft copy of this policy as a new version
    # The mutation will fail if no draft copy exists
    publishDraft
}

Publish Draft Policy

The major and resend variables on this mutation work the same way as those on updatePolicy

publishDraftPolicy(companyId: ID, externalCompanyId: ID, id: ID!, major: Boolean, resend: Boolean): Policy!

Discard Draft Policy

discardDraftPolicy(companyId: ID, externalCompanyId: ID, id: ID!): Policy!

Delete Policies

This mutation will only delete policies belonging to the target company specified by either companyId or externalCompanyId. Your account will be the target company if neither variable is supplied.

deletePolicies(companyId: ID, externalCompanyId: ID, policyIds: [ID!]!): Boolean!

Send Policies to Learners

This mutation will only send policies to learners where both records belong to the target company specified by either companyId or externalCompanyId. Your account will be the target company if neither variable is supplied.