Overview

Sterling uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate a success, codes in the 4xx range indicate a request that failed given the information provided (e.g. a required parameter was omitted, format issues, etc.), and codes in the 5xx range indicate an error with Sterling's servers.

When a request is valid but does not complete successfully, we return a 400# error code. Below you'll find more detailed information about the possible errors you can expect.

Error Format

The expected format for an error is as follows:

πŸ“˜

Error Format

{
      "code": "400#[optional-object]?[optional-reason]",
      "message": "[optional-message]"
}

Error Code Format

  • Example: 400#dob?format
  • HTTP error code (i.e. 400#)
  • Offending field when relevant (e.g. dob)
  • Brief message when applicable (e.g. format or required)

Error Message Format

  • The error message provides more context as to why the error occurred (e.g. "message": "dob must be in the format of YYYY-MM-DD")

Example:

{
      "code": "400#dob?format",
      "message": "dob must be in the format of YYYY-MM-DD"
}

🚧

Since the error message can change from time to time, we highly recommend you key off of the error code if you plan implement any automation for errors.

Candidate Validation Errors

Required Fields

codereason
400#address.addressLineaddressLine is required if address is present
400#address.countryCodecountryCode is required if address is present
400#address.postalCodepostalCode is required if address is present
409#clientReferenceId?already-in-useclientReferenceId already in use
409#email?already-in-useemail already in use

Examples

Error Message

{
  "errors": [
    {
      "code": "400#givenName",
      "message": "givenName is required"
    }
  ]
}

Solution

Include the "givenName" field in the candidate object:

{
    //...
    "givenName": "John",
    //...
}

Error Message

{
  "errors": [
    {
      "code": "400#address.addressLine",
      "message": "if address is provided, addressLine is required"
    }
  ]
}
Solution

In the "address" sub-object, include a "addressLine" field:

{
    //...
    "givenName": "John",
    //..
    "address": {
         "addressLine": "123 Example Street",
         "municipality": "ATLANTA",
         //..
     }
}

Format Validation Errors

codereason
400#dob?formatdob must be in the format of YYYY-MM-DD
400#ssn?formatssn is not in the expected format
400#phone?formatphone is not in the expected format
400#email?formatemail is not in the expected format
400#address.regionCode?formatregionCode format
400#address.postalCode?formatpostalCode format
400#address.countryCode?formatcountryCode format
400#driversLicense.licenseNumber?formatlicenseNumber is not in the expected format
400#driversLicense.issuingAgency?formatissuingAgency is not in the expected format
400#callback.uri?formatcallback.uri must be a valid https url

Screening Errors

codereason
400#candidateId?not-foundcandidateId must be a valid candidateId associated with the authenticated account
400#packageId?not-foundpackageId must be an active packageId associated with the authenticated account
400#documentTypedocumentType must be one of: [end-user-agreement, disclosure-and-authorization]
400#screening?required-dataStreet address is required
400#screening?required-dataPackage requires city of residence of candidate
400#screening?required-dataState is required
400#screening?required-dataZipcode is required
400#screening?required-dataPackage requires a valid date of birth of candidate
400#screening?required-dataNo Employer data provided
400#screening?required-dataNo Education data provided