Create a session

This section will show you how to:

  • Authenticate the request
  • Create a session

Authentication

From here on, each endpoint requires an RSA-signed request for Authentication. This can either be constructed manually or via one of our backend SDKs. The Yoti SDK exposes a simple request builder class to support the authentication process, and the examples provide snippets of this usage in each endpoint code snippet. You will need your Yoti SDK ID and application key pair for either process.

The method is detailed below if you prefer to authenticate without the SDK.

Generate signed request

Yoti API endpoints are authenticated through signed requests, and the current approach for building signed requests consists of passing the following HTTP Header:

  • X-Yoti-Auth-Digest

Here's how to compute it:

  1. Concatenate the HTTP method, the path, the query string (enriched with a timestamp and a nonce parameter) and the base64 encoded request body, if available, using the & character.

Example GET request:

HTTP
Copy

Example POST request:

HTTP
Copy
  1. Apply SHA256withRSA to the string generated from step 1, using your PEM private key generated from the Yoti Hub.
  2. Base64 encode the result from 2, so that it can be sent as a string header.

The API Base URL is https://api.yoti.com/idverify/v1

ParameterDescription
sdkIdUUID generated when producing your Yoti keys
nonceNonces are UUID strings
timestampUNIX timestamps (number of elapsed seconds since Jan 1st 1970)

SDK request builder

Please use our Yoti SDKs to automatically build the relevant request. The Yoti SDKs are available via popular dependency management systems.

Javascript
PHP
Python
Java
Go
C#
Copy
Javascript
PHP
Python
Java
Go
C#
Copy

Create session

You can use it to build and send your session as shown in the code snippet below. For the claimed ID version you will need to ensure you have captured applicant details including:

  • Applicant information: Name, DOB and Address.
  • Which three documents they will be bringing to the branch.
  • A branch look up service.

This information is needed at a minimum to fulfil the DBS requirements.

HTTP
Copy

Example Payloads

Claimed ID JSON
Resultant ID JSON
Hybrid JSON
Copy
NameDescriptionOptional
session_deadline

This is in a datetime format. The user has up until this date and time to complete the session. The customer letter will only show the date, not the time, and therefore we recommend setting the time to 22:00 to ensure a candidate has the entire day to enter a Post Office branch.

This must be a minimum of 7 days.

resources_ttlThis sets the retention time for images, document data and the applicant profile data in the session. This timer must be configured to be at least 24 hours longer than your session_deadline. It starts from the first media upload.
user_tracking_idAllows the relying business backend to track the same user across multiple sessions. Note: This should not contain any personal identifiable information
ibv_optionsOutlines that an IBV session is being generated.

Notifications

This service optionally posts an update notification every time the session state changes, based on the selected subscription topics.

NameDescription
NEW_PDF_SUPPLIEDYou can subscribe to be notified when the user has got the PDF. Only relevant when using the At home flow.
INSTRUCTIONS_EMAIL_REQUESTEDIf you do not enable this notification an email will automatically be sent to the user with their instructions. If you do enable this notification the email service will be revoked and you will need to configure this set up yourself. Yoti will send an async notification to prompt you to retrieve the PDF from Yoti and send it to the customer.
THANK_YOU_EMAIL_REQUESTEDEnabling this notification suppresses the final email a user receives after completing their journey in the branch. You may want to enable this if planning to send your own completion email.
FIRST_BRANCH_VISITThis notification is triggered when an applicant has had their customer letter QR code scanned in a Post Office branch for the first time. The notification could be used to assess whether a customer has visited a branch location, but been turned away due to no follow up session completion.
SESSION_COMPLETIONTriggered when all tasks and all checks inside of a given session have been completed.

Requested In Person Checks

CheckDescription
PROFILE_DOCUMENT_MATCHChecks the document the applicant brought with them matches the submitted applicant profile.
DOCUMENT_SCHEME_VALIDITY_CHECKChecks the documents themselves fit within the rule of that scheme. E.g. DBS have rules of bills and expiry e.g. valid for the last 3 months or issued within X time.
IBV_VISUAL_REVIEW_CHECKA visual review of the document by the postmaster.

Additional Optional Checks

This service is highly configurable, if you would like assistance in using any of the checks below please get in touch with our client support team through support.yoti.com.

CheckDescription
Document authenticityA request to assess the characteristics of a document, to determine the validity of the ID document. Yoti will perform multiple checks on a ID document.
Text extractionA request to obtain the data printed visually on a document, in sta ructured form.
Supporting documentsYoti offers the ability to request additional documents to enhance the verification of the user.
Document comparisonIf you request your users to upload more than one document we offer the ability to cross check the data
Face match checkA request to assess whether the user's face matches the face on the ID document.
Address checkThis check will facilitate an extra verification of a user by searching a person’s details against a collated database from various sources worldwide.
AML checkExtend the Identity verification integration by requesting an watchlist, PEPs and sanctions check as part of a session.

Required documents

Please check out the overview page for which documents we support. In the example below and above, three documents are being set for the applicant (each document is one object in the list).

JSON
Copy
NameDescription
typeOutlines the type of documents required. Either an ID document or supplementary document.

Applicant Profile

This is the customer information you will collect before generating the session.

NameTypeDescriptionExample
full_nameStringFullName contains given names and family name.“Jon Jim Foo”
date_of_birthStringDateOfBirth is the date of birth in the form yyyy-mm-dd."2000-12-01"
structured_postal_addressObjectStructuredPostalAddress is the postal address with the breakdown in address lines, post code and so on as well as the formatted address all in one line. See details for structured_postal_address JSON properties below.See below

Structured Postal Address

Field nameTypeDescription
address_formatnumberAddressFormat is used to identify which fields may be present in the JSON object. See table below that defines what format is used for each country.
udprnstringUdprn is the Unique Delivery Point Reference Number that identifies a property throughout its lifecycle.
care_ofstringCareOf identifies the owner of the premises.
sub_buildingstringSubBuilding is used when the building is divided into smaller units (e.g. a block of flats) to identify the sub unit.
building_numberstringBuildingNumber is the number of the building.
buildingstringBuilding is the name/number of the building.
streetstringStreet is the name/number of the street the building is on.
landmarkstringLandmark is a description used to describe the location of the building.
address_line1stringAddressLine1 is the first line of the address.
address_line2stringAddressLine2 is the second line of the address.
address_line3stringAddressLine3 is the third line of the address.
address_line4stringAddressLine4 is the fourth line of the address.
address_line5stringAddressLine5 is the fifth line of the address.
address_line6stringAddressLine6 is the sixth line of the address.
localitystringLocality is the area the building is in.
town_citystringTownCity is the town/city/village/hamlet/community/etc. that the building is in.
subdistrictstringSubdistrict is the sub-district the building is in.
districtstringDistrict is the district the building is in.
statestringState is the state/county the building is in.
postal_codestringPostalCode is a code used by the country's postal service to aid in sorting and delivering mail (e.g. postcode, zipcode, pincode).
post_officestringPostOffice is the post office that serves the area the building is in.
country_isostringCountryIso is the country the building is in. In ISO-3166-1 alpha-3 format.
countrystringCountry is the country the building is in. Localised.
formatted_addressstringFormattedAddress is the full address in a single human readable string in a format that is suitable for printing onto an envelope. This field is not required when providing address information.

The below defines the fields of the JSON structure used for all addresses. A subset of fields will be present in each case and address_format can be used to ascertain which ones for any given address. The country iso should not be used for this purpose.

Four address formats are available and detailed below:

Countries that use this formatGBR, JEY, IMNINDUSA, AUSAll other countries
address_format1234
udprnOptional
care_ofOptional
sub_buildingOptional*
building_numberOptional*
buildingOptional*Optional
streetOptional
landmarkOptional
address_line1MandatoryMandatoryMandatory
address_line2OptionalOptionalOptional
address_line3OptionalOptional
address_line4Optional
address_line5Optional
address_line6Optional
localityOptional
town_cityMandatoryOptionalMandatory
subdistrictOptional
districtOptional
stateOptionalOptionalMandatory
postal_codeMandatoryMandatoryMandatoryOptional
post_officeOptional
country_isoMandatoryMandatoryMandatoryMandatory
countryMandatoryMandatoryMandatoryMandatory
formatted_address**MandatoryMandatoryMandatoryMandatory

** At least one must be present

*** Will always be returned in the data extraction, but is not mandatory when configuring an applicant profile

Example response

If the request is successful and a session is generated the API will send a response in the form:

JSON
Copy
NameDescription
client_session_token_ttlTime in seconds until the client session expires
client_session_tokenUsed to authenticate the session
session_idID of the session

Error Responses

If the request is unsuccessful you will receive one of the below error responses in the form:

JSON
Copy
Error codeDescription
400payload validation error
401unauthorised request, wrong key used
403application is disabled or no associated organisation id
404the application for provided sdk id does not exist
503service is unavailable
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated by Saurabh Bansal