engagementCreate mutation. This allows you to submit
a new real estate legal file to Ownright for either a purchase or refinance transaction.
Understanding @oneOf
The EngagementCreateInput uses the @oneOf directive, which means you must provide
exactly one of the type-specific inputs:
purchase— for a purchase engagementrefinance— for a refinance engagement
Steps to create an engagement
Choose the engagement type
Decide whether you’re creating a purchase or refinance engagement. This
determines which input field you’ll use:
Both input types share the same set of fields:
| Engagement type | Input field | Input type |
|---|---|---|
| Purchase | purchase | PurchaseEngagementCreateInput |
| Refinance | refinance | RefinanceEngagementCreateInput |
clients, closingDate, owner,
newMortgageFileIds, newMortgageNumber, notes, and propertyAddress.Gather the required information
Before constructing the mutation, make sure you have:
- Owner — A
TeamMemberGIDfor the team member who will own this engagement. See Lender and team members for how to fetch these. - At least one client — Each client needs a
firstName,lastName, andemail. Phone number and middle name are optional. - Closing date — The expected closing date in ISO 8601 format (e.g.,
2025-09-15). - Mortgage files (if any) — Upload documents first using the
staged file upload flow, then pass the
resulting
FileRecordGIDvalues.
Construct and send the mutation
Here’s a complete example for creating a purchase engagement:Variables:
Request
Variables
To create a refinance engagement instead, use the
refinance key in the input
with a RefinanceEngagementCreateInput. The fields are identical.Error codes
TheengagementCreate mutation can return the following error codes:
| Code | Description |
|---|---|
INVALID_ENGAGEMENT_INPUT | The engagement input is invalid (e.g., missing required fields) |
TEAM_MEMBER_NOT_FOUND | The specified TeamMemberGID doesn’t exist in your organization |
FILE_RECORD_NOT_FOUND | A FileRecordGID in newMortgageFileIds could not be found |
FILE_RECORD_NOT_STAGED | A file record hasn’t been uploaded yet via the staged upload URL |
Tips
- Always fetch your team members first so you have valid
TeamMemberGIDvalues to assign as owners. - If you need to attach mortgage documents, complete the
file upload flow before calling
engagementCreate. - The
newMortgageFileIdsarray can be empty if you don’t have documents to attach at creation time. - New engagements always start in the Received state.