- Create interaction
Creating interactions tracks the history of communication between lenders/servicers and borrowers.
Note that this does NOT send a message—merely tracks that it occurred. If you need to send a message, use the /communicator/send endpoint.
The reason why an interaction occurred.
For example:
- An outbound debt collection call should be marked as
opsCollDebt. - An annual privacy policy update email should be marked as
opsServicing. - A customer service response to borrower's inquiry should be marked as
opsServicing.
DEPRECATED: inbBug, inbHumanLove, and opsServicingNegativeCreditReportNotice are deprecated: you cannot create or update interactions to have these values.
Start time of the interaction. If not provided we'll assume it's a timestamp of the API call. If time of day is not required provide only date.
For CRM-managed voice interactions, an inbound call is considered started when the CRM system answers the call, and an outbound call is considered started when the CRM system initiates the call.
The status of an interaction.
status is important, as it can impact future interactions. For instance, in jurisdictions which cap the number of outbound collection communications to a borrower, status=failed interactions do not count against the legal allotment.
Interaction status can be updated as the interaction status changes. For example, when an email is sent, set the status to attempted. If the email is opened, set the status to succeeded. If the email bounces, set the status to failed. attempted is assumed to be a successful interaction. Optionally, you can also use 'statusDetails' to provide additional details about status.
Some interactions—like an email—take place at a single point in time, others might be ongoing for many minutes—like a phone call.
Ongoing interactions like voice and chat may have their status set to inProgress.
Some interactions might be scheduled for the future. These interactions have a status of scheduled. If this scheduled interaction is unscheduled then it has a status of canceled.
Note that null is not a valid status name but rather can be used to specify a query for interactions with a status of null
Provides more details about the status of an interaction.
Note that statusDetails related to the "technical" status of an interaction: e.g., Did it connect? Did it fail to send? Was it blocked by Compliance Guard?
For the "human" outcome of an interaction see agentOutcome: e.g., Did you talk the person you intended to? Did the other chat recipient become unresponsive?
Certain status details must have a particular status associated with them; attempting to use them otherwise will result in an error.
The following status details are considered status=succeeded
emailDelivered- The email was successfully deliveredemailOpened- The email was openedemailClick- A link in the email was clickedletterDelivered- The letter is successfully deliveredchatRead- The chat message was read
The following status detail is only available for mail interactions sent with mailIsCertified=true.
letterPickUpAvailable- Letter is available for pickup at carrier location
The following status details are considered status=attempted.
voiceReceivedOutsideOpenHours- Caller tried to contact the lender outside designated business hoursvoiceConnected- Voice call connected successfullyvoiceDisconnectedBeforeQueue- Inbound call was disconnected before entering the queue.emailSent- Email was sent, but delivery cannot be confirmedletterCreated- Letter is successfully createdletterRenderedPdf- Letter's PDF proof is successfully renderedletterRenderedThumbnails- Letter's thumbnails are successfully renderedletterInTransit- Letter received an "In Transit" eventletterInLocalArea- Letter is in the local arealetterProcessedForDelivery- Letter is in the local arealetterRerouted- Letter is re-routedchatPosted- Chat message senttextConvoTimeoutAutoclose- This text conversation was closed automatically due to a timeout.textConvoClosedStale- (DEPRECATED) An open but outdated text conversation was closed automatically when a new text conversation was started. New text conversations should never enter into this state, but old conversations may be in this state.textConvoClosedByAgent- The agent manually marked the text conversation as ended.
The following status details are only available for mail interactions sent with mailIsCertified=true.
letterAccepted- Letter has been accepted into the carrier network for deliveryletterArrived- Letter has arrived at an intermediate location in the carrier networkletterContactCarrier- Letter has non-failure condition that requires contacting the carrierletterDamaged- Letter has been damaged; contact carrier for more detailsletterDelayed- Letter has been delayedletterDeliveryAttempted- Carrier attempted to deliver letter; contact carrier to ensure deliveryletterDeliveryRescheduled- Delivery of letter has been rescheduledletterDeparted- Letter has departed from an intermediate location in the carrier networkletterHeld- Letter held at carrier location; contact carrier for more detailsletterNoticeLeft- Carrier left notice during attempted delivery; follow instructions on noticeletterProcessed- Letter has been processed at an intermediate locationletterProcessing- Letter is processing at an intermediate location in the carrier networkletterOther- Peach's mail partner received an unrecognized status that does not have a predefined code
The following status details are considered status=failed.
Generally an interaction is failed if some part of connecting or completing the interaction failed due to a technical failure, misconfiguration, or attempt to communicate in a way disallowed by rules.
emailBlocked- Receiving server could not or would not accept the message temporarilyemailBounced- Receiving server could not or would not accept mail to this recipient permanentlyemailDropped- Email rejected for a number of reasons: rejected as SPAM, Unsubscribed Address, Bounced Address, Email InvalidemailFailedToSend- Not currently in use - reserved for future useemailReportedAsSpam- Email was delivered, but later reported as SPAM by recipientletterDeleted- Letter is successfully canceledletterFailedToCreate- Request to create the letter failed. Provider did not return 200 OK status codeletterReturnedToSender- Letter is returned to the sendertextA2PCampaignUnregistered- The text was not sent because the lender has not registered this phone number with an A2P campaign.textAccountSuspended- The account was suspended between message queuing and delivery.textCarrierViolation- The message was flagged as 'objectionable' or 'spam' by the phone carrier and was blocked.textConvoUnknownNumberRejected- This text was received from an unknown number, and so was rejected.textDeviceUnreachable- The destination phone number temporarily could not be reached - it was turned off, out of service area, etc.textLandlineOrUnreachableCarrier- The destination phone number could not receive the message. Reasons include the destination number being a landline phone or the carrier being temporarily unavailable.textLenderDisabledInboundTexts- The inbound text was not received because the lender does not have inbound texting enabled.textMessageBlocked- The destination phone number is blocked from receiving the message.textMessagePriceExceedsMax- The price of the message exceeds the max price parameter.textMissingSegment- One or more parts of a multipart message were not received.textNumberDisconnected- The destination phone number could not be reached and may be disconnected.textQueueOverflow- Too many messages were queued to be sent, and some were dropped as a result.textRegionInvalid- Permission to send an SMS or MMS has not been enabled for the region indicated by the 'To' numbertextUnknownError- An unknown error occurred when attempting to send the message.textUnsubscribedRecipient- The person you are trying to message has opted out of receiving messages from your Twilio phone number, Channels sender, or Messaging Service.voiceFailedToInitiate- Outbound voice call could not start for some reason; Or the inbound call was disconnected before entering the queue.voiceLenderDisabledInboundCalls- Inbound call received while lender has inbound voice call disabledvoiceNumberDisconnected- Outbound voice call to disconnected phone numbervoiceNumberInvalid- Invalid 'To' Phone NumbervoiceReceivedNoAgentsAvailable- Inbound call received while lender had no agents to answer it
The following status details are only available for mail interactions sent with mailIsCertified=true.
letterAddressIssue- Address information is incorrect; contact carrier to ensure deliveryletterDisposed- Letter disposed by carrierletterLocationInaccessible- Delivery location inaccessible to carrier; contact carrier to ensure deliveryletterLost- Letter has been lost; contact carrier for more detailsletterRescheduleDelivery- Contact carrier to reschedule deliveryletterUnclaimed- Letter is unclaimedletterUndeliverable- Letter was unable to be delivered
- Most status details can only be used with their respective channels. e.g.,
voiceNumberDisconnectedcan only be used for interactions withchannel=voice. Using them otherwise will result in an error invalidContactandblockedByComplianceGuardare valid for all channels
Certain status details are only valid with certain direction settings. Using them with an invalid direction will result in an error. For example...
voiceReceivedNoAgentsAvailablecan only be set forinboundphone callsvoiceNumberDisconnectedcan only be set foroutboundphone callsvoiceUnexpectedDisconnectcan be set for either direction
Note that null is not a valid status name but rather can be used to specify a query for interactions with a status of null
The subject of the interaction. The subject identifies the category of the content in the message.
Most subjects have an associated implicit theme. e.g., loanOverdueFirstNotice has a theme of opsCollDebt. For these subjects it is not necessary to specify a theme.
Some subjects like freeForm and custom<N> do not have an implicit theme. When using these subjects you must specify a theme.
DEPRECATED: locStatementGenerated and locStatementRegenerated are deprecated. They will be automatically converted into statementGenerated and statementRegenerated respectively. You should switch to use those subjects directly.
DEPRECATED: failedSettlementPeach is deprecated. This was always a subject used by the Peach application internally, and will no longer be used. Attempts to set this subject will be rejected with a 400 error.
The reason why an interaction occurred.
For example:
- An outbound debt collection call should be marked as
opsCollDebt. - An annual privacy policy update email should be marked as
opsServicing. - A customer service response to borrower's inquiry should be marked as
opsServicing.
DEPRECATED: inbBug, inbHumanLove, and opsServicingNegativeCreditReportNotice are deprecated: you cannot create or update interactions to have these values.
Provides details on the outcome of the interaction according to an agent.
Note this captures the "human" outcome of an interaction: e.g., Did you talk the person you intended to? Did the other chat recipient become unresponsive?
For the "technical" status of an interaction, see statusDetails. e.g., : Did it fail to send? Was it blocked by Compliance Guard?
voiceSpokeWithFirstParty- Agent spoke with borrowervoiceSpokeWithThirdParty- Agent spoke with someone other than the borrowervoiceLeftVoicemail- Agent left voicemailvoiceReachedVoicemailNoMessageLeft- Agent reached voicemail but did not leave a messagevoiceRangNoPickup- Phone rang, no voicemail was reached, and the call ended, or the agent hung upvoiceLineBusyNoRing- Agent reached busy phone linevoicePickedHungUp- Agent heard call pick up and immediate hang upvoiceDisconnectedWhileQueuedOnHold- Caller hung up while on holdvoiceUnexpectedDisconnect- The call was unexpectedly disconnectedvoiceFailedToInitiate- Outbound voice call could not start for some reasonvoiceNumberDisconnected- Outbound voice call to disconnected phone number
Represents various users such as a borrower, co-borrower, co-signer, etc. A lender can choose to provide PII or not. If no PII is provided, Peach cannot monitor for bankruptcy, deceased and SCRA.
The Compliance Guard rule identifier that blocked the interaction. Only applicable if the statusDetails=blockedByComplianceGuard and a rule actually blocked the interaction. In some cases the interaction can be blocked before rules are checked (e.g. a borrower is missing an address). In such a case the complianceGuardRuleId will be empty/null.
The contact details. A contact can be email, phone, address, etc. The name attribute is optional, and is useful for third-party contacts such as spouse, attorney, etc.
The lender's identifier of the contact information.
This should not include any ext- prefix as we know this is an external ID field.
End time of the interaction. This attribute is optional and is used for logging only.
For CRM-managed voice interactions, a call is considered ended when either the borrower or the agent disconnects.
The lender's identifier for the interaction.
After the object is successfully created, a lender can use ID or externalId identifiers to fetch the object.
To fetch the object using externalId you need to add ext- to the URL.
Note: Don't add ext- to the identifier value. For example: if the external identifier is ABCDE, then pass externalId=ACBCE and NOT ext-ABCDE when creating the object.
Detailed text describing the failure reason and any appropriate actions the user may take to fix the issue.
Short text describing the failure reason. Normally displayed in UI.
Boolean indicating the source of an Interaction. If true, the interaction was supplied by the lender via API. If false, the interaction was created by Peach.
true when this interaction is considered "transactional".
Transactional interactions are those which are sent via an automated system in response to an event or some action taken. e.g., an email sent to confirm a payment was made is transactional; likewise an email sent to confirm a password change is transacrtional. Examples of non-transactional messages would be: those sent by an agent in response to a customer request, for collections, or for marketing.
It's important to mark these messages correctly, because different laws may apply to messages depending on if they're considered "transactional".
Note: Can be null for interactions sent before the transactional-ness was added to the API.
The last task that was terminated (completed or canceled) for this interaction.
The ID of a Loan. This marks a particular loan as associated with this interaction.
The IDs of several loans. This marks several loans as associated with this interaction.
[ "LN-AAAA-BBBB", "LB-CCCC-DDDD" ]
If a previous interaction identifier is provided, the current and previous interactions will be linked. This can either be Peach's or a lender's external identifier.
Set this flag if this interaction has sensitive information. The flag is used for proper authorization of access to the information.
- oauth2
- bearerAuth
- apiKeyHeader
curl -i -X POST \
'https://sandboxapi.peach.finance/api/people/{personId}/interactions?searchable=false' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"channel": "string",
"content": null,
"id": "string",
"borrowerSelectedTheme": "agentNotification",
"contactId": "string",
"metaData": {},
"personId": "string",
"scheduledAtFrom": "2019-08-24T14:15:22Z",
"scheduledAtTo": "2019-08-24T14:15:22Z",
"startedAt": "2019-08-24T14:15:22Z",
"status": "attempted",
"statusDetails": "voiceSpokeWithFirstParty",
"subject": "annualPrivacyPolicyNotice",
"theme": "agentNotification",
"agentOutcome": "voiceSpokeWithFirstParty",
"borrower": {
"borrowerType": "person",
"collectionsIntensity": "light",
"commPreferences": {
"sendRemindersWhenCurrent": true,
"statementDeliveryChannels": [
"email"
]
},
"companyId": "string",
"externalId": "string",
"metaData": {},
"monitorStartDate": "2019-08-24",
"status": "active"
},
"complianceGuardRuleId": "string",
"contact": {
"address": {
"POBox": "string",
"addressLine1": "string",
"addressLine2": "string",
"city": "string",
"country": "string",
"countyOrRegion": "string",
"postalCode": "string",
"state": "strin"
},
"affiliation": "self",
"authorizedThirdParty": false,
"contactType": "phone",
"externalId": "string",
"label": "personal",
"name": "string",
"phoneDisconnectionDetails": {
"disconnectionStatus": "disconnected",
"lastDisconnectCheckDate": "2019-08-24",
"lastKnownConnectionDate": "2019-08-24"
},
"powerOfAttorney": false,
"receiveTextMessages": false,
"status": "primary",
"valid": true,
"value": "string",
"verified": false
},
"contactExternalId": "string",
"direction": "outbound",
"endedAt": "2019-08-24T14:15:22Z",
"externalId": "string",
"failureDescriptionLong": "string",
"failureDescriptionShort": "string",
"isExternal": true,
"isTransactional": true,
"lastTaskMeta": {
"assignedEmployee": {
"firstName": "string",
"id": "string",
"lastName": "string",
"userId": "string"
},
"assignmentStatus": "completed",
"sid": "string",
"taskInitAt": "2019-08-24T14:15:22Z",
"taskType": "answerInboundVoiceCall"
},
"loanId": "LN-AAAA-BBBB",
"loanIds": [
"LN-AAAA-BBBB",
"LB-CCCC-DDDD"
],
"previousInteractionId": "string",
"sensitive": false,
"twilioErrorCode": "string"
}'Success
{ "message": "string", "status": 0, "data": { "channel": "string", "content": null, "createdAt": "2019-08-24T14:15:22Z", "deletedAt": "2019-08-24T14:15:22Z", "id": "string", "updatedAt": "2019-08-24T14:15:22Z", "borrowerSelectedTheme": "agentNotification", "contactId": "string", "metaData": {}, "personId": "string", "scheduledAtFrom": "2019-08-24T14:15:22Z", "scheduledAtTo": "2019-08-24T14:15:22Z", "startedAt": "2019-08-24T14:15:22Z", "status": "attempted", "statusDetails": "voiceSpokeWithFirstParty", "subject": "annualPrivacyPolicyNotice", "theme": "agentNotification", "agentOutcome": "voiceSpokeWithFirstParty", "agentOutcomeUpdatedAt": "2019-08-24T14:15:22Z", "borrower": { … }, "companyId": "string", "complianceGuardRuleId": "string", "contact": { … }, "createdBy": { … }, "direction": "outbound", "endedAt": "2019-08-24T14:15:22Z", "externalId": "string", "failureDescriptionLong": "string", "failureDescriptionShort": "string", "isExternal": true, "isTransactional": true, "lastTaskMeta": { … }, "loanId": "LN-AAAA-BBBB", "loanIds": [ … ], "object": "interaction", "previousInteractionId": "string", "sendAt": "2019-08-24T14:15:22Z", "sensitive": false, "sensitiveBorrowerOnly": false, "statusDetailsUpdatedAt": "2019-08-24T14:15:22Z", "statusUpdatedAt": "2019-08-24T14:15:22Z", "supercaseBulkOperationId": "string", "templateVersionId": "string", "twilioErrorCode": "string" } }