# Send one time code.


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

Endpoint: POST /companies/{companyId}/auth/send-one-time-code
Version: 2025-03-26
Security: oauth2, bearerAuth, apiKeyHeader

## Path parameters:

  - `companyId` (string, required)
    The unique company identifier.

## Request fields (application/json):

  - `channel` (string, required)
    The channel via which to send the one time code through.
    Enum: "email", "text", "voice"

  - `context` (object)
    Template specific properties to substitute in the corresponding
ConfirmationCode template.

  - `force` (boolean)
    Force using the auth type of the user and not the company

  - `userType` (string)
    The type of the user.
    Enum: "agent", "borrower", "service"

  - `username` (string, required)
    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.

