Right to Work Share Code API Logo

UK Right To Work Share Code API

Getting Started

Endpoints

Responses

Testing

Getting Started

Making A Request

Signing Up

Making a Request to the API requires you to have an API key. You can obtain an API key by signing up via the home page or the pricing page.

Authentication

You can authenticate your requests by providing the API key as a value to the following HTTP header. X-UKRTWAPI-SECRET

Making a Request

You can make a request using any language, library or technology that can send HTTP requests. The base url is https://api.ukrtwchecker.co.uk

Please see the `Endpoints` section to view sample code for each endpoint. We also have a list of guides and integrations on our website.

Endpoints

/rtw

Validate an Applicant's right to work in the UK.

share_code (Required)

The Applicant's Share Code. This is usually 8-11 characters, a mixture of letters and numbers, starting with 'W'.

dob (Required)

The Applicant's date of birth (in the format dd-mm-yyyy).

forename (Required)

The Applicant's first name(s).

surname (Required)

The Applicant's surname(s)

company_name (Required)

The name of your company. This is required by the government for auditing purposes.

allow_sponsorship (Optional)

Accept or Reject applicants that require sponsorship. Can be set to “true” or “false”. (default: “true”).

allow_student (Optional)

Accept or Reject applicants that have student visas. Can be set to “true” or “false”. (default: “true”).

include_image (Optional)

Include an image of the applicant in the response. Returned as base64 encoded string. Can be set to “true” or “false”. (default: “false”).

Responses

API Response Object

The following are some of the codes that are present in the responses. You can use this as a guide to understand what each one means.

status

The main object of the response, attributes combine to describe the right to work check status.

conditions

Right to work conditions and restrictions. This might include information about how many hours an applicant can work per week, industries or roles that they are not permitted to work in etc.

details

Details of the check, usually acts as a summary.

expiry_date

When their right to work expires, formatted as dd-mm-yyyy

name

The full name of the applicant as it appears on the government document.

outcome

Result of the check given the parameters (including configurable parameters)

STATUS_ACCEPTED - Right to Work verified, configured parameters/conditions all satisfied.

STATUS_REJECTED - Right to work not verified, code found but failed some configured parameters/conditions.

STATUS_NOT_FOUND - Share code not valid

STATUS_LOCKED - Share code locked, usually means there have been too many checks on that share code in a time frame. Usually resolved by waiting for 10 minutes and trying again.

STATUS_EXPIRED - Share code was valid, but has since expired. (Note that this only shows up on the first check after expiry, from then on, it will return STATUS_NOT_FOUND).

start_date

When the Applicant's right to work is valid from, formatted as dd-mm-yyyy.

title

Title of the check (usually, this is “Right to Work”).

image

The Applicant's image encoded as a base64 string.

rejected_reason

Only present if the share code has been rejected due to configured parameters (such as allow_student, allow_sponsorship).

SPONSORSHIP - Applicant requires sponsorship, and the check was configured to reject applicants requiring sponsorship.

STUDENT - Applicant has a student visa, and the check was configured to reject applicants on student visas.

Testing

Conducting Test Checks

The following are a list of the testing codes that are supported in the API. Requests made with test codes do not count towards your quota, and you will not be charged for them. Please note that any optional parameters listed above are also applicable here. So, for example, setting include_image to “true” will return a base64 encoded image in the response.

TEST_ACCEPTED

Mock the response for a valid right to work share code.

TEST_NOT_FOUND

Mock the response for an invalid right to work share code (code not found by Government service).

TEST_NAME_MISMATCH

Mock the response for a valid right to work share code, but the name provided does not match the name associated with the share code.

TEST_SPONSOR

Mock the response for a valid right to work share code for an applicant that requires sponsorship. (this is useful if you'd like to test the behaviour of the allow_sponsorship parameter.

TEST_STUDENT

Mock the response for a valid right to work share code for an applicant that has a student visa. (this is useful if you'd like to test the behaviour of the allow_student parameter.

TEST_EXPIRED

Mock the response for a share code that is valid, but has expired.

Select Language:

import requests

url = "https://api.ukrtwchecker.co.uk/rtw"
headers = {
    "X-UKRTWAPI-SECRET": "YOUR_API_KEY"
}
params = {
    "code": "TEST_ACCEPTED",
    "forename": "John",
    "surname": "Doe",
    "dob": "07-09-1999",
    "company_name": "UK RTW Checker Ltd.",
    "allow_student": "true",
    "allow_sponsorship": "true"
}

response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
    print(response.json())
else:
    print(f"Error: {response.status_code}", response.text)

Useful Links

Get StartedContact UsPrivacy PolicyTerms of ServiceCookies
Follow us on LinkedIncontact@ukrtwchecker.co.uk+44 78 5612 8971
UK RTW Sharecode API Logo

UK Right To Work Share Code API

© Copyright all rights reserved.