Skip to main content

API Reference

Base URL: https://service.veriph.one

tip

Swagger fan? Are you curious about how to tinker with our API? We've got you covered! Access our Swagger API specification here:

Create Session

POST /sdk-api/phone-verification/create-session/v1.0.0

Headers

NameRequiredValue/Description
x-api-keyYesA string containing your API Key, get yours at dashboard.veriph.one
Content-TypeYesapplication/json

Parameters

Encoded as a JSON object in the request body.

NameRequiredTypeDescription
metadataYesSessionMetadataData used to detect anomalous behavior
configurationNoSessionConfigurationOptional field to customize flow
prefilledPhoneNumberNoPrefilledPhoneNumberIf sent, the flow will have 2FA behavior, and the user won't be able to input a new phone number. Don't send it if you want to capture the user's phone number.

Responses

CodeContent-typeResponse BodyNotes
200application/jsonSessionCreationResponseSuccessful request
400application/jsonErrorMessageIncomplete or invalid inputs
5XXNoneNoneServer is down.

Verification Result

GET /sdk-api/phone-verification/verification-result/v1.0.0

Headers

NameRequiredValue/Description
x-api-keyYesA string containing your API Key, get yours at dashboard.veriph.one
AuthorizationYesString containing your API Key secret in the format Basic [YOUR API KEY SECRET]
Content-TypeYesapplication/json

Parameters

Appended to the URL as query params.

NameRequiredTypeDescription
sessionUuidYesStringThe uuid of the session created using the create-session endpoint

Responses

CodeContent-typeResponse BodyNotes
201application/jsonVerificationResultSuccessful request
400application/jsonErrorMessageIncomplete or invalid inputs
5XXNoneNoneServer is down.

Objects

ErrorMessage

PropertyDescriptionTypeOptional
errorMessageDeveloper friendly error message in english.StringYes
internalErrorCodeNon-http-code that facilitates debugging.NumberNo

Internal Error Codes

CodeDescription
14226Session creation request missing metadata object or fields are incomplete.
20000Country code is invalid or has unknown format.
20001Phone number is invalid or has unknown format.

SessionMetadata

PropertyDescriptionTypeNullableRequired
userIdString containing a unique identifier for the user making the operation.StringNoYes
ipAddressString containing the user's IP address at the time of the verification.StringNoYes
userAgentString containing the user's user agent at the time of the verification.StringNoNo
tip

We encourage you to send as much information as possible through this object with maximum fidelity; we use these fields to protect your application from fraud and suspicious transactions. However, we don't need any information that identifies the user personally, so try to avoid doing so.

PrefilledPhoneNumber

PropertyDescriptionTypeNullableRequired
countryCodeDigit-only string containing the user's country code without the '+' sign.StringNoYes
cellphoneNumberDigit-only string containing the user's phone number without country code.StringNoYes
userCanEditAllows user to edit the phone provider by your server.BooleanNoNo

SessionConfiguration

PropertyDescriptionTypeNullableRequired
localeString determining the language to be shown to the user in the UI in ISO 639-1 format.StringNoYes
enforceInputForce users to manually enter their phone number before initiating Inverse OTP verification.BooleanNoNo
tip

The user interface is shown in English by default when the locale is unspecified. However, the user can change the language at any time using a language selector.

SessionCreationResponse

PropertyDescriptionTypeNullable
uuidString containing the UUID of the session created.StringNo
createdAtString containing the session's creation date in ISO8601 format.StringNo
redirectionUrlURL used to redirect the user to the intented verification flow.StringNo

Attempt

PropertyDescriptionTypeNullable
uuidThe attempt's unique ID.StringNo
createdAtThe attempt's creation date time in ISO8601 format.StringNo
countryCodeInputCountry code selected by the user.StringNo
phoneNumberInputPhone number submitted by the user.StringNo
methodVerification method used. Possible values.NumberNo
statusVerification attempt's current state. Status catalogNumberNo

Verification Method Types

CodeDescription
10Inverse OTP via SMS.
11Inverse OTP via WhatsApp.
20Traditional OTP via SMS.
21Traditional OTP via WhatsApp.
30Traditional OTP via Robocall.

Attempt Statuses

CodeDescription
0b00000000000000Waiting for verification.
0b10000000000000Verification successful.
0b01000000000001Destination mismatch. For Inverse OTP, means someone tried to tamper with the result.
0b01000000000010Origin mismatch. For Inverse OTP, user sent the message from a different number.
0b01000000000100Attempt status was invalided because the session closed.
0b01000000001000Attempt expired.
0b01000000010000Client was disabled due to pending payment or administrative reasons.
0b01000000100000Potential tampering due to mismatching verification methods.
0b01000001000000Too many Traditional OTP submissions.
0b01000010000000User exceeded their Traditional OTP quota for the current method.
0b01000100000000Attempt made invalid by user-triggered cancellation/request.
tip

As you can see, Veriph.One uses binary flags to determine the status of each attempt. These statuses can overlap, and you could have cases where verification is successful, but later, someone tried to tamper with it. The statuses can update over time due to this reason. We recommend masking the status result using an AND operation if you want to check for a specific status.

VerificationResult

PropertyDescriptionTypeNullable
prefilledCountryCodePrefilled code sent to create-sessionStringYes
prefilledPhoneNumberPrefilled number sent to create-sessionStringYes
createdAtSession's creation date time in ISO8601 format.StringNo
closedAtSession's closure date time in ISO8601 format.StringNo
userIdMetadata sent to create-sessionStringYes
firstSuccessfulAttemptThe successful verification result, if any.AttemptYes
attemptsArray of attempts made by user.Attempt[]No