Understand the context object and schema

When integrating with the GBG GO API, you will pass customer data using the context object. This object contains structured information required for identity verification, document processing, and biometric validation.

What is the context object?

The context object is a structured data model that holds customer details and other metadata needed during a journey. It consists of multiple nested objects, each representing different aspects of the customer’s identity and verification details.

The primary sections of the context object include:

  • subject – Contains identity information, documents, and biometrics related to the customer.
  • device – Provides device-related metadata, such as IP address.
  • metadata – Stores additional details related to the journey.

Where does the schema come from?

Each customer journey is designed in the GBG GO platform, and every published journey has a schema that defines the expected structure of the context object.

You should:

  • Retrieve the schema for a journey from the Journey Dashboard in the GBG GO platform.
  • Use the schema as the source of truth when structuring API requests.
  • Ensure that data types and required fields match those defined in the schema.

Why is the schema important?

  • It dictates the format in which data should be sent.
  • It ensures compatibility between the API and the verification modules.
  • It reduces errors by validating input data before submission.

Key objects in the context schema

The schema defines multiple objects within the context, each containing required and optional fields, such as:

  • Identity Object – Contains personal details such as name, date of birth, and contact information.
  • Documents Object – Holds information about identity documents, including images and classification details.
  • Biometrics Object – Stores biometric data such as face images used for verification.
The schema may vary depending on the journey configuration. Always refer to the schema retrieved from the Journey Dashboard for the most up-to-date structure.

How to use the table below

The following table provides a detailed breakdown of all possible fields in the context object. It includes field names, descriptions, expected data types, and whether the field is required or optional. Use this reference when constructing API requests to ensure all necessary data is included in the correct format:

Person

PropertyTypeDescription
titleTitleTitle of the individual
firstNameFirstNameGiven name of the individual
middleNamesMiddleNamesAny additional registered names
lastNamesLastNamesFamily names of the individual
lastNamesAtBirthLastNamesFamily names at birth
aliasesarray of NamesObjectAlternative names used by the person
relatedPersonsarray of RelatedPersonRelated persons with relationship type
dateOfBirthDateBirth date of the individual
genderGenderGender of the individual
currentAddressAddressCurrent residence of the individual
previousAddressesarray of PreviousAddressPast residences with date range
placeOfBirthAddressBirthplace of the individual
idNumbersarray of IdNumbersIdentification numbers
phonesarray of PhonesContact numbers
emailsarray of EmailsEmail addresses
socialsarray of SocialsSocial media accounts

Sample Data

{
  "title": "Mr",
  "firstName": "David",
  "middleNames": ["James"],
  "lastNames": ["Jones"],
  "lastNamesAtBirth": ["Smith"],
  "aliases": [
    {
      "firstName": "Dave",
      "lastNames": ["Johnson"]
    }
  ],
  "relatedPersons": [
    {
      "relationship": "mother",
      "firstName": "Sarah",
      "lastNames": ["Jones"]
    }
  ],
  "dateOfBirth": "1985-06-15",
  "gender": "Male",
  "currentAddress": {
    "addressString": "128 Queen Victoria Street, London, EC4V 4BJ, GBR"
  },
  "previousAddresses": [
    {
      "address": {
        "addressString": "45 Oxford St, Manchester, M1 5AN, GBR"
      },
      "dateRange": {
        "fromDate": "2000-01-01",
        "toDate": "2010-12-31"
      }
    }
  ],
  "placeOfBirth": {
    "locality": "London",
    "country": "GBR"
  },
  "idNumbers": [
    {
      "type": "SSN",
      "idNumber": "AAA-GG-SSSS"
    }
  ],
  "phones": [
    {
      "type": "mobile",
      "number": "+44 207 4281250"
    }
  ],
  "emails": [
    {
      "type": "work",
      "email": "david.jones@company.com"
    }
  ],
  "socials": [
    {
      "type": "LinkedIn",
      "identity": "davidjones123"
    }
  ]
}

Supporting Schemas

RelatedPerson

PropertyTypeDescription
relationshipstringRelationship type (e.g., "mother", "father", "maternalGrandFather", etc.)
titleTitleTitle of the related person
firstNameFirstNameGiven name of the related person
middleNamesMiddleNamesAdditional registered names of the related person
lastNamesLastNamesFamily names of the related person
lastNamesAtBirthLastNamesFamily names at birth of the related person

PreviousAddress

PropertyTypeDescription
addressAddressAddress object
dateRangeDateRangeDate range object specifying the duration of residence

Phones

PropertyTypeDescriptionExample
typestringType of phone (landline, mobile, fax, etc.)"mobile"
numberstringPhone number in international format"+44 207 4281250"
Sample Data
[
  {
    "type": "mobile",
    "number": "+44 207 4281250"
  }
]

IdNumbers

PropertyTypeDescriptionExample
typestringType of ID (e.g., SSN)"SSN"
idNumberstringThe ID number itself"AAA-GG-SSSS"
Sample Data
[
  {
    "type": "SSN",
    "idNumber": "AAA-GG-SSSS"
  }
]

Emails

PropertyTypeDescriptionExample
typestringType of email (home, work, etc.)"home"
emailstringEmail address"person.name@domain.com"
Sample Data
[
  {
    "type": "home",
    "email": "person.name@domain.com"
  }
]

Socials

PropertyTypeDescriptionExample
typestringSocial media platform"Facebook"
identitystringUser’s handle on the platform"myName123456"
Sample Data
[
  {
    "type": "Facebook",
    "identity": "myName123456"
  }
]

Address

PropertyTypeDescriptionExample
linesarray of stringsAddress in multiple lines["128 Queen Victoria Street", "London"]
addressStringstringAddress in a single line"128 Queen Victoria Street, London, EC4V 4BJ, GBR"
premisestringBuilding number"128"
thoroughfarestringStreet name"Queen Victoria Street"
localitystringCity or town"London"
postalCodestringPostal or ZIP code"EC4V 4BJ"
countrystringISO2 or ISO3 country code"GBR"
organizationstringAssociated company or organization"GB Group"
Sample Data
{
  "addressString": "128 Queen Victoria Street, London, EC4V 4BJ, GBR",
  "locality": "London",
  "country": "GBR",
  "postalCode": "EC4V 4BJ",
  "organization": "GB Group"
}

Title

PropertyTypeDescriptionExample
titlestringHonorific title (Mr, Mrs, Dr, etc.)"Mr"
Sample Data
{
  "title": "Mr"
}

FirstName

PropertyTypeDescriptionExample
firstNamestringGiven name of the person"David"

MiddleNames

PropertyTypeDescriptionExample
middleNamesarray of stringsAdditional registered names["James"]
Sample Data
{
  "middleNames": ["James"]
}

LastNames

PropertyTypeDescriptionExample
lastNamesarray of stringsFamily names["Jones"]
Sample Data
{
  "lastNames": ["Jones"]
}

NamesObject

PropertyTypeDescriptionExample
titlestringTitle of the individual"Mr"
firstNamestringGiven name"David"
middleNamesarray of stringsAdditional registered names["James"]
lastNamesarray of stringsFamily names["Jones"]
lastNamesAtBirtharray of stringsFamily names at birth["Smith"]
Sample Data
{
  "title": "Mr",
  "firstName": "David",
  "middleNames": ["James"],
  "lastNames": ["Jones"],
  "lastNamesAtBirth": ["Smith"]
}

Gender

PropertyTypeDescriptionExample
genderstringGender of the individual"Male"

DateTime

An ISO 8601 timestamp, with no optional bits:

  1. Hyphens MUST be used to separate the date components.
  2. Day and month should be 2 digits.
  3. Colons MUST be used to separate the time components.
  4. Timestamps MUST NOT contain milliseconds.
  5. Timestamp MUST indicate the timezone, either as a time offset or a Zulu time indicator.
PropertyTypeFormatPattern
DateTimestringdate-time`^\d-\d-\dT\d:\d:\d(([+-]\d:\d)Z)$`
Sample Data
"2019-01-04T14:38:25Z"

TimeRange

PropertyTypeDescription
startDateTimeStart timestamp
endDateTimeEnd timestamp
Sample Data
{
  "start": "2023-06-15T08:30:00Z",
  "end": "2023-06-15T17:00:00Z"
}

Date

PropertyTypeDescription
DatestringSpecified in year, month, and day separated by - (ISO 8601 format)
Sample Data
"2000-01-01"

DateRange

PropertyTypeDescription
fromDateDateStart date
toDateDateEnd date
Sample Data
{
  "fromDate": "2015-05-10",
  "toDate": "2020-12-31"
}

Location

PropertyTypeDescription
latitudestringLatitude of the location
longitudestringLongitude of the location
geoAccuracystringAccuracy of the geolocation data
what3wordsstringA What3Words designation with . separator
Sample Data
{
  "latitude": "51.5074",
  "longitude": "-0.1278",
  "geoAccuracy": "high",
  "what3words": "bearable.expecting.comical"
}

ResponseErrors

Response errors returned by any GBG service.

PropertyTypeDescription
correlationIdstringUnique UUID for the transaction related to the error
errorsarrayList of processing issues
Sample Data
{
  "correlationId": "7ab2ff08-728a-42e6-aa38-df191ffd4817",
  "errors": [
    {
      "location": "Authorization",
      "code": 1106,
      "problem": "The token is invalid",
      "action": "Please pass a valid token for access"
    }
  ]
}

StandardisedError

PropertyTypeDescription
locationstringWhere the error occurred
codeintegerError code
problemstringDescription of the issue
actionstringSuggested action to resolve the issue
Sample Data
{
  "location": "Authorization",
  "code": 1106,
  "problem": "The token is invalid",
  "action": "Please pass a valid token for access"
}

Next, lets proceed to the Identity Documents Schema

IdentityDocument

PropertyTypeDescription
idstringUnique identifier for the identity document
deviceCaptureDeviceInfoInformation about the device used for document capture
side1ImagestringImage of the front side of the document
side2ImagestringImage of the back side of the document
mrzstringMachine-readable zone (MRZ) extracted from the document
classificationDocumentClassificationInfoV1Classification details of the document
extractionDocumentExtractionInfoV1Extracted information from the document
validationDocumentValidationInfoV1Validation details of the document
categorystringGeneral category of the document (e.g., passport, ID card)
typestringSpecific type of document
subTypestringSub-type of the document
formatstringFormat of the document
numberstringUnique identification number on the document
issueDatestring (date)Date when the document was issued
expiryDatestring (date)Date when the document expires
subjectIdentityPersonal details of the document holder
countryCountryCountry of issuance (ISO 3166-1 alpha-2 country code)

Sample Data

{
  "id": "123456",
  "device": {
    "type": "scanner",
    "model": "Canon DR-C225",
    "hasContactlessReader": false,
    "hasMagneticStripeReader": false,
    "hasCamera": true,
    "serialNumber": "ABC123456",
    "manufacturer": "Canon"
  },
  "side1Image": "https://example.com/front.jpg",
  "side2Image": "https://example.com/back.jpg",
  "mrz": "P<GBRJONES<<DAVID<<<<<<<<<<<<<<<<<<<<<<<<<1234567890GBR850101M2501017<<<<<<<<<<<<<<04",
  "classification": {
    "ids": ["1234"],
    "category": "Passport",
    "type": "National ID",
    "subtype": "Standard",
    "isDoubleSided": true,
    "hasNFC": false,
    "year": "2020",
    "countryCode": "GB",
    "countryName": "United Kingdom",
    "stateCode": "ENG",
    "stateName": "England",
    "sides": [
      {
        "side": "front",
        "id": "front-id",
        "documentQuality": "good",
        "documentQualityScore": 95
      }
    ]
  },
  "extraction": {
    "aggregatedFields": [
      {
        "label": "Document Number",
        "value": "1234567890",
        "source": "OCR",
        "isNonLatin": false,
        "regionOfInterest": {
          "boundingBox": {
            "x": 100,
            "y": 50,
            "width": 300,
            "height": 100
          },
          "side": "front",
          "spectrum": "visible",
          "imageId": "img-001"
        }
      }
    ],
    "extractedFields": [
      {
        "label": "Full Name",
        "details": [
          {
            "label": "First Name",
            "value": "David",
            "source": "OCR"
          },
          {
            "label": "Last Name",
            "value": "Jones",
            "source": "OCR"
          }
        ]
      }
    ]
  },
  "validation": {
    "validationChecks": [
      {
        "name": "MRZ Check",
        "title": "Machine Readable Zone Validation",
        "info": "Verifies MRZ matches document details",
        "validationResult": "Passed",
        "resultInfo": "Valid MRZ format",
        "weight": "High",
        "regionOfInterests": [
          {
            "boundingBox": {
              "x": 50,
              "y": 200,
              "width": 250,
              "height": 50
            },
            "side": "back",
            "spectrum": "visible",
            "imageId": "img-002"
          }
        ],
        "type": "Security Check"
      }
    ]
  },
  "category": "Passport",
  "type": "International",
  "subType": "Standard",
  "format": "Biometric",
  "number": "A12345678",
  "issueDate": "2015-06-15",
  "expiryDate": "2025-06-15",
  "subject": {
    "firstName": "David",
    "lastName": "Jones",
    "dateOfBirth": "1985-01-01",
    "gender": "Male",
    "nationality": "GBR"
  },
  "country": "GB"
}

CaptureDeviceInfo

PropertyTypeDescription
typestringType of device used for document capture (e.g., scanner, camera)
modelstringModel name of the device
hasContactlessReaderbooleanIndicates if the device has a contactless reader
hasMagneticStripeReaderbooleanIndicates if the device has a magnetic stripe reader
hasCamerabooleanIndicates if the device has a camera
serialNumberstringSerial number of the device
manufacturerstringName of the manufacturer

Sample Data

{
  "type": "scanner",
  "model": "Canon DR-C225",
  "hasContactlessReader": false,
  "hasMagneticStripeReader": false,
  "hasCamera": true,
  "serialNumber": "ABC123456",
  "manufacturer": "Canon"
}

DocumentClassificationInfoV1

PropertyTypeDescription
idsarray of stringsList of document classification identifiers
categorystringGeneral category of the document (e.g., Passport, ID Card)
typestringSpecific document type
subtypestringSub-type of the document
isDoubleSidedbooleanIndicates if the document has two sides
hasNFCbooleanIndicates if the document has NFC capability
yearstringYear of document issuance or version
countryCodestringCountry code (ISO 3166-1 alpha-2)
countryNamestringFull country name
stateCodestringState or region code
stateNamestringFull state or region name
sidesarray of SideClassificationClassification details of the document sides

Sample Data

{
  "ids": ["1234"],
  "category": "Passport",
  "type": "National ID",
  "subtype": "Standard",
  "isDoubleSided": true,
  "hasNFC": false,
  "year": "2020",
  "countryCode": "GB",
  "countryName": "United Kingdom",
  "stateCode": "ENG",
  "stateName": "England",
  "sides": [
    {
      "side": "front",
      "id": "front-id",
      "documentQuality": "good",
      "documentQualityScore": 95
    }
  ]
}

SideClassification

PropertyTypeDescription
sidestringSpecifies which side of the document (e.g., “front”, “back”)
idstringUnique identifier for the document side
documentQualitystringQuality assessment of the document side (e.g., “good”, “poor”)
documentQualityScorenumberScore indicating document quality (e.g., 0-100)

Sample Data

{
  "side": "front",
  "id": "front-id",
  "documentQuality": "good",
  "documentQualityScore": 95
}

Rectangle

PropertyTypeDescription
xnumberX-coordinate of the bounding box
ynumberY-coordinate of the bounding box
widthnumberWidth of the bounding box
heightnumberHeight of the bounding box

Sample Data

{
  "x": 100,
  "y": 50,
  "width": 300,
  "height": 100
}

RegionOfInterest

PropertyTypeDescription
boundingBoxRectangleBounding box defining the region of interest
sidestringSpecifies which side of the document (e.g., “front”, “back”)
spectrumstringSpectrum type (e.g., “visible”, “infrared”)
imageIdstringIdentifier for the associated image

Sample Data

{
  "boundingBox": {
    "x": 100,
    "y": 50,
    "width": 300,
    "height": 100
  },
  "side": "front",
  "spectrum": "visible",
  "imageId": "img-001"
}

DocumentField

PropertyTypeDescription
labelstringName of the field (e.g., “Document Number”, “Full Name”)
valuestringExtracted value of the field
sourcestringSource of extraction (e.g., “OCR”, “MRZ”)
isNonLatinbooleanIndicates if the value contains non-Latin characters
regionOfInterestRegionOfInterestBounding box defining the field’s location

Sample Data

{
  "label": "Document Number",
  "value": "1234567890",
  "source": "OCR",
  "isNonLatin": false,
  "regionOfInterest": {
    "boundingBox": {
      "x": 100,
      "y": 50,
      "width": 300,
      "height": 100
    },
    "side": "front",
    "spectrum": "visible",
    "imageId": "img-001"
  }
}

ExtractedField

PropertyTypeDescription
labelstringName of the extracted field (e.g., “Full Name”)
detailsarray of DocumentFieldDetailed extracted data for this field

Sample Data

{
  "label": "Full Name",
  "details": [
    {
      "label": "First Name",
      "value": "David",
      "source": "OCR"
    },
    {
      "label": "Last Name",
      "value": "Jones",
      "source": "OCR"
    }
  ]
}

Country

PropertyTypeDescription
CountrystringISO 3166-1 alpha-2 country code

Sample Data

"GB"

Identity

PropertyTypeDescription
firstNamestringGiven name of the individual
lastNamestringFamily name of the individual
dateOfBirthstring (date)Date of birth in YYYY-MM-DD format
genderstringGender of the individual
nationalitystringNationality (ISO 3166-1 alpha-2 country code)

Sample Data

{
  "firstName": "David",
  "lastName": "Jones",
  "dateOfBirth": "1985-01-01",
  "gender": "Male",
  "nationality": "GB"
}

ExtractedImage

PropertyTypeDescription
labelstringName or type of the extracted image
sidestringSpecifies which side of the document (e.g., “front”, “back”)
imageIDstringUnique identifier for the extracted image

Sample Data

{
  "label": "Face Photo",
  "side": "front",
  "imageID": "img-12345"
}

DocumentExtractionInfoV1

PropertyTypeDescription
aggregatedFieldsarray of DocumentFieldList of extracted document fields with aggregated data
extractedFieldsarray of ExtractedFieldList of individual extracted fields with details
extractedImagesarray of ExtractedImageList of extracted images from the document

Sample Data

{
  "aggregatedFields": [
    {
      "label": "Document Number",
      "value": "1234567890",
      "source": "OCR",
      "isNonLatin": false,
      "regionOfInterest": {
        "boundingBox": {
          "x": 100,
          "y": 50,
          "width": 300,
          "height": 100
        },
        "side": "front",
        "spectrum": "visible",
        "imageId": "img-001"
      }
    }
  ],
  "extractedFields": [
    {
      "label": "Full Name",
      "details": [
        {
          "label": "First Name",
          "value": "David",
          "source": "OCR"
        },
        {
          "label": "Last Name",
          "value": "Jones",
          "source": "OCR"
        }
      ]
    }
  ],
  "extractedImages": [
    {
      "label": "Face Photo",
      "side": "front",
      "imageID": "img-12345"
    }
  ]
}

DocumentValidationCheck

PropertyTypeDescription
namestringName of the validation check (e.g., “MRZ Check”)
titlestringDetailed title of the validation check
infostringDescription of the validation check
validationResultstringResult of the validation (e.g., “Passed”, “Failed”)
resultInfostringAdditional details about the validation result
weightstringWeight or priority of the validation check
regionOfInterestsarray of RegionOfInterestList of regions of interest related to the validation check
typestringType of validation check

Sample Data

{
  "name": "MRZ Check",
  "title": "Machine Readable Zone Validation",
  "info": "Verifies MRZ matches document details",
  "validationResult": "Passed",
  "resultInfo": "Valid MRZ format",
  "weight": "High",
  "regionOfInterests": [
    {
      "boundingBox": {
        "x": 50,
        "y": 200,
        "width": 250,
        "height": 50
      },
      "side": "back",
      "spectrum": "visible",
      "imageId": "img-002"
    }
  ],
  "type": "Security Check"
}

DocumentValidationInfoV1

PropertyTypeDescription
validationChecksarray of DocumentValidationCheckList of individual validation checks performed on the document
aggregatedValidationChecksarray of DocumentValidationCheckAggregated results of validation checks

Sample Data

{
  "validationChecks": [
    {
      "name": "MRZ Check",
      "title": "Machine Readable Zone Validation",
      "info": "Verifies MRZ matches document details",
      "validationResult": "Passed",
      "resultInfo": "Valid MRZ format",
      "weight": "High",
      "regionOfInterests": [
        {
          "boundingBox": {
            "x": 50,
            "y": 200,
            "width": 250,
            "height": 50
          },
          "side": "back",
          "spectrum": "visible",
          "imageId": "img-002"
        }
      ],
      "type": "Security Check"
    }
  ],
  "aggregatedValidationChecks": [
    {
      "name": "Security Features Check",
      "title": "Security Features Validation",
      "info": "Ensures embedded security features are valid",
      "validationResult": "Failed",
      "resultInfo": "Hologram not detected",
      "weight": "Medium",
      "regionOfInterests": [
        {
          "boundingBox": {
            "x": 100,
            "y": 150,
            "width": 200,
            "height": 100
          },
          "side": "front",
          "spectrum": "infrared",
          "imageId": "img-003"
        }
      ],
      "type": "Forgery Check"
    }
  ]
}

CommonBiometrics

PropertyTypeDescription
idstring (nullable)Unique identifier for the biometric data
typestring (nullable)Type of biometric data

Sample Data

{
  "id": "bio-123456",
  "type": "face-recognition"
}

FaceImageBiometricsCapture

Extends: CommonBiometrics

PropertyTypeDescription
idstring (nullable)Unique identifier for the biometric capture
faceImageBase64StringOrImageIdFace image in Base64 format or an image ID reference

Sample Data

{
  "id": "face-bio-789123",
  "type": "face-recognition",
  "faceImage": "/images/face-image-001"
}

FaceImageCompareBiometricsCapture

Extends: CommonBiometrics

PropertyTypeDescription
idstring (nullable)Unique identifier for the biometric comparison
face1ImageBase64StringOrImageIdFirst face image in Base64 format or an image ID reference
face2ImageBase64StringOrImageIdSecond face image in Base64 format or an image ID reference

Sample Data

{
  "id": "face-compare-456789",
  "type": "face-recognition",
  "face1Image": "/images/face1-image-002",
  "face2Image": "/images/face2-image-003"
}