Skip to content

Send one time code.

Request

Send a one time code to a phone number or email address. For phone numbers, the code can be sent via text or voice.

Path
companyIdstringrequired

The unique company identifier.

Bodyapplication/jsonrequired
channelstring(OneTimeCodeChannel)required

The channel via which to send the one time code through.

Enum:"email""text""voice"
contextobject

Template specific properties to substitute in the corresponding ConfirmationCode template.

forceboolean

Force using the auth type of the user and not the company

Default:false
userTypestring(UserType)

The type of the user.

Enum:"agent""borrower""service"
usernamestringrequired

Either an email address or phone number.

If the specified channel is text or voice, or the auth type for the specified userType is oneTimeCodeText, then this must be a valid phone number. Otherwise, it must be a valid email address.

This username is used to look up the user in the system.

For agents:

  • If the user belongs to an agent, then the given username is used directly as the recipient email address or phone number to text or call with the one time code.

For borrowers:

  • If the user belongs to a borrower of type business, then the given username is used directly as the recipient email address or phone number to text or call with the one time code.
  • If the user belongs to a borrower of type person, then borrower's primary contact with affiliation=self is selected. And that value is used as the recipient email address or phone number to text or call with the one time code.
POST
/companies/{companyId}/auth/send-one-time-code
curl -i -X POST \
  'https://sandboxapi.peach.finance/api/companies/{companyId}/auth/send-one-time-code' \
  -H 'Content-Type: application/json' \
  -d '{
    "channel": "email",
    "context": {},
    "force": false,
    "userType": "agent",
    "username": "string"
  }'

Responses

No input errors were found. i.e., The one time code may have been sent successfully.

We do not reveal if a borrower is found and a message successfully sent in order to prevent an attacker from learning if the given phone number or email addresse is in the system.